From ae92ac6808a200b14a5bd03bb585c59fc4d919f2 Mon Sep 17 00:00:00 2001 From: nbaars Date: Tue, 9 Jan 2018 12:42:57 +0100 Subject: [PATCH] Changed the Vagrantfile to contain the correct release name Deleted the Vagrant files for setting up dev environment, today it is easy to setup the dev environment yourself to start working. --- webgoat-images/vagrant-developers/Vagrantfile | 32 ---------- webgoat-images/vagrant-training/Vagrantfile | 8 +-- webgoat-images/vagrant-users/Vagrantfile | 48 -------------- webgoat-images/vagrant_provision.sh | 62 ------------------- 4 files changed, 4 insertions(+), 146 deletions(-) delete mode 100644 webgoat-images/vagrant-developers/Vagrantfile delete mode 100644 webgoat-images/vagrant-users/Vagrantfile delete mode 100644 webgoat-images/vagrant_provision.sh diff --git a/webgoat-images/vagrant-developers/Vagrantfile b/webgoat-images/vagrant-developers/Vagrantfile deleted file mode 100644 index 47b41f3fc..000000000 --- a/webgoat-images/vagrant-developers/Vagrantfile +++ /dev/null @@ -1,32 +0,0 @@ -Vagrant.configure(2) do |config| - config.vm.box = "boxcutter/ubuntu1604-desktop" - - - config.vm.provider "virtualbox" do |vb| - vb.gui = true - vb.memory = "4096" - vb.cpus = 2 - vb.name = "WebGoat-Development" - vb.customize ["modifyvm", :id, "--nictype1", "virtio"] - end - - config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" - - config.vm.provision 'shell' do |s| - s.path = '../vagrant_provision.sh' - s.privileged = true - end - - config.vm.provision :shell, privileged:false, inline: <<-SHELL - echo -e "Cloning the WebGoat container repository" - git clone -b master https://github.com/WebGoat/WebGoat.git - echo -e "Cloning the WebGoat Lessons repository" - git clone -b master https://github.com/WebGoat/WebGoat-Lessons.git - SHELL - - config.vm.provision 'shell' do |s| - s.inline = "echo Finished provisioning, login with user vagrant pass vagrant" - end - -end - diff --git a/webgoat-images/vagrant-training/Vagrantfile b/webgoat-images/vagrant-training/Vagrantfile index d6c708fd5..ec6bc9b25 100644 --- a/webgoat-images/vagrant-training/Vagrantfile +++ b/webgoat-images/vagrant-training/Vagrantfile @@ -19,17 +19,17 @@ Vagrant.configure(2) do |config| end config.vm.provision "shell", inline: <<-SHELL - wget https://github.com/WebGoat/WebGoat/releases/download/v8.0.0.M5/webgoat-server-8.0.0.M6.jar - wget https://github.com/WebGoat/WebGoat/releases/download/v8.0.0.M5/webwolf-8.0.0.M6.jar + wget https://github.com/WebGoat/WebGoat/releases/download/v8.0.0.RELEASE/webgoat-server-8.0.0.RELEASE.jar + wget https://github.com/WebGoat/WebGoat/releases/download/v8.0.0.RELEASE/webwolf-8.0.0.RELEASE.jar sudo add-apt-repository ppa:openjdk-r/ppa sudo apt-get update sudo apt-get install openjdk-8-jre -y SHELL config.vm.provision "shell", run: "always", privileged: false, inline: <<-SHELL - java -jar webgoat-server-8.0.0.M6.jar & + java -jar webgoat-server-8.0.0.RELEASE.jar & sleep 40s - java -jar webwolf-8.0.0.M6.jar + java -jar webwolf-8.0.0.RELEASE.jar SHELL end diff --git a/webgoat-images/vagrant-users/Vagrantfile b/webgoat-images/vagrant-users/Vagrantfile deleted file mode 100644 index 41a97210b..000000000 --- a/webgoat-images/vagrant-users/Vagrantfile +++ /dev/null @@ -1,48 +0,0 @@ -#For now use the same as for developers but start WebGoat -#In the future we can add Docker as well and then Vagrant can start the -#Docker container or Chef which setups the Tomcat - -Vagrant.configure(2) do |config| - config.vm.box = "boxcutter/ubuntu1604-desktop" - config.vm.network :forwarded_port, guest: 8080, host: 9999 - config.vm.provider "virtualbox" do |vb| - vb.gui = false - vb.memory = "2048" - vb.cpus = 2 - vb.name = "WebGoat-Users" - vb.customize ["modifyvm", :id, "--nictype1", "virtio"] - end - config.vm.provider "vmware_fusion" do |vf| - vf.gui = false - vf.vmx["memsize"] = 4096 - vf.vmx["numvcpus"] = 2 - vf.vmx["displayname"] = "WebGoat-Users" - end - - config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" - - config.vm.provision 'shell' do |s| - s.path = '../vagrant_provision.sh' - s.privileged = true - end - - config.vm.provision :shell, inline: <<-SHELL - echo -e "Cloning the WebGoat container repository" - git clone -b master https://github.com/WebGoat/WebGoat.git - echo -e "Cloning the WebGoat Lessons repository" - git clone -b master https://github.com/WebGoat/WebGoat-Lessons.git - echo -e "Compiling and installing the WebGoat Container lesson server....." - mvn -q -DskipTests -file WebGoat/pom.xml clean compile install - echo -e "Compiling and installing the WebGoat Lessons $COL_RESET" - mvn -q -DskipTests -file WebGoat-Lessons/pom.xml package - echo -e "Copying the compiled lessons jars into the container so we can start the lesson server with some base lessons" - cp -fa ./WebGoat-Lessons/target/plugins/*.jar ./WebGoat/webgoat-container/src/main/webapp/plugin_lessons/ - nohup mvn -q -DskipTests -file WebGoat/pom.xml -pl webgoat-container tomcat7:run-war 0<&- &>/dev/null & - SHELL - - config.vm.provision 'shell' do |s| - s.inline = "echo Finished provisioning, open a browser and browse to http://localhost:9999/WebGoat/" - end - -end - diff --git a/webgoat-images/vagrant_provision.sh b/webgoat-images/vagrant_provision.sh deleted file mode 100644 index da88799e3..000000000 --- a/webgoat-images/vagrant_provision.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env bash -set -e - -echo "Setting locale..." -sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 - -sudo kill -9 $(lsof -t /var/lib/dpkg/lock) || true -sudo apt-get update -sudo apt-get install -y git - -echo "Installing required packages..." -sudo apt-get install -y -q build-essential autotools-dev automake pkg-config expect - - -## Chrome -wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - -sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' -sudo apt-get update -sudo apt-get install -y google-chrome-stable - -## Java 8 -echo "Provisioning Java 8..." -mkdir -p /home/vagrant/java -cd /home/vagrant/java -test -f /tmp/jdk-8-linux-x64.tar.gz || curl -q -L --cookie "oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz -o /tmp/jdk-8-linux-x64.tar.gz - -sudo mkdir -p /usr/lib/jvm -sudo tar zxf /tmp/jdk-8-linux-x64.tar.gz -C /usr/lib/jvm - -sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_144/bin/java" 1 -sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_144/bin/javac" 1 -sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.8.0_144/bin/javaws" 1 - -sudo chmod a+x /usr/bin/java -sudo chmod a+x /usr/bin/javac -sudo chmod a+x /usr/bin/javaws -sudo chown -R root:root /usr/lib/jvm/jdk1.8.0_144 - -echo "export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_144" >> /home/vagrant/.bashrc - -## Maven -echo "Installing Maven.." -sudo apt-get install -y maven - -## ZAP -echo "Provisioning ZAP..." -cd /home/vagrant -mkdir tools -cd tools -wget https://github.com/zaproxy/zaproxy/releases/download/2.5.0/ZAP_2.5.0_Linux.tar.gz -tar xvfx ZAP_2.5.0_Linux.tar.gz -rm -rf ZAP_2.5.0_Linux.tar.gz - -## IntelliJ -cd /home/vagrant/tools -wget https://download.jetbrains.com/idea/ideaIC-2016.1.4.tar.gz -tar xvfz ideaIC-2016.1.4.tar.gz -rm -rf ideaIC-2016.1.4.tar.gz - -## Eclipse -sudo apt-get -y install eclipse -