Deploying WebGoat on IBM Cloud

Here are the instructions on how to deploy and run WebGoat on a Kubernetes container service in the IBM Cloud.

You are expected to have an account at IBM Cloud and have configured a (free-plan) Kubernetes service cluster. And also have the proper IBM Cloud and Kubernetes Command Line Tools installed.

Step 1 – Login to your IBM Cloud

ibmcloud login

Step 2 – Login to your IBM Cloud Container Registry

ibmcloud cr login

Step 3 – Pull the WebGoat docker image

docker pull webgoat/goatandwolf

Step 4 – Tag the WebGoat docker image and push it to the Cloud Container Registry

docker image tag webgoat/goatandwolf 
docker push

Step 5 – Set the correct Kubernetes environment

ibmcloud cs cluster-config goatcluster
export KUBECONFIG=/..../kube-config-hou02-goatcluster.yml

Step 6 – Deploy the container on the Kubernetes cluster

kubectl run mygoat --env TZ=Europe/Amsterdam

Step 7 – Expose the external IP to the service

kubectl expose deployment/mygoat --type="NodePort" --port=8080,9090 --external-ip=184.someip

Step 8 – Run WebGoat and WebWolf

WebGoat is available at: http://184.someip:8080/WebGoat

WebWolf is available at: http://184.someip:9090/WebWolf