From 82198424df61bf4e39986c4159aa083dc7d6fead Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Apr 2021 16:50:32 -0400 Subject: [PATCH 01/57] Corrected typos and poor grammar found in the SQL Injection lessons. --- .../sql_injection/advanced/SqlInjectionLesson6a.java | 2 +- .../lessonPlans/en/SqlInjection_content6.adoc | 2 +- .../lessonPlans/en/SqlInjection_content6c.adoc | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/advanced/SqlInjectionLesson6a.java b/webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/advanced/SqlInjectionLesson6a.java index 89ca589eb..ed6642baa 100644 --- a/webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/advanced/SqlInjectionLesson6a.java +++ b/webgoat-lessons/sql-injection/src/main/java/org/owasp/webgoat/sql_injection/advanced/SqlInjectionLesson6a.java @@ -78,7 +78,7 @@ public AttackResult injectableQuery(String accountName) { String appendingWhenSucceded; if (usedUnion) - appendingWhenSucceded = "Well done! Can you also figure out a solution, by appending a new Sql Statement?"; + appendingWhenSucceded = "Well done! Can you also figure out a solution, by appending a new SQL Statement?"; else appendingWhenSucceded = "Well done! Can you also figure out a solution, by using a UNION?"; results.last(); diff --git a/webgoat-lessons/sql-injection/src/main/resources/lessonPlans/en/SqlInjection_content6.adoc b/webgoat-lessons/sql-injection/src/main/resources/lessonPlans/en/SqlInjection_content6.adoc index eaa85f902..63ea9e834 100644 --- a/webgoat-lessons/sql-injection/src/main/resources/lessonPlans/en/SqlInjection_content6.adoc +++ b/webgoat-lessons/sql-injection/src/main/resources/lessonPlans/en/SqlInjection_content6.adoc @@ -46,7 +46,7 @@ The UNION ALL Syntax also allows duplicate Values. === Joins -The Join operator is used to combine rows from two ore more tables, based on a related column +The Join operator is used to combine rows from two or more tables, based on a related column [source] ----- diff --git a/webgoat-lessons/sql-injection/src/main/resources/lessonPlans/en/SqlInjection_content6c.adoc b/webgoat-lessons/sql-injection/src/main/resources/lessonPlans/en/SqlInjection_content6c.adoc index b7bd0b165..1ed75d232 100644 --- a/webgoat-lessons/sql-injection/src/main/resources/lessonPlans/en/SqlInjection_content6c.adoc +++ b/webgoat-lessons/sql-injection/src/main/resources/lessonPlans/en/SqlInjection_content6c.adoc @@ -9,7 +9,7 @@ injection. Let us first start with the difference between a normal SQL injection and a blind SQL injection. In a normal SQL injection the error messages from the database are displayed and gives enough information to find out how -the query is working. Or in the case of an UNION based SQL injection the application does not reflect the information +the query is working. Or in the case of a UNION based SQL injection the application does not reflect the information directly on the web page. So in the case where nothing is displayed you will need to start asking the database questions based on a true or false statement. That is why a blind SQL injection is much more difficult to exploit. @@ -18,7 +18,7 @@ There are several different types of blind SQL injections: content-based and tim === Example -In this case we are trying to ask the database a boolean question based on for example an unique id, for example +In this case we are trying to ask the database a boolean question based on a unique id, for example suppose we have the following url: `https://my-shop.com?article=4` On the server side this query will be translated as follows: @@ -39,7 +39,7 @@ If the browser responds with a page not found or something else you know a blind You can now change the SQL query and test for example: `https://shop.example.com?article=4 AND 1=2` which will not return anything because the query returns false. -So but how do we actually take advantage of this? Above we only asked the database for trivial question but you can +How do we actually take advantage of this? Above we only asked the database a trivial question but you can for example also use the following url: `https://shop.example.com?article=4 AND substring(database_version(),1,1) = 2` Most of the time you start by finding which type of database is used, based on the type of database you can find @@ -50,8 +50,8 @@ system tables cannot be queried with the user used to connect from the web appli Another way is called a time-based SQL injection, in this case you will ask the database to wait before returning -the result. You might need to use this if you are totally blind so there is no difference between the response you -can use for example: +the result. You might need to use this if you are totally blind. This means there is no difference between the response data. +To achieve this kind of SQL injection you could use: ---- article = 4; sleep(10) -- From 721edc9985dc134f0d4e01450d6e7f2d8430e36f Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Fri, 2 Apr 2021 11:03:59 +0200 Subject: [PATCH 02/57] Move WebGoat to Java 15 --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 8 ++++---- docker/Dockerfile | 2 +- docker/Readme.md | 2 +- pom.xml | 5 +++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a9d87637..7b53ba014 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - java: [11, 15] + java: [15] steps: - uses: actions/checkout@v2 - name: Set up JDK ${{ matrix.java }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3b9bf1c46..1af644c2c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,10 +16,10 @@ jobs: id: tag uses: dawidd6/action-get-tag@v1 - - name: Set up JDK 11 + - name: Set up JDK 15 uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 15 architecture: x64 - name: Cache Maven packages @@ -111,10 +111,10 @@ jobs: ref: develop token: ${{ secrets.WEBGOAT_DEPLOYER_TOKEN }} - - name: Set up JDK 11 + - name: Set up JDK 15 uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 15 architecture: x64 - name: Set version to next snapshot diff --git a/docker/Dockerfile b/docker/Dockerfile index 2f5df2edc..cb48d17fd 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM openjdk:11.0.1-jre-slim-stretch +FROM openjdk:15.0.2-slim ARG webgoat_version=v8.2.0-SNAPSHOT ENV webgoat_version_env=${webgoat_version} diff --git a/docker/Readme.md b/docker/Readme.md index 8e321fa9b..4f2fcc6cf 100644 --- a/docker/Readme.md +++ b/docker/Readme.md @@ -2,7 +2,7 @@ ## Docker build - docker build --no-cache --build-arg webgoat_version=v8.2.0-SNAPSHOT -t webgoat/goatandwolf:latest . + docker build --no-cache --build-arg webgoat_version=8.2.0-SNAPSHOT -t webgoat/goatandwolf:latest . ## Docker run diff --git a/pom.xml b/pom.xml index 2c27c7f8f..f85302695 100644 --- a/pom.xml +++ b/pom.xml @@ -115,8 +115,8 @@ UTF-8 UTF-8 - 11 - 11 + 15 + 15 build @@ -134,6 +134,7 @@ 3.1.1 3.1.0 3.0.0-M4 + 15 From 3e8dbc9bc924bd6450c197d5d9df067814268037 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Fri, 2 Apr 2021 21:25:04 +0200 Subject: [PATCH 03/57] Run build on pull requests as well --- .github/workflows/build.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7b53ba014..2e9bd730d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,24 @@ name: "Build" on: + pull_request: + paths-ignore: + - '.txt' + - '*.MD' + - '*.md' + - 'LICENSE' + - 'docs/**' push: - branches: [ '*' ] + branches: + - master + - develop tags-ignore: - '*' + paths-ignore: + - '.txt' + - '*.MD' + - '*.md' + - 'LICENSE' + - 'docs/**' jobs: build: From abf431fffb835b62e842e8ea37630bed97da5b1b Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Fri, 2 Apr 2021 21:43:09 +0200 Subject: [PATCH 04/57] Remove unnecessary plugins in subprojects --- webgoat-lessons/pom.xml | 28 ---------------------------- webwolf/pom.xml | 19 ------------------- 2 files changed, 47 deletions(-) diff --git a/webgoat-lessons/pom.xml b/webgoat-lessons/pom.xml index c1ab7af78..fad8120f3 100644 --- a/webgoat-lessons/pom.xml +++ b/webgoat-lessons/pom.xml @@ -71,7 +71,6 @@ org.springframework.security spring-security-test - 4.1.3.RELEASE test @@ -85,31 +84,4 @@ - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${maven-surefire-plugin.version} - - 0 - true - - --illegal-access=permit - - - - - org.apache.maven.plugins - maven-compiler-plugin - ${maven-compiler-plugin.version} - - 11 - 11 - UTF-8 - - - - diff --git a/webwolf/pom.xml b/webwolf/pom.xml index fa45cb3e8..2a1093857 100644 --- a/webwolf/pom.xml +++ b/webwolf/pom.xml @@ -115,15 +115,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - - 11 - 11 - UTF-8 - - org.springframework.boot spring-boot-maven-plugin @@ -143,16 +134,6 @@ - - org.apache.maven.plugins - maven-surefire-plugin - - never - - --illegal-access=permit - - - From ee1d4b0ac136159bbd4f536ce9497bfcc346e4b4 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Fri, 2 Apr 2021 21:43:46 +0200 Subject: [PATCH 05/57] Update documentation for Java 15 --- README.MD | 4 ++-- pom.xml | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.MD b/README.MD index c9e13d645..bdb8a3af1 100644 --- a/README.MD +++ b/README.MD @@ -82,7 +82,7 @@ java -jar webgoat-server-8.1.0.jar [--server.port=8080] [--server.address=localh java -jar webwolf-8.1.0.jar [--server.port=9090] [--server.address=localhost] ``` -The latest version of WebGoat needs Java 11 or above. By default WebGoat and WebWolf start on port 8080,9000 and 9090 with the environment variable WEBGOAT_PORT, WEBWOLF_PORT and WEBGOAT_HSQLPORT you can set different values. +The latest version of WebGoat needs Java 15 or above. By default WebGoat and WebWolf start on port 8080,9000 and 9090 with the environment variable WEBGOAT_PORT, WEBWOLF_PORT and WEBGOAT_HSQLPORT you can set different values. ```Shell export WEBGOAT_PORT=18080 export WEBGOAT_HSQLPORT=19001 @@ -97,7 +97,7 @@ Use set in stead of export on Windows cmd. ### Prerequisites: -* Java 11 +* Java 15 * Maven > 3.2.1 * Your favorite IDE * Git, or Git support in your IDE diff --git a/pom.xml b/pom.xml index f85302695..6022a416e 100644 --- a/pom.xml +++ b/pom.xml @@ -189,9 +189,10 @@ org.apache.maven.plugins maven-compiler-plugin + ${maven-compiler-plugin.version} - 11 - 11 + 15 + 15 UTF-8 @@ -213,7 +214,7 @@ maven-pmd-plugin 3.14.0 - 11 + 15 1 From b76330f20f534b701c286497f7235ae5ae2f9e14 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Wed, 31 Mar 2021 21:31:27 +0200 Subject: [PATCH 06/57] Add minimal Maven version --- pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pom.xml b/pom.xml index 6022a416e..dc28eacba 100644 --- a/pom.xml +++ b/pom.xml @@ -13,6 +13,10 @@ 2006 https://github.com/WebGoat/WebGoat + + 3.2.5 + + OWASP https://github.com/WebGoat/WebGoat/ From b858484b9742fcd3f611e932999bfcc8d99635d7 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Wed, 31 Mar 2021 21:34:05 +0200 Subject: [PATCH 07/57] Copy jar files to target so they are not stored in the current project directory --- docker/.gitignore | 1 - docker/Dockerfile | 6 +++--- docker/pom.xml | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 docker/.gitignore diff --git a/docker/.gitignore b/docker/.gitignore deleted file mode 100644 index d392f0e82..000000000 --- a/docker/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.jar diff --git a/docker/Dockerfile b/docker/Dockerfile index cb48d17fd..821658841 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM openjdk:15.0.2-slim -ARG webgoat_version=v8.2.0-SNAPSHOT +ARG webgoat_version=8.2.1-SNAPSHOT ENV webgoat_version_env=${webgoat_version} RUN apt-get update && apt-get install @@ -14,8 +14,8 @@ USER webgoat COPY nginx.conf /etc/nginx/nginx.conf COPY index.html /usr/share/nginx/html/ -COPY webgoat-server-${webgoat_version}.jar /home/webgoat/webgoat.jar -COPY webwolf-${webgoat_version}.jar /home/webgoat/webwolf.jar +COPY target/webgoat-server-${webgoat_version}.jar /home/webgoat/webgoat.jar +COPY target/webwolf-${webgoat_version}.jar /home/webgoat/webwolf.jar COPY start.sh /home/webgoat EXPOSE 8080 diff --git a/docker/pom.xml b/docker/pom.xml index 224610dde..0ef6599a5 100644 --- a/docker/pom.xml +++ b/docker/pom.xml @@ -24,8 +24,8 @@ install - - + + From b3f7a5338e2a6596144b4395fbf535581ff122bb Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Wed, 31 Mar 2021 23:05:27 +0200 Subject: [PATCH 08/57] Update to latest versions --- docker/pom.xml | 2 +- webgoat-container/pom.xml | 2 +- .../owasp/webgoat/asciidoc/OperatingSystemMacro.java | 12 ++++++++---- .../owasp/webgoat/asciidoc/WebGoatTmpDirMacro.java | 9 +++++++-- .../owasp/webgoat/asciidoc/WebGoatVersionMacro.java | 9 +++++++-- .../org/owasp/webgoat/asciidoc/WebWolfMacro.java | 8 ++++++-- .../org/owasp/webgoat/asciidoc/WebWolfRootMacro.java | 4 ++++ webgoat-integration-tests/pom.xml | 2 +- webgoat-lessons/challenge/pom.xml | 3 +-- webgoat-lessons/cross-site-scripting/pom.xml | 2 +- webgoat-lessons/html-tampering/pom.xml | 1 - webgoat-lessons/insecure-deserialization/pom.xml | 1 - webgoat-lessons/insecure-login/pom.xml | 1 - webgoat-lessons/jwt/pom.xml | 4 ++-- webgoat-lessons/password-reset/pom.xml | 1 - webgoat-lessons/secure-passwords/pom.xml | 2 +- webgoat-lessons/ssrf/pom.xml | 1 - webgoat-lessons/vulnerable-components/pom.xml | 8 ++++---- webgoat-lessons/xxe/pom.xml | 4 ++-- webwolf/pom.xml | 6 +++--- 20 files changed, 49 insertions(+), 33 deletions(-) diff --git a/docker/pom.xml b/docker/pom.xml index 0ef6599a5..70ee16e14 100644 --- a/docker/pom.xml +++ b/docker/pom.xml @@ -18,7 +18,7 @@ org.apache.maven.plugins maven-antrun-plugin - 1.8 + 3.0.0 install diff --git a/webgoat-container/pom.xml b/webgoat-container/pom.xml index 33cbd19cc..96d0ca51d 100644 --- a/webgoat-container/pom.xml +++ b/webgoat-container/pom.xml @@ -70,7 +70,7 @@ org.asciidoctor asciidoctorj - 1.5.8.1 + 2.4.3 org.springframework.boot diff --git a/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/OperatingSystemMacro.java b/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/OperatingSystemMacro.java index d965c2454..91613c309 100644 --- a/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/OperatingSystemMacro.java +++ b/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/OperatingSystemMacro.java @@ -1,18 +1,22 @@ package org.owasp.webgoat.asciidoc; -import java.util.Map; - -import org.asciidoctor.ast.AbstractBlock; +import org.asciidoctor.ast.ContentNode; import org.asciidoctor.extension.InlineMacroProcessor; +import java.util.Map; + public class OperatingSystemMacro extends InlineMacroProcessor { + public OperatingSystemMacro(String macroName) { + super(macroName); + } + public OperatingSystemMacro(String macroName, Map config) { super(macroName, config); } @Override - public String process(AbstractBlock parent, String target, Map attributes) { + public Object process(ContentNode contentNode, String target, Map attributes) { return System.getProperty("os.name"); } } diff --git a/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebGoatTmpDirMacro.java b/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebGoatTmpDirMacro.java index 845815d9f..3310a22fe 100644 --- a/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebGoatTmpDirMacro.java +++ b/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebGoatTmpDirMacro.java @@ -1,17 +1,22 @@ package org.owasp.webgoat.asciidoc; -import org.asciidoctor.ast.AbstractBlock; +import org.asciidoctor.ast.ContentNode; import org.asciidoctor.extension.InlineMacroProcessor; + import java.util.Map; public class WebGoatTmpDirMacro extends InlineMacroProcessor { + public WebGoatTmpDirMacro(String macroName) { + super(macroName); + } + public WebGoatTmpDirMacro(String macroName, Map config) { super(macroName, config); } @Override - public String process(AbstractBlock parent, String target, Map attributes) { + public String process(ContentNode contentNode, String target, Map attributes) { return EnvironmentExposure.getEnv().getProperty("webgoat.server.directory"); } } diff --git a/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebGoatVersionMacro.java b/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebGoatVersionMacro.java index b736f4afe..8029ab0fd 100644 --- a/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebGoatVersionMacro.java +++ b/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebGoatVersionMacro.java @@ -1,17 +1,22 @@ package org.owasp.webgoat.asciidoc; -import org.asciidoctor.ast.AbstractBlock; +import org.asciidoctor.ast.ContentNode; import org.asciidoctor.extension.InlineMacroProcessor; + import java.util.Map; public class WebGoatVersionMacro extends InlineMacroProcessor { + public WebGoatVersionMacro(String macroName) { + super(macroName); + } + public WebGoatVersionMacro(String macroName, Map config) { super(macroName, config); } @Override - public String process(AbstractBlock parent, String target, Map attributes) { + public String process(ContentNode contentNode, String target, Map attributes) { return EnvironmentExposure.getEnv().getProperty("webgoat.build.version"); } } diff --git a/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebWolfMacro.java b/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebWolfMacro.java index d78d62765..40b1ba555 100644 --- a/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebWolfMacro.java +++ b/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebWolfMacro.java @@ -1,6 +1,6 @@ package org.owasp.webgoat.asciidoc; -import org.asciidoctor.ast.AbstractBlock; +import org.asciidoctor.ast.ContentNode; import org.asciidoctor.extension.InlineMacroProcessor; import org.springframework.core.env.Environment; import org.springframework.web.context.request.RequestContextHolder; @@ -17,12 +17,16 @@ */ public class WebWolfMacro extends InlineMacroProcessor { + public WebWolfMacro(String macroName) { + super(macroName); + } + public WebWolfMacro(String macroName, Map config) { super(macroName, config); } @Override - public String process(AbstractBlock parent, String target, Map attributes) { + public String process(ContentNode contentNode, String target, Map attributes) { Environment env = EnvironmentExposure.getEnv(); String hostname = determineHost(env.getProperty("webwolf.host"), env.getProperty("webwolf.port")); diff --git a/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebWolfRootMacro.java b/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebWolfRootMacro.java index b188c2a66..7491af6fb 100644 --- a/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebWolfRootMacro.java +++ b/webgoat-container/src/main/java/org/owasp/webgoat/asciidoc/WebWolfRootMacro.java @@ -10,6 +10,10 @@ */ public class WebWolfRootMacro extends WebWolfMacro { + public WebWolfRootMacro(String macroName) { + super(macroName); + } + public WebWolfRootMacro(String macroName, Map config) { super(macroName, config); } diff --git a/webgoat-integration-tests/pom.xml b/webgoat-integration-tests/pom.xml index 0690413d4..c5b095eae 100644 --- a/webgoat-integration-tests/pom.xml +++ b/webgoat-integration-tests/pom.xml @@ -18,7 +18,7 @@ io.github.bonigarcia webdrivermanager - 4.2.2 + 4.3.1 test diff --git a/webgoat-lessons/challenge/pom.xml b/webgoat-lessons/challenge/pom.xml index accce8025..874053493 100644 --- a/webgoat-lessons/challenge/pom.xml +++ b/webgoat-lessons/challenge/pom.xml @@ -14,7 +14,7 @@ io.jsonwebtoken jjwt - 0.7.0 + 0.9.1 org.springframework.boot @@ -24,7 +24,6 @@ org.springframework.security spring-security-test - 4.1.3.RELEASE test diff --git a/webgoat-lessons/cross-site-scripting/pom.xml b/webgoat-lessons/cross-site-scripting/pom.xml index 1b72ff455..7a0171373 100644 --- a/webgoat-lessons/cross-site-scripting/pom.xml +++ b/webgoat-lessons/cross-site-scripting/pom.xml @@ -13,7 +13,7 @@ org.jsoup jsoup - 1.11.3 + 1.13.1 diff --git a/webgoat-lessons/html-tampering/pom.xml b/webgoat-lessons/html-tampering/pom.xml index fd06dd7cc..5478f4126 100755 --- a/webgoat-lessons/html-tampering/pom.xml +++ b/webgoat-lessons/html-tampering/pom.xml @@ -18,7 +18,6 @@ org.springframework.security spring-security-test - 4.1.3.RELEASE test diff --git a/webgoat-lessons/insecure-deserialization/pom.xml b/webgoat-lessons/insecure-deserialization/pom.xml index 9e462d155..7db02049a 100755 --- a/webgoat-lessons/insecure-deserialization/pom.xml +++ b/webgoat-lessons/insecure-deserialization/pom.xml @@ -18,7 +18,6 @@ org.springframework.security spring-security-test - 4.1.3.RELEASE test diff --git a/webgoat-lessons/insecure-login/pom.xml b/webgoat-lessons/insecure-login/pom.xml index 5c4dd18b6..73f64d793 100755 --- a/webgoat-lessons/insecure-login/pom.xml +++ b/webgoat-lessons/insecure-login/pom.xml @@ -18,7 +18,6 @@ org.springframework.security spring-security-test - 4.1.3.RELEASE test diff --git a/webgoat-lessons/jwt/pom.xml b/webgoat-lessons/jwt/pom.xml index b86dff4d7..9add3ad70 100644 --- a/webgoat-lessons/jwt/pom.xml +++ b/webgoat-lessons/jwt/pom.xml @@ -13,12 +13,12 @@ io.jsonwebtoken jjwt - 0.7.0 + 0.9.1 org.springframework.security spring-security-test - 4.1.3.RELEASE + 5.4.5 test diff --git a/webgoat-lessons/password-reset/pom.xml b/webgoat-lessons/password-reset/pom.xml index 574c22f32..f4aa1f5f2 100644 --- a/webgoat-lessons/password-reset/pom.xml +++ b/webgoat-lessons/password-reset/pom.xml @@ -13,7 +13,6 @@ org.springframework.security spring-security-test - 4.1.3.RELEASE test diff --git a/webgoat-lessons/secure-passwords/pom.xml b/webgoat-lessons/secure-passwords/pom.xml index 950cb26c3..8d1e26787 100644 --- a/webgoat-lessons/secure-passwords/pom.xml +++ b/webgoat-lessons/secure-passwords/pom.xml @@ -13,7 +13,7 @@ com.nulab-inc zxcvbn - 1.2.5 + 1.4.0 \ No newline at end of file diff --git a/webgoat-lessons/ssrf/pom.xml b/webgoat-lessons/ssrf/pom.xml index 48a85a78b..15242416c 100755 --- a/webgoat-lessons/ssrf/pom.xml +++ b/webgoat-lessons/ssrf/pom.xml @@ -18,7 +18,6 @@ org.springframework.security spring-security-test - 4.1.3.RELEASE test diff --git a/webgoat-lessons/vulnerable-components/pom.xml b/webgoat-lessons/vulnerable-components/pom.xml index 97ded9f15..827c349c1 100644 --- a/webgoat-lessons/vulnerable-components/pom.xml +++ b/webgoat-lessons/vulnerable-components/pom.xml @@ -12,22 +12,22 @@ com.thoughtworks.xstream xstream - 1.4.5 + 1.4.5 cglib cglib-nodep - 2.2 + 2.2 ant ant-launcher - 1.6.2 + 1.6.5 ant ant - 1.6.2 + 1.6.5 xml-resolver diff --git a/webgoat-lessons/xxe/pom.xml b/webgoat-lessons/xxe/pom.xml index 263fef6cd..7f4e3c007 100644 --- a/webgoat-lessons/xxe/pom.xml +++ b/webgoat-lessons/xxe/pom.xml @@ -18,13 +18,13 @@ org.glassfish.jaxb jaxb-runtime - 2.3.0 + 3.0.0 com.github.tomakehurst wiremock - 2.8.0 + 2.27.2 test diff --git a/webwolf/pom.xml b/webwolf/pom.xml index 2a1093857..dffb992f9 100644 --- a/webwolf/pom.xml +++ b/webwolf/pom.xml @@ -39,7 +39,7 @@ org.bitbucket.b_c jose4j - 0.7.2 + 0.7.6 org.springframework.boot @@ -84,12 +84,12 @@ org.webjars bootstrap - 3.3.7 + 5.0.0-beta3 org.webjars jquery - 3.2.1 + 3.6.0 org.hsqldb From 5d45fd6260a95ba8ddfbf8716cf4bea0541cee25 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Thu, 1 Apr 2021 16:43:40 +0200 Subject: [PATCH 09/57] Update Checkstyle version --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index dc28eacba..e3f19dddb 100644 --- a/pom.xml +++ b/pom.xml @@ -203,7 +203,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.1.0 + 3.1.2 UTF-8 true @@ -249,7 +249,7 @@ org.owasp dependency-check-maven - 5.3.2 + 6.1.3 7 true From d0f36f52273d83712479e00bc4cdec02147413d0 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Sat, 3 Apr 2021 22:31:27 +0200 Subject: [PATCH 10/57] Fix failing XXE test --- webgoat-lessons/xxe/pom.xml | 2 +- .../owasp/webgoat/xxe/BlindSendFileAssignmentTest.java | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/webgoat-lessons/xxe/pom.xml b/webgoat-lessons/xxe/pom.xml index 7f4e3c007..3e2e87a39 100644 --- a/webgoat-lessons/xxe/pom.xml +++ b/webgoat-lessons/xxe/pom.xml @@ -18,7 +18,7 @@ org.glassfish.jaxb jaxb-runtime - 3.0.0 + 2.3.0 diff --git a/webgoat-lessons/xxe/src/test/java/org/owasp/webgoat/xxe/BlindSendFileAssignmentTest.java b/webgoat-lessons/xxe/src/test/java/org/owasp/webgoat/xxe/BlindSendFileAssignmentTest.java index b5d09c582..ae94abffe 100644 --- a/webgoat-lessons/xxe/src/test/java/org/owasp/webgoat/xxe/BlindSendFileAssignmentTest.java +++ b/webgoat-lessons/xxe/src/test/java/org/owasp/webgoat/xxe/BlindSendFileAssignmentTest.java @@ -2,10 +2,8 @@ import com.github.tomakehurst.wiremock.WireMockServer; import com.github.tomakehurst.wiremock.client.WireMock; -import com.github.tomakehurst.wiremock.junit.WireMockRule; import com.github.tomakehurst.wiremock.verification.LoggedRequest; import org.hamcrest.CoreMatchers; -import org.junit.Rule; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -19,13 +17,8 @@ import java.io.File; import java.util.List; -import static com.github.tomakehurst.wiremock.client.WireMock.aResponse; -import static com.github.tomakehurst.wiremock.client.WireMock.findAll; -import static com.github.tomakehurst.wiremock.client.WireMock.get; -import static com.github.tomakehurst.wiremock.client.WireMock.getRequestedFor; -import static com.github.tomakehurst.wiremock.client.WireMock.urlMatching; +import static com.github.tomakehurst.wiremock.client.WireMock.*; import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.options; -import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; From 94f79f887b5668cda5e0dd861575daf991e0ecd1 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Sat, 3 Apr 2021 13:49:55 +0200 Subject: [PATCH 11/57] Remove platform dependent deployments They are part of the repository since 2017 they have never been updated and probably don't work anymore --- buildspec.yml | 12 -- platformQuickStarts/AWS/README.md | 31 ----- .../codepipelinebuild/01_IAM_codebuild.json | 101 -------------- .../01_IAM_codepipeline.json | 127 ------------------ .../codepipelinebuild/01_codepiplinebuild.yml | 123 ----------------- .../AWS/codepipelinebuild/README.md | 64 --------- platformQuickStarts/GCP/GKE-Docker/README.md | 80 ----------- platformQuickStarts/GCP/GKE-Docker/deploy.cfg | 4 - .../GCP/GKE-Docker/gke-deploy-config.sh | 4 - .../webgoat_deployment_noDNSnoTLS.yml | 39 ------ platformQuickStarts/GCP/README.md | 17 --- platformQuickStarts/README.md | 22 --- 12 files changed, 624 deletions(-) delete mode 100644 buildspec.yml delete mode 100644 platformQuickStarts/AWS/README.md delete mode 100644 platformQuickStarts/AWS/codepipelinebuild/01_IAM_codebuild.json delete mode 100644 platformQuickStarts/AWS/codepipelinebuild/01_IAM_codepipeline.json delete mode 100644 platformQuickStarts/AWS/codepipelinebuild/01_codepiplinebuild.yml delete mode 100644 platformQuickStarts/AWS/codepipelinebuild/README.md delete mode 100644 platformQuickStarts/GCP/GKE-Docker/README.md delete mode 100644 platformQuickStarts/GCP/GKE-Docker/deploy.cfg delete mode 100644 platformQuickStarts/GCP/GKE-Docker/gke-deploy-config.sh delete mode 100644 platformQuickStarts/GCP/GKE-Docker/webgoat_deployment_noDNSnoTLS.yml delete mode 100644 platformQuickStarts/GCP/README.md delete mode 100644 platformQuickStarts/README.md diff --git a/buildspec.yml b/buildspec.yml deleted file mode 100644 index 477440e02..000000000 --- a/buildspec.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: 0.1 - -phases: - build: - commands: - - mvn package - -artifacts: - files: - - webgoat-server/target/webgoat-server-8.0-SNAPSHOT.jar - discard-paths: yes - diff --git a/platformQuickStarts/AWS/README.md b/platformQuickStarts/AWS/README.md deleted file mode 100644 index 762bdda12..000000000 --- a/platformQuickStarts/AWS/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# AWS - -- This contains the various platform Quick Starts for Getting WebGoat Deployed into AWS. -- This IaaS quickstart uses AWS CloudFormation to perform most of the provisioning -- This IaaS quickstart is composed of three independent bundles - - Code pipeline and Build - - Deploying to EC2 - - Deploying to ECS - - -It is Assumed: -- You have an AWS Account -- You know what an S3 bucket is -- You have seen the IAM console and have permissions to create IAM Roles - - - - -## Code Pipeline and Build - -This Quickstart is for those that just want to perform builds with AWS. It Triggers off of Github to perform builds of `webgoat-server` - - - -## EC2 - -(WIP) This uses AWS CodePipeline, CodeBuild, and CodeDeploy to land WebGoat to Running EC2 instances - -## ECS - -(WIP) This uses AWS CodePipeline, CodeBuild, ECR, to land a container onto an ECS cluster \ No newline at end of file diff --git a/platformQuickStarts/AWS/codepipelinebuild/01_IAM_codebuild.json b/platformQuickStarts/AWS/codepipelinebuild/01_IAM_codebuild.json deleted file mode 100644 index 2fbf17f5a..000000000 --- a/platformQuickStarts/AWS/codepipelinebuild/01_IAM_codebuild.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "AWSTemplateFormatVersion": "2010-09-09", - "Description": "IAM Roles for Code Build WebGoat IaaS Quickstart", - "Parameters": { - "qsS3BucketName": { - "Description": "Name of the S3 Bucket for artifacts", - "Type": "String", - "MinLength": "1" - }, - "qsRoleName": { - "Description": "Name of the IAM role that CodeBuild Will Use", - "Type": "String", - "Default": "SimpleCodeBuildRole", - "MinLength": "1" - } - }, - "Resources": { - "qsCodeBuildRole": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Principal": { - "Service": [ - "codebuild.amazonaws.com" - ] - }, - "Action": [ - "sts:AssumeRole" - ] - } - ] - }, - "Path": "/webgoat/", - "RoleName": { - "Ref": "qsRoleName" - }, - "ManagedPolicyArns": [ - "arn:aws:iam::aws:policy/AWSCodeCommitFullAccess", - "arn:aws:iam::aws:policy/AWSCodeBuildDeveloperAccess", - "arn:aws:iam::aws:policy/AWSCodeDeployDeployerAccess" - ], - "Policies": [ - { - "PolicyName": "CloudWatchLogs", - "PolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Resource": [ - {"Fn::Join": [ "",["arn:aws:logs:*:", { "Ref": "AWS::AccountId" }, ":log-group:/aws/codebuild*" ] ]} - ], - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ] - } - ] - } - }, - { - "PolicyName": "S3buckets", - "PolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:aws:s3:::", - { - "Ref": "qsS3BucketName" - }, - "*" - ] - ] - }, - "arn:aws:s3:::codepipeline-*" - ], - "Action": [ - "s3:Put*", - "s3:Get*", - "s3:List*" - ] - } - ] - } - } - ] - } - } - } -} diff --git a/platformQuickStarts/AWS/codepipelinebuild/01_IAM_codepipeline.json b/platformQuickStarts/AWS/codepipelinebuild/01_IAM_codepipeline.json deleted file mode 100644 index 58fd9f1f4..000000000 --- a/platformQuickStarts/AWS/codepipelinebuild/01_IAM_codepipeline.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "AWSTemplateFormatVersion": "2010-09-09", - "Description": "IAM Role for Code Pipeline WebGoat IaaS Quickstart", - "Parameters": { - "qsS3BucketName": { - "Description": "Name of the S3 Bucket for artifacts", - "Type": "String", - "MinLength": "1" - }, - "qsRoleName": { - "Description": "Name of the IAM role that CodePipeline Will Use", - "Type": "String", - "Default": "SimpleCodePipelineRole", - "MinLength": "1" - } - }, - "Resources": { - "qsCodePipelineRole": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Sid": "", - "Effect": "Allow", - "Principal": { - "Service": "codepipeline.amazonaws.com" - }, - "Action": "sts:AssumeRole" - } - ] - }, - "Path": "/webgoat/", - "RoleName": { - "Ref": "qsRoleName" - }, - "ManagedPolicyArns": [ - "arn:aws:iam::aws:policy/AWSCodeCommitFullAccess", - "arn:aws:iam::aws:policy/AWSCodeBuildDeveloperAccess", - "arn:aws:iam::aws:policy/AWSCodeDeployDeployerAccess" - ], - "Policies": [ - { - "PolicyName": "CloudWatchLogsPipeline", - "PolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Resource": [ - {"Fn::Join": [ "",["arn:aws:logs:*:", { "Ref": "AWS::AccountId" }, ":log-group:/aws/*" ] ]} - ], - "Action": [ - "logs:CreateLogGroup", - "logs:CreateLogStream", - "logs:PutLogEvents" - ] - } - ] - } - }, - { - "PolicyName": "MiscComputeOpen", - "PolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Resource": "*", - "Action": [ - "lambda:InvokeFunction", - "lambda:ListFunctions", - "elasticbeanstalk:*", - "ec2:*", - "elasticloadbalancing:*", - "autoscaling:*", - "cloudwatch:*", - "s3:*", - "sns:*", - "cloudformation:*", - "rds:*", - "sqs:*", - "ecs:*", - "iam:PassRole" - ] - } - ] - } - }, - { - "PolicyName": "S3buckets", - "PolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Effect": "Allow", - "Resource": [ - { - "Fn::Join": [ - "", - [ - "arn:aws:s3:::", - { - "Ref": "qsS3BucketName" - }, - "*" - ] - ] - }, - "arn:aws:s3:::codepipeline-*", - "arn:aws:s3:::elasticbeanstalk*" - ], - "Action": [ - "s3:Put*", - "s3:Get*", - "s3:List*" - ] - } - ] - } - } - ] - } - } - } -} diff --git a/platformQuickStarts/AWS/codepipelinebuild/01_codepiplinebuild.yml b/platformQuickStarts/AWS/codepipelinebuild/01_codepiplinebuild.yml deleted file mode 100644 index 8aac7af2a..000000000 --- a/platformQuickStarts/AWS/codepipelinebuild/01_codepiplinebuild.yml +++ /dev/null @@ -1,123 +0,0 @@ -AWSTemplateFormatVersion: "2010-09-09" - -Description: > - AWS Cloud Formation for creating an AWS CodePipeline that checks a git repo for changes and then performs a build using code build - - -Parameters: - qsPipelineName: - Description: The name of the AWS Code Pipeline - Type: String - Default: WG-pipeline - MinLength: 1 - qsPipelineRoleARN: - Description: The complete ARN to the IAM role that code pipeline should use - Type: String - MinLength: 1 - qsCodeRepo: - Description: The Repository - Type: String - MinLength: 1 - qsRepoBranch: - Description: The Branch in the Repository - Type: String - MinLength: 1 - qsGitHubUser: - Description: The GitHub User Id - Type: String - MinLength: 1 - qsGitHubAPIToken: - Description: The GitHub Personal Access token do not use password - NoEcho: true - Type: String - MinLength: 1 - qsS3PipelineArtifacts: - Description: Where Code Pipeline will state artifacts in S3 - Type: String - MinLength: 1 - qsS3CodeBuildArtifacts: - Description: Where Code Build will upload Artifacts can be same as codepipeline - Type: String - MinLength: 1 - qsCodeBuildName: - Description: Name of the AWS Code Build - Type: String - Default: WG-mvnBuilder - MinLength: 1 - qsKMSKeyARN: - Description: The KMS ARN that the IAM Role is allowed to use - Type: String - MinLength: 1 - qsCodeRoleArn: - Description: The IAM Role ARN for CodePipeline and CodeDeploy - Type: String - MinLength: 1 - - - -Resources: - - - - - stkcbrCodeBuild: - Type: AWS::CodeBuild::Project - Properties: - Artifacts: - Type: CODEPIPELINE - Description: Builds WebGoat Jar using build file in repo - EncryptionKey: !Ref 'qsKMSKeyARN' - Environment: - ComputeType: BUILD_GENERAL1_SMALL - Image: aws/codebuild/java:openjdk-8 - Type: LINUX_CONTAINER - Name: !Ref 'qsCodeBuildName' - ServiceRole: !Ref 'qsCodeRoleArn' - TimeoutInMinutes: 10 - Source: - Type: CODEPIPELINE - - - - stkcplPipeline: - Type: AWS::CodePipeline::Pipeline - Properties: - Name: !Ref 'qsPipelineName' - RoleArn: !Ref 'qsPipelineRoleARN' - ArtifactStore: - Location: !Ref 'qsS3PipelineArtifacts' - Type: S3 - Stages: - - Name: CodeRepo - Actions: - - Name: CodeSource - ActionTypeId: - Category: Source - Owner: ThirdParty - Provider: GitHub - Version: 1 - Configuration: - Branch: !Ref 'qsRepoBranch' - Repo: !Ref 'qsCodeRepo' - Owner: !Ref 'qsGitHubUser' - OAuthToken: !Ref 'qsGitHubAPIToken' - OutputArtifacts: - - Name: MySource - RunOrder: '1' - - Name: Build - Actions: - - Name: CodeBuild - ActionTypeId: - Category: Build - Owner: AWS - Provider: CodeBuild - Version: 1 - InputArtifacts: - - Name: MySource - Configuration: - ProjectName: !Ref stkcbrCodeBuild - OutputArtifacts: - - Name: MyBuild - RunOrder: '2' - - diff --git a/platformQuickStarts/AWS/codepipelinebuild/README.md b/platformQuickStarts/AWS/codepipelinebuild/README.md deleted file mode 100644 index e8aea2d06..000000000 --- a/platformQuickStarts/AWS/codepipelinebuild/README.md +++ /dev/null @@ -1,64 +0,0 @@ -# Serverless MVN builds Featuring AWS - -This Quick Start forms the basis for the other AWS quickstarts. This only BUILDS the `webgoat-server` spring boot jar. If you want to also run it on AWS skip to the other AWS quickstarts - -Before you Begin -1. Do you have an AWS Account? -2. Can you create an S3 Bucket? -3. Can you create a KMS Key? -4. Do you know what Cloud Formation is? -5. Do you have enough permissions to do any real work in said AWS Account? - -If you said no to any of those...hop over to [docs](https://aws.amazon.com/documentation/) and learn (but don't do) how to create those. - - -You will also need: -1. A GitHub Account -2. Fork of WebGoat -3. Personal access Token with `Admin:repo_hook` and `repo` - - - -## Create Pre-requisites - -First pick an AWS region and stick with it for ALL the quickstarts. This one was mostly executed on US-east-1/2 but any region with KMS, CodePipeline, and CodeBuild will work. eu-Central-1, ap-southeast-1 and sa-east-1 have reported success also. - - -1. Create an S3 bucket and call it something meaningfull like `webgoat-stash-username` or something or use an existing bucket you have access to. -2. Create a KMS Key. Make sure you are a key administrator so you can add key users later. - -## Deploy IAM role Cloud Formation Stacks - -In this folder there are two json cloudformation templates: --`01_IAM_codebuild.json` --`01_IAM_codepipeline.json` - -You will use the CloudFormation templates to create two roles. One for CodePipeline and the Other for CodeBuild. You will use the name of the bucket you just created as a parameter. - -## Update KMS Key - -Access the KMS key you created earlier...add the two IAM roles you just created and Key Users - -## Finally the Pipeline - -You will use the yaml cloudformation template `01_codepiplinebuild.yml` to create the code building pipeline. - -Some of the parameters you will need to pass: -1. The S3 bucket (twice) -2. The Github Branch name (master? develop? yourbranchname?) -3. The Github user (if you forked it would be your username) -4. You personal access token for GitHub -5. The name or the repo (WebGoat! ...unless you renamed and did a whole bunch of fancy git magic) -6. The ARN of the KMS key -7. The ARN of the role for the codebuild for parameter qsCodeRoleArn -8. The ARN for codepipeline - -If this Stack successfully deploys a build will begin based on the latest commit automatically. You will have a funky named zip file (without the .zip ending) in a folder in the S3 bucket in a few minutes. - - - -Congratulations. You just Deployed a two step AWS Codepipeline that looks for codechanges and then performs a build. - -... ON to the next AWS Quickstart - - diff --git a/platformQuickStarts/GCP/GKE-Docker/README.md b/platformQuickStarts/GCP/GKE-Docker/README.md deleted file mode 100644 index 7b18993c1..000000000 --- a/platformQuickStarts/GCP/GKE-Docker/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# GKE - DockerHub - -This Quickstart shows how to create a Kubernettes Cluster using Google Cloud Platform's [GKE](https://cloud.google.com/container-engine/) and WebGoat's Docker [Image](https://hub.docker.com/r/webgoat/webgoat-8.0/). - -To be Successfull with this Quickstart - -1. You have a Google Cloud Platform account and have enough access rights to create Compute Engine and Container Engine Resources -2. You know how to `git clone` -3. You have the gcloud SDK install and initialized somewhere ( do not use the google cloud shell) - - -Remeber to perform a 'gcloud auth login' before using the gcloud commands below. - - - -## Create Kubernettes Cluster - -You can create a cluster using the Google Cloud Console. The Default settings will suffice. For this QuickStart the cluster name used is `owaspbasiccluster`. The `PROJECTNAME` is whatever your project is. The `REGION` is a region/zone near you. - -If you want to use the gcloud sdk from a properly initialized gcloud commandline environment use the following command - - -``` -gcloud container --project "PROJECTNAME" clusters create "owaspbasiccluster" --zone "REGION" --machine-type "n1-standard-1" --image-type "COS" --disk-size "100" --scopes "https://www.googleapis.com/auth/compute","https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append","https://www.googleapis.com/auth/source.read_only" --num-nodes "3" --network "default" --enable-cloud-logging --no-enable-cloud-monitoring - - -``` - -The command creates a similar cluster with more of the options set explicitly. - -## Set up Kubectl - -Using the commandline gcloud SDK environment you need to set-up 'kubectl' - -If you have not already installed 'Kubectl' you can do so with the following command using `gcloud` -- `gcloud components install kubectl` - -Then you just run: -- `gcloud container clusters get-credentials owaspbasiccluster --zone REGION --project PROJECTNAME` - - -## Deploy WebGoat Deployment - -Time to deploy the latest DockerImage for WebGoat! - - -Let's First Make a namespace for this: -- `kubectl create namespace webgoat` - -Now it is time to make the magic happen! - -- `kubectl create -f /where_you_git_cloned_webgoat/platformQuickStart/GCP/GKE-Docker/webgoat_noDNSnoTLS.yml` - -This should complete with no errors. - -Use the following command to see information/status about the deployment -- `kubectl describe deployment webgoat-dpl --namespace=webgoat` - -After a few minutes the service endpoint should be ready. You can check the status with -- `kubectl describe service webgoatsvc --namespace=webgoat` - -In the output you should see a message like "Created load..." after a "Creating load..." which means that the public facing loadbalancer (even thou there is just one container running!) is ready. - - -If you want to see the Kubernetes dashboard you can run `kubectl proxy` (in a new terminal window) and then navigate to http://localhost:8001/ui . - - - -## Test Deployment - -From the previous `describe service` command the `LoadBalancer Ingress:` line should have the external IP. The line below should give the port. - -So..... - -[IP]:[PORT]/WebGoat in your browser! - -DONE - - - diff --git a/platformQuickStarts/GCP/GKE-Docker/deploy.cfg b/platformQuickStarts/GCP/GKE-Docker/deploy.cfg deleted file mode 100644 index 460110cc2..000000000 --- a/platformQuickStarts/GCP/GKE-Docker/deploy.cfg +++ /dev/null @@ -1,4 +0,0 @@ -CURTAG=webgoat/webgoat-8.0 -DEST_TAG=gcr.io/astech-training/raging-wire-webgoat -CLUSTER_NAME=raging-wire-webgoat -PORT_NUM=8080 \ No newline at end of file diff --git a/platformQuickStarts/GCP/GKE-Docker/gke-deploy-config.sh b/platformQuickStarts/GCP/GKE-Docker/gke-deploy-config.sh deleted file mode 100644 index 87a076730..000000000 --- a/platformQuickStarts/GCP/GKE-Docker/gke-deploy-config.sh +++ /dev/null @@ -1,4 +0,0 @@ -CURTAG=webgoat/webgoat-8.0 -DEST_TAG=gcr.io/your-gke-project/your-webgoat-tag -CLUSTER_NAME=your-cluster-name -PORT_NUM=8080 \ No newline at end of file diff --git a/platformQuickStarts/GCP/GKE-Docker/webgoat_deployment_noDNSnoTLS.yml b/platformQuickStarts/GCP/GKE-Docker/webgoat_deployment_noDNSnoTLS.yml deleted file mode 100644 index 228cf29ef..000000000 --- a/platformQuickStarts/GCP/GKE-Docker/webgoat_deployment_noDNSnoTLS.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: webgoatapp - name: webgoatsvc - namespace: webgoat -spec: - ports: - - - port: 8080 - protocol: TCP - selector: - app: webgoatapp - type: LoadBalancer ---- -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: webgoat-dpl - namespace: webgoat -spec: - replicas: 1 - template: - metadata: - name: webgoatapp - labels: - app: webgoatapp - spec: - containers: - - - image: webgoat/webgoat-8.0 - name: webgoat - ports: - - - containerPort: 8080 - - \ No newline at end of file diff --git a/platformQuickStarts/GCP/README.md b/platformQuickStarts/GCP/README.md deleted file mode 100644 index 1c4eb30cb..000000000 --- a/platformQuickStarts/GCP/README.md +++ /dev/null @@ -1,17 +0,0 @@ -# WebGoat on GCP! - -This folder contains sub folders for the various ways you could deploy WebGoat on Google Cloud Platform - -It is assumed: -1. You have a Google Cloud Platform Account -2. You can use Git -3. You can use a Linux/Mac/Google Cloud Shell - - -## GKE Docker - -Uses GKE to run the latest DockerHub version of WebGoat8 - -## AppEngine - -WIP \ No newline at end of file diff --git a/platformQuickStarts/README.md b/platformQuickStarts/README.md deleted file mode 100644 index f647f3273..000000000 --- a/platformQuickStarts/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# OWASP WebGoat Platform Quick Starts - -Want to Run WebGoat? Want to run WebGoat in the Cloud? Don't want to be cloud Expert? - -Do we have a solution for you! - - -Additionally, Each IaaS/PaaS will have their deployment steps broken down giving the *app-guy-new-to-cloud* an opportunity to learn how said platform works. - - - -## AWS - -Multi-Part Quickstart. Starts with simple pipeline that just builds code to a deploying onto EC2 instances and then containers using ECS/ECR - -## GCP - -Get WebGoat Running on GKE and AppEngine - - - - From 0e92e6c132a7d0bde89b26de631b7440f7b1e555 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Sat, 3 Apr 2021 13:50:37 +0200 Subject: [PATCH 12/57] Remove Vagrant image It is old any never used we only update versions in this file --- webgoat-images/vagrant-training/Vagrantfile | 35 --------------------- 1 file changed, 35 deletions(-) delete mode 100644 webgoat-images/vagrant-training/Vagrantfile diff --git a/webgoat-images/vagrant-training/Vagrantfile b/webgoat-images/vagrant-training/Vagrantfile deleted file mode 100644 index cb086a0c1..000000000 --- a/webgoat-images/vagrant-training/Vagrantfile +++ /dev/null @@ -1,35 +0,0 @@ -# Setup a Linux box headless which will start WebGoat and WebWolf helpful image to give away during training - -Vagrant.configure(2) do |config| - config.vm.box = "ubuntu/trusty64" - config.vm.network :forwarded_port, guest: 8080, host: 8080 - config.vm.network :forwarded_port, guest: 9090, host: 9090 - config.vm.provider "virtualbox" do |vb| - vb.gui = false - vb.memory = "4096" - vb.cpus = 2 - vb.name = "WebGoat-Training" - 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-Training" - end - - config.vm.provision "shell", inline: <<-SHELL - wget https://github.com/WebGoat/WebGoat/releases/download/v8.0.0.M25/webgoat-server-8.0.0.M25.jar - wget https://github.com/WebGoat/WebGoat/releases/download/v8.0.0.M25/webwolf-8.0.0.M25.jar - sudo add-apt-repository ppa:openjdk-r/ppa - sudo apt-get update - sudo apt-get install openjdk-11-jre -y - SHELL - - config.vm.provision "shell", run: "always", privileged: false, inline: <<-SHELL - java -jar webgoat-server-8.0.0.M25.jar --server.address=0.0.0.0 & - sleep 40s - java -jar webwolf-8.0.0.M25.jar --server.address=0.0.0.0 & - SHELL - -end From ec5930e2cdc97655dfbb9b52cabb94063ebb8781 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Sat, 3 Apr 2021 13:51:36 +0200 Subject: [PATCH 13/57] Remove docker-compose files They are old might work but we now have the all in one image which we actively maintain and release --- docker-compose-local.yml | 13 ------------ docker-compose-postgres.yml | 40 ------------------------------------- docker-compose.yml | 22 -------------------- 3 files changed, 75 deletions(-) delete mode 100644 docker-compose-local.yml delete mode 100644 docker-compose-postgres.yml delete mode 100644 docker-compose.yml diff --git a/docker-compose-local.yml b/docker-compose-local.yml deleted file mode 100644 index d94544473..000000000 --- a/docker-compose-local.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: '2.1' - -services: - webgoat: - image: webgoat/webgoat-v8.0.0.snapshot - extends: - file: docker-compose.yml - service: webgoat - webwolf: - extends: - file: docker-compose.yml - service: webwolf - image: webgoat/webwolf-v8.0.0.snapshot \ No newline at end of file diff --git a/docker-compose-postgres.yml b/docker-compose-postgres.yml deleted file mode 100644 index 1eecda57f..000000000 --- a/docker-compose-postgres.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: '2.0' - -services: - webgoat: - image: webgoat/webgoat-8.0 - user: webgoat - environment: - - WEBWOLF_HOST=webwolf - - WEBWOLF_PORT=9090 - - spring.datasource.url=jdbc:postgresql://webgoat_db:5432/webgoat?user=webgoat&password=webgoat - - spring.datasource.username=webgoat - - spring.datasource.password=webgoat - - spring.datasource.driver-class-name=org.postgresql.Driver - - spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL10Dialect - - webgoat.server.directory=/home/webgoat/.webgoat/ - - webgoat.user.directory=/home/webgoat/.webgoat/ - ports: - - "8080:8080" - webwolf: - image: webgoat/webwolf - environment: - - spring.datasource.url=jdbc:postgresql://webgoat_db:5432/webgoat?user=webgoat&password=webgoat - - spring.datasource.username=webgoat - - spring.datasource.password=webgoat - - spring.datasource.driver-class-name=org.postgresql.Driver - - spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL10Dialect - ports: - - "9090:9090" - webgoat_db: - image: postgres:10.12 -# Uncomment to store the state of the database on the host. -# volumes: -# - ./database:/var/lib/postgresql - environment: - - POSTGRES_PASSWORD=webgoat - - POSTGRES_USER=webgoat - - POSTGRES_DB=webgoat - ports: - - "5432:5432" - diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 8bf8add95..000000000 --- a/docker-compose.yml +++ /dev/null @@ -1,22 +0,0 @@ -version: '3' - -services: - webgoat: - image: webgoat/webgoat-8.0 - environment: - - WEBWOLF_HOST=webwolf - - WEBWOLF_PORT=9090 - - TZ=Europe/Amsterdam - ports: - - "8080:8080" - - "9001:9001" - volumes: - - .:/home/webgoat/.webgoat - working_dir: /home/webgoat - webwolf: - image: webgoat/webwolf - ports: - - "9090:9090" - command: --spring.datasource.url=jdbc:hsqldb:hsql://webgoat:9001/webgoat --server.address=0.0.0.0 - depends_on: - - webgoat From 28978bc25bd9298bbffe4798d8a4a4bd5fb1deab Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Sat, 3 Apr 2021 13:55:23 +0200 Subject: [PATCH 14/57] Remove all scripts Part of the Travis build we use to have no longer needed as we moved to Github actions --- scripts/build-all.sh | 34 ----------------------------- scripts/build_docker.sh | 10 --------- scripts/clean-run-docker-compose.sh | 5 ----- scripts/deploy-webgoat.sh | 16 -------------- scripts/run-docker-compose.sh | 4 ---- scripts/start.sh | 18 --------------- 6 files changed, 87 deletions(-) delete mode 100755 scripts/build-all.sh delete mode 100644 scripts/build_docker.sh delete mode 100644 scripts/clean-run-docker-compose.sh delete mode 100644 scripts/deploy-webgoat.sh delete mode 100644 scripts/run-docker-compose.sh delete mode 100644 scripts/start.sh diff --git a/scripts/build-all.sh b/scripts/build-all.sh deleted file mode 100755 index 319854ac2..000000000 --- a/scripts/build-all.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -cd .. - -nc -zv 127.0.0.1 8080 2>/dev/null -SUCCESS=$? -nc -zv 127.0.0.1 9090 2>/dev/null -SUCCESS=${SUCCESS}$? - -if [[ "${SUCCESS}" -eq 0 ]] ; then - echo "WebGoat and or WebWolf are still running, please stop them first otherwise unit tests might fail!" - exit 127 -fi - - -sh mvnw clean install -if [[ "$?" -ne 0 ]] ; then - exit y$? -fi - -cd - -sh build_docker.sh -if [[ "$?" -ne 0 ]] ; then - exit y$? -fi - -while true; do - read -p "Do you want to run docker-compose?" yn - case ${yn} in - [Yy]* ) sh clean-run-docker-compose.sh; break;; - [Nn]* ) exit;; - * ) echo "Please answer yes or no.";; - esac -done diff --git a/scripts/build_docker.sh b/scripts/build_docker.sh deleted file mode 100644 index ec5f28d9f..000000000 --- a/scripts/build_docker.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -WEBGOAT_HOME=$(pwd)/../ - -cd "${WEBGOAT_HOME}"/webgoat-server -docker build -t webgoat/webgoat-v8.0.0.snapshot . - -cd "${WEBGOAT_HOME}"/webwolf -docker build -t webgoat/webwolf-v8.0.0.snapshot . - diff --git a/scripts/clean-run-docker-compose.sh b/scripts/clean-run-docker-compose.sh deleted file mode 100644 index b1e493b87..000000000 --- a/scripts/clean-run-docker-compose.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -cd .. -docker-compose rm -f -docker-compose -f docker-compose-local.yml up diff --git a/scripts/deploy-webgoat.sh b/scripts/deploy-webgoat.sh deleted file mode 100644 index 3f9dfa4d4..000000000 --- a/scripts/deploy-webgoat.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -docker login -u $DOCKER_USER -p $DOCKER_PASS - -export REPO=webgoat/goatandwolf -cd .. -cd docker -ls target/ - -if [ ! -z "${TRAVIS_TAG}" ]; then - # If we push a tag to master this will update the LATEST Docker image and tag with the version number - docker build --build-arg webgoat_version=${TRAVIS_TAG:1} -f Dockerfile -t $REPO:latest -t $REPO:${TRAVIS_TAG} . - docker push $REPO -else - echo "Skipping releasing to DockerHub because it is a build of branch ${BRANCH}" -fi diff --git a/scripts/run-docker-compose.sh b/scripts/run-docker-compose.sh deleted file mode 100644 index 4ed58bcf0..000000000 --- a/scripts/run-docker-compose.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -cd .. -docker-compose up diff --git a/scripts/start.sh b/scripts/start.sh deleted file mode 100644 index 3380882af..000000000 --- a/scripts/start.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -DATABASE_PORT=9001 - -checkDatabaseAvailable(){ - - #for i in $(seq 1 5); do command && s=0 && break || s=$? && sleep 15; done; (exit $s) - local started = $(netstat -lnt | grep ${DATABASE_PORT}) - echo $? -} - -#java -Djava.security.egd=file:/dev/./urandom -jar home/webgoat/webgoat.jar --server.address=0.0.0.0 -$(checkDatabaseAvailable) - - -#java -Djava.security.egd=file:/dev/./urandom -jar /home/webwolf/webwolf.jar --server.port=9090 --server.address=0.0.0.0 - - From 3740a5a5905cb56164e80362cdd70d0b6ede248c Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Sat, 3 Apr 2021 16:14:03 +0200 Subject: [PATCH 15/57] Remove documentation about Docker compose and stack from README Spring cleanup to make it a bit easier for users to only offer two options: Docker and stand alone version --- README.MD | 38 ++++++++------------------------------ 1 file changed, 8 insertions(+), 30 deletions(-) diff --git a/README.MD b/README.MD index bdb8a3af1..6077b2bb0 100644 --- a/README.MD +++ b/README.MD @@ -38,7 +38,7 @@ Every release is also published on [DockerHub]((https://hub.docker.com/r/webgoat The easiest way to start WebGoat as a Docker container is to use the all-in-one docker container. This is a docker image that has WebGoat and WebWolf running inside. ```shell -docker run -p 8080:8080 -p 9090:9090 -e TZ=Europe/Amsterdam webgoat/goatandwolf +docker run -p 127.0.0.1:8080:8080 -p 127.0.0.1:9090:9090 -e TZ=Europe/Amsterdam webgoat/goatandwolf ``` WebGoat will be located at: http://127.0.0.1:8080/WebGoat @@ -46,32 +46,6 @@ WebWolf will be located at: http://127.0.0.1:9090/WebWolf **Important**: Choose the correct timezone, so that the docker container and your host are in the same timezone. As it important for the validity of JWT tokens used in certain exercises. -### Using docker stack deploy - -Another way to deply WebGoat and WebWolf in a more advanced way is to use a compose-file in a docker stack deploy. -You can define which containers should run in which combinations and define all of this in a yaml file. -An example of such a file is: [goat-with-reverseproxy.yaml](goat-with-reverseproxy.yaml) - -This sets up an nginx webserver as reverse proxy to WebGoat and WebWolf. You can change the timezone by adjusting the value in the yaml file. - -```shell -docker stack init -docker stack deploy --compose-file goat-with-reverseproxy.yaml webgoatdemo -``` - -Add the following entries in your local hosts file: - -```shell -127.0.0.1 www.webgoat.local www.webwolf.localhost -``` - -You can use the overall start page: http://www.webgoat.local or: - -WebGoat will be located at: http://www.webgoat.local/WebGoat - -WebWolf will be located at: http://www.webwolf.local/WebWolf - -**Important**: the current directory on your host will be mapped into the container for keeping state. ## 2. Standalone @@ -82,7 +56,7 @@ java -jar webgoat-server-8.1.0.jar [--server.port=8080] [--server.address=localh java -jar webwolf-8.1.0.jar [--server.port=9090] [--server.address=localhost] ``` -The latest version of WebGoat needs Java 15 or above. By default WebGoat and WebWolf start on port 8080,9000 and 9090 with the environment variable WEBGOAT_PORT, WEBWOLF_PORT and WEBGOAT_HSQLPORT you can set different values. +The latest version of WebGoat needs Java 15 or above. By default, WebGoat uses port 8080, the database uses 9000 and WebWolf use port 9090 with the environment variable WEBGOAT_PORT, WEBWOLF_PORT and WEBGOAT_HSQLPORT you can set different values. ```Shell export WEBGOAT_PORT=18080 export WEBGOAT_HSQLPORT=19001 @@ -90,7 +64,8 @@ export WEBWOLF_PORT=19090 java -jar webgoat-server-8.1.0.jar java -jar webwolf-8.1.0.jar ``` -Use set in stead of export on Windows cmd. + +Use `set` instead of export on Windows cmd. ## 3. Run from the sources @@ -134,13 +109,16 @@ server.address=x.x.x.x For specialist only. There is a way to set up WebGoat with a personalized menu. You can leave out some menu categories or individual lessons by setting environment variables. -For instance running as a jar on a Linux/MacOS it will look like: +For instance running as a jar on a Linux/macOS it will look like: + ```Shell export EXCLUDE_CATEGORIES="CLIENT_SIDE,GENERAL,CHALLENGE" export EXCLUDE_LESSONS="SqlInjectionAdvanced,SqlInjectionMitigations" java -jar webgoat-server/target/webgoat-server-v8.2.0-SNAPSHOT.jar ``` + Or in a docker run it would (once this version is pushed into docker hub) look like: + ```Shell docker run -d -p 80:8888 -p 8080:8080 -p 9090:9090 -e TZ=Europe/Amsterdam -e EXCLUDE_CATEGORIES="CLIENT_SIDE,GENERAL,CHALLENGE" -e EXCLUDE_LESSONS="SqlInjectionAdvanced,SqlInjectionMitigations" webgoat/goatandwolf ``` From fd922a340446e5fff2ccdf41f248d007c0a688cb Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Sat, 3 Apr 2021 16:17:34 +0200 Subject: [PATCH 16/57] Remove obsolete Docker configuration --- goat-with-reverseproxy.yaml | 43 ------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 goat-with-reverseproxy.yaml diff --git a/goat-with-reverseproxy.yaml b/goat-with-reverseproxy.yaml deleted file mode 100644 index bad613258..000000000 --- a/goat-with-reverseproxy.yaml +++ /dev/null @@ -1,43 +0,0 @@ -version: '3' -networks: - webwolflocal: -services: - webgoat: - hostname: www.webgoat.local - image: webgoat/webgoat-8.0 - environment: - - WEBGOAT_PORT=8080 - - WEBGOAT_SSLENABLED=false - - WEBWOLF_HOST=webwolf - - WEBWOLF_PORT=9090 - - TZ=Europe/Amsterdam - volumes: - - .:/home/webgoat/.webgoat - working_dir: /home/webgoat - command: --server.address=0.0.0.0 - networks: - webwolflocal: - aliases: - - goat.webgoat.local - webwolf: - image: webgoat/webwolf - environment: - - WEBWOLF_HOST=webwolf - - WEBWOLF_PORT=9090 - - TZ=Europe/Amsterdam - command: --spring.datasource.url=jdbc:hsqldb:hsql://webgoat:9001/webgoat --server.address=0.0.0.0 - networks: - webwolflocal: - aliases: - - wolf.webwolf.local - depends_on: - - webgoat - reverseproxy: - hostname: www.webwolf.local - image: webgoat/reverseproxy - networks: - webwolflocal: - aliases: - - www.webwolf.local - ports: - - 80:80 From d2445d7f11a3a182dcf9ce5770cfc46aa6369979 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Sat, 3 Apr 2021 16:25:06 +0200 Subject: [PATCH 17/57] Update Dockerfile --- docker/Dockerfile | 2 +- docker/Readme.md | 10 +++++++--- docker/start.sh | 6 +++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 821658841..b16e71d4d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,6 @@ FROM openjdk:15.0.2-slim -ARG webgoat_version=8.2.1-SNAPSHOT +ARG webgoat_version=8.2.0-SNAPSHOT ENV webgoat_version_env=${webgoat_version} RUN apt-get update && apt-get install diff --git a/docker/Readme.md b/docker/Readme.md index 4f2fcc6cf..0e6ed7941 100644 --- a/docker/Readme.md +++ b/docker/Readme.md @@ -2,8 +2,12 @@ ## Docker build - docker build --no-cache --build-arg webgoat_version=8.2.0-SNAPSHOT -t webgoat/goatandwolf:latest . +```shell +docker build --no-cache --build-arg webgoat_version=8.2.0-SNAPSHOT -t webgoat/goatandwolf:latest . +``` ## Docker run - - docker run -d -p 80:8888 -p 8080:8080 -p 9090:9090 -e TZ=Europe/Amsterdam webgoat/goatandwolf:latest \ No newline at end of file + +```shell +docker run -p 80:8888 -p 8080:8080 -p 9090:9090 -e TZ=Europe/Amsterdam webgoat/goatandwolf:latest +``` \ No newline at end of file diff --git a/docker/start.sh b/docker/start.sh index 30a7d0955..26798f2b5 100644 --- a/docker/start.sh +++ b/docker/start.sh @@ -3,10 +3,14 @@ cd /home/webgoat service nginx start sleep 1 +echo "Starting WebGoat..." java -Duser.home=/home/webgoat -Dfile.encoding=UTF-8 -jar webgoat.jar --webgoat.build.version=$1 --server.address=0.0.0.0 > webgoat.log & sleep 10 - + +echo "Starting WebWolf..." java -Duser.home=/home/webgoat -Dfile.encoding=UTF-8 -jar webwolf.jar --webgoat.build.version=$1 --server.address=0.0.0.0 > webwolf.log & +echo "Browse to http://localhost" to get started >> webgoat.log + tail -300f webgoat.log From 1d38bf66cbcd88d146fc45a1a72c6a2303132afd Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 3 Aug 2021 17:11:50 -0700 Subject: [PATCH 18/57] Create main.yml --- .github/workflows/main.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..1c85af4ac --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,32 @@ +# This workflow integrates ShiftLeft NG SAST with GitHub +# Visit https://docs.shiftleft.io for help +name: ShiftLeft + +on: + pull_request: + workflow_dispatch: + push: + # We recommend triggering a scan when merging to your default branch as a best practice, + # especially if you'd like to compare the results of two scans (e.g., a feature branch against the + # default branch) + branches: + - main + - master +jobs: + NextGen-Static-Analysis: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Download ShiftLeft CLI + run: | + curl https://cdn.shiftleft.io/download/sl > ${GITHUB_WORKSPACE}/sl && chmod a+rx ${GITHUB_WORKSPACE}/sl + # ShiftLeft requires Java 1.8. Post the package step override the version + - name: Setup Java JDK + uses: actions/setup-java@v1.4.3 + with: + java-version: 1.8 + - name: NextGen Static Analysis + run: ${GITHUB_WORKSPACE}/sl analyze --app ShiftLeftJS --tag branch=${{ github.head_ref }} --js --cpg $(pwd) + env: + SHIFTLEFT_ACCESS_TOKEN: ${{ secrets.SHIFTLEFT_ACCESS_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 166ac47f1a236f624c284b3602d957784564fe41 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Mon, 27 Dec 2021 13:41:18 -0800 Subject: [PATCH 19/57] Create Jenkinsfile --- .../bin/Jenkinsfile" | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 "node { stage('SCM') { checkout scm } stage('SonarQube Analysis') { def mvn = tool 'Default Maven'; withSonarQubeEnv() { sh \"${mvn}/bin/Jenkinsfile" diff --git "a/node { stage('SCM') { checkout scm } stage('SonarQube Analysis') { def mvn = tool 'Default Maven'; withSonarQubeEnv() { sh \"${mvn}/bin/Jenkinsfile" "b/node { stage('SCM') { checkout scm } stage('SonarQube Analysis') { def mvn = tool 'Default Maven'; withSonarQubeEnv() { sh \"${mvn}/bin/Jenkinsfile" new file mode 100644 index 000000000..2ea319e45 --- /dev/null +++ "b/node { stage('SCM') { checkout scm } stage('SonarQube Analysis') { def mvn = tool 'Default Maven'; withSonarQubeEnv() { sh \"${mvn}/bin/Jenkinsfile" @@ -0,0 +1,11 @@ +node { + stage('SCM') { + checkout scm + } + stage('SonarQube Analysis') { + def mvn = tool 'Default Maven'; + withSonarQubeEnv() { + sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=WebGoat" + } + } +} From dc3886d7eda8d1455d224adca18b93b7ea3b0d3d Mon Sep 17 00:00:00 2001 From: HammerHam Date: Mon, 27 Dec 2021 13:42:21 -0800 Subject: [PATCH 20/57] Delete node { stage('SCM') { checkout scm } stage('SonarQube Analysis') { def mvn = tool 'Default Maven'; withSonarQubeEnv() { sh "${mvn}/bin directory --- .../bin/Jenkinsfile" | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 "node { stage('SCM') { checkout scm } stage('SonarQube Analysis') { def mvn = tool 'Default Maven'; withSonarQubeEnv() { sh \"${mvn}/bin/Jenkinsfile" diff --git "a/node { stage('SCM') { checkout scm } stage('SonarQube Analysis') { def mvn = tool 'Default Maven'; withSonarQubeEnv() { sh \"${mvn}/bin/Jenkinsfile" "b/node { stage('SCM') { checkout scm } stage('SonarQube Analysis') { def mvn = tool 'Default Maven'; withSonarQubeEnv() { sh \"${mvn}/bin/Jenkinsfile" deleted file mode 100644 index 2ea319e45..000000000 --- "a/node { stage('SCM') { checkout scm } stage('SonarQube Analysis') { def mvn = tool 'Default Maven'; withSonarQubeEnv() { sh \"${mvn}/bin/Jenkinsfile" +++ /dev/null @@ -1,11 +0,0 @@ -node { - stage('SCM') { - checkout scm - } - stage('SonarQube Analysis') { - def mvn = tool 'Default Maven'; - withSonarQubeEnv() { - sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=WebGoat" - } - } -} From 3704c23da1ab29a7da07007b9c472be6eb3a3fec Mon Sep 17 00:00:00 2001 From: HammerHam Date: Mon, 27 Dec 2021 13:42:45 -0800 Subject: [PATCH 21/57] Create Jenkinsfile --- Jenkinsfile | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..2ea319e45 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,11 @@ +node { + stage('SCM') { + checkout scm + } + stage('SonarQube Analysis') { + def mvn = tool 'Default Maven'; + withSonarQubeEnv() { + sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=WebGoat" + } + } +} From 14b7a3771eb3274c54af92b655f0c47550af7b3d Mon Sep 17 00:00:00 2001 From: HammerHam Date: Mon, 27 Dec 2021 13:46:01 -0800 Subject: [PATCH 22/57] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 2ea319e45..4d255bc1b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,3 +9,4 @@ node { } } } + From 8811fd5f4812739dc045e88b9769392b2f422c79 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Mon, 27 Dec 2021 13:51:02 -0800 Subject: [PATCH 23/57] Create jenkinsfile --- jenkinsfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 jenkinsfile diff --git a/jenkinsfile b/jenkinsfile new file mode 100644 index 000000000..4d255bc1b --- /dev/null +++ b/jenkinsfile @@ -0,0 +1,12 @@ +node { + stage('SCM') { + checkout scm + } + stage('SonarQube Analysis') { + def mvn = tool 'Default Maven'; + withSonarQubeEnv() { + sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=WebGoat" + } + } +} + From 054efc1e519b877b614b29666d447a7e63b78352 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 08:55:34 -0800 Subject: [PATCH 24/57] Update Jenkinsfile --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4d255bc1b..2ea319e45 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,4 +9,3 @@ node { } } } - From 00fa190f266e029224446587b18bc12df03c6b93 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 08:57:30 -0800 Subject: [PATCH 25/57] Update Jenkinsfile From 0ba935ff654311005ee264d82e85456425ad4b2d Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 09:09:12 -0800 Subject: [PATCH 26/57] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 2ea319e45..d66bef8ba 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,5 @@ node { + agent { label 'java' } stage('SCM') { checkout scm } From 53cf77e71e85165a7f06e6ee1eeb4ead0b93102b Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 09:10:12 -0800 Subject: [PATCH 27/57] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d66bef8ba..3450bb363 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ node { - agent { label 'java' } + agent { label 'linux' } stage('SCM') { checkout scm } From 91e265aa5fc05c55e3283fce0db7d48608443859 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 09:15:38 -0800 Subject: [PATCH 28/57] Update Jenkinsfile --- Jenkinsfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3450bb363..0865e2263 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,10 @@ node { - agent { label 'linux' } - stage('SCM') { + stage('SCM') { checkout scm } stage('SonarQube Analysis') { def mvn = tool 'Default Maven'; - withSonarQubeEnv() { + withSonarQubeEnv(installationName: 'sq1') { sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=WebGoat" } } From 94631a36d5ded07ff7f9f9be6570a4b5763ffead Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 09:17:47 -0800 Subject: [PATCH 29/57] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0865e2263..12169c4b1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ node { - stage('SCM') { + stage('SCM') { checkout scm } stage('SonarQube Analysis') { From a42d1daeb005b9f2172dce6531c0d81aca089624 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 10:26:39 -0800 Subject: [PATCH 30/57] Create build.yml --- build.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 build.yml diff --git a/build.yml b/build.yml new file mode 100644 index 000000000..ab8933f70 --- /dev/null +++ b/build.yml @@ -0,0 +1,36 @@ +name: Build +on: + push: + branches: + - master # or the name of your main branch + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache SonarQube packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=WebGoat From 7242f742bdd10cd81ebec5e31607519fe5e41474 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 10:34:22 -0800 Subject: [PATCH 31/57] Update build.yml --- .github/workflows/build.yml | 62 +++++++++++++------------------------ 1 file changed, 21 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2e9bd730d..ab8933f70 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,56 +1,36 @@ -name: "Build" +name: Build on: - pull_request: - paths-ignore: - - '.txt' - - '*.MD' - - '*.md' - - 'LICENSE' - - 'docs/**' push: branches: - - master - - develop - tags-ignore: - - '*' - paths-ignore: - - '.txt' - - '*.MD' - - '*.md' - - 'LICENSE' - - 'docs/**' + - master # or the name of your main branch jobs: build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - java: [15] + name: Build + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up JDK ${{ matrix.java }} + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 uses: actions/setup-java@v1 with: - java-version: ${{ matrix.java }} - architecture: x64 + java-version: 11 + - name: Cache SonarQube packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar - name: Cache Maven packages - uses: actions/cache@v2.1.4 + uses: actions/cache@v1 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 - - name: Build with Maven - run: mvn clean install - - notify-slack: - if: github.event_name == 'push' && (success() || failure()) - needs: - - build - runs-on: ubuntu-latest - steps: - - name: "Slack workflow notification" - uses: Gamesight/slack-workflow-status@master - with: - repo_token: ${{secrets.GITHUB_TOKEN}} - slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}} \ No newline at end of file + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=WebGoat From c64d856f00eaf4d5b3e1ea4718fd38090b876631 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 10:38:13 -0800 Subject: [PATCH 32/57] Update build.yml From 83c620467b80ac5bb35cbffda9eeed9fa5195c76 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 10:40:23 -0800 Subject: [PATCH 33/57] Update build.yml --- .github/workflows/build.yml | 47 +++++++++++-------------------------- 1 file changed, 14 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab8933f70..711d62e1c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,36 +1,17 @@ -name: Build -on: - push: - branches: - - master # or the name of your main branch - +name: GitHub Actions Demo +on: [push] jobs: - build: - name: Build + Explore-GitHub-Actions: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Cache SonarQube packages - uses: actions/cache@v1 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Cache Maven packages - uses: actions/cache@v1 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - name: Build and analyze - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=WebGoat + - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v2 + - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." From 87f0395a822a87e38f17d3a2e08fa0f7e887308e Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 10:41:42 -0800 Subject: [PATCH 34/57] Update build.yml --- .github/workflows/build.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 711d62e1c..b94fab97f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,3 +15,40 @@ jobs: run: | ls ${{ github.workspace }} - run: echo "🍏 This job's status is ${{ job.status }}." + +name: Build +on: + push: + branches: + - master # or the name of your main branch + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache SonarQube packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=WebGoat From ae72802ee6a2c41e44743a9afcf087a1ae24fc9a Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 10:42:54 -0800 Subject: [PATCH 35/57] Update build.yml --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b94fab97f..699df1384 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,9 +16,6 @@ jobs: ls ${{ github.workspace }} - run: echo "🍏 This job's status is ${{ job.status }}." -name: Build -on: - push: branches: - master # or the name of your main branch From 074f271569f01c5c07519e7e9e6afd2a2a1e8251 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 10:43:41 -0800 Subject: [PATCH 36/57] Update build.yml --- .github/workflows/build.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 699df1384..a05c2d5b6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,33 +19,3 @@ jobs: branches: - master # or the name of your main branch -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 - uses: actions/setup-java@v1 - with: - java-version: 11 - - name: Cache SonarQube packages - uses: actions/cache@v1 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Cache Maven packages - uses: actions/cache@v1 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - name: Build and analyze - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=WebGoat From 6eaabed9d9f0510fc169fcb5847455c645b6cb37 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 10:46:05 -0800 Subject: [PATCH 37/57] Create sonarcuberun1.yml --- .github/workflows/sonarcuberun1.yml | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/sonarcuberun1.yml diff --git a/.github/workflows/sonarcuberun1.yml b/.github/workflows/sonarcuberun1.yml new file mode 100644 index 000000000..5aa54c768 --- /dev/null +++ b/.github/workflows/sonarcuberun1.yml @@ -0,0 +1,36 @@ +name: SonarPass1 +on: + push: + branches: + - master # or the name of your main branch + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache SonarQube packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=WebGoat From e0fdafff46c240d4c088389d234de9574757b4ae Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 10:49:45 -0800 Subject: [PATCH 38/57] Update sonarcuberun1.yml --- .github/workflows/sonarcuberun1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcuberun1.yml b/.github/workflows/sonarcuberun1.yml index 5aa54c768..cac3687ed 100644 --- a/.github/workflows/sonarcuberun1.yml +++ b/.github/workflows/sonarcuberun1.yml @@ -2,7 +2,7 @@ name: SonarPass1 on: push: branches: - - master # or the name of your main branch + - 891 # or the name of your main branch jobs: build: From b94e51cb9b0071c9efbe8473057d8d8075a06876 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 10:53:46 -0800 Subject: [PATCH 39/57] Update sonarcuberun1.yml --- .github/workflows/sonarcuberun1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcuberun1.yml b/.github/workflows/sonarcuberun1.yml index cac3687ed..a6abacac1 100644 --- a/.github/workflows/sonarcuberun1.yml +++ b/.github/workflows/sonarcuberun1.yml @@ -1,4 +1,4 @@ -name: SonarPass1 +name: SonarPass12 on: push: branches: From 28ff93def3b1590126d18d89d4052cff47fe9ced Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 10:57:47 -0800 Subject: [PATCH 40/57] Create sonarcloud1.yml --- .github/workflows/sonarcloud1.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/workflows/sonarcloud1.yml diff --git a/.github/workflows/sonarcloud1.yml b/.github/workflows/sonarcloud1.yml new file mode 100644 index 000000000..9485be64f --- /dev/null +++ b/.github/workflows/sonarcloud1.yml @@ -0,0 +1,9 @@ +- name: Official SonarQube Scan + # You may pin to the exact commit or the version. + # uses: SonarSource/sonarqube-scan-action@069e3332cbefb8659c02d77b21a04719d3ef7c9b + uses: SonarSource/sonarqube-scan-action@v1.0.0 + with: + # Additional arguments to the sonar-scanner + args: # optional + # Set the sonar.projectBaseDir analysis property + projectBaseDir: # optional, default is . From 190b1213148b3952316eb1cc66d4debaaf40d146 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 28 Dec 2021 11:00:33 -0800 Subject: [PATCH 41/57] Update sonarcloud1.yml --- .github/workflows/sonarcloud1.yml | 32 ++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/.github/workflows/sonarcloud1.yml b/.github/workflows/sonarcloud1.yml index 9485be64f..520736ce5 100644 --- a/.github/workflows/sonarcloud1.yml +++ b/.github/workflows/sonarcloud1.yml @@ -1,9 +1,23 @@ -- name: Official SonarQube Scan - # You may pin to the exact commit or the version. - # uses: SonarSource/sonarqube-scan-action@069e3332cbefb8659c02d77b21a04719d3ef7c9b - uses: SonarSource/sonarqube-scan-action@v1.0.0 - with: - # Additional arguments to the sonar-scanner - args: # optional - # Set the sonar.projectBaseDir analysis property - projectBaseDir: # optional, default is . +on: + # Trigger analysis when pushing in master or pull requests, and when creating + # a pull request. + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] + +name: SonarCloudHamid +jobs: + sonarqube: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + # Disabling shallow clone is recommended for improving relevancy of reporting + fetch-depth: 0 + - name: SonarQube Scan + uses: sonarsource/sonarqube-scan-action@master + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} From cf90f7dc861c4ac2134e5d53873f69a875e7ee58 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Mon, 11 Jul 2022 11:09:58 -0700 Subject: [PATCH 42/57] Update pom.xml --- pom.xml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e3f19dddb..b07c2657a 100644 --- a/pom.xml +++ b/pom.xml @@ -293,5 +293,17 @@ - + + + central + a0ioesjvvd3qy-artifactory-primary-0-releases + https://nawbary.jfrog.io/artifactory/default-maven-local + + + snapshots + a0ioesjvvd3qy-artifactory-primary-0-snapshots + https://nawbary.jfrog.io/artifactory/default-maven-local + + + From 518ec71f3bc3ab95a1b7acfedc59f993ad6ec683 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Mon, 11 Jul 2022 11:11:28 -0700 Subject: [PATCH 43/57] Update Jenkinsfile --- Jenkinsfile | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 12169c4b1..b9822500b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,21 @@ -node { - stage('SCM') { - checkout scm - } - stage('SonarQube Analysis') { - def mvn = tool 'Default Maven'; - withSonarQubeEnv(installationName: 'sq1') { - sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=WebGoat" +pipeline { + agent any + + stages { + stage('Build') { + steps { + echo 'Building..' + } + } + stage('Test') { + steps { + echo 'Testing..' + } + } + stage('Deploy') { + steps { + echo 'Deploying....' + } + } } - } } From 78af38af2ba4077449cb6bdb4db7b41debe1fca2 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Wed, 13 Jul 2022 13:53:40 -0700 Subject: [PATCH 44/57] Update jenkinsfile --- jenkinsfile | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/jenkinsfile b/jenkinsfile index 4d255bc1b..a72fe3150 100644 --- a/jenkinsfile +++ b/jenkinsfile @@ -1,12 +1,21 @@ -node { - stage('SCM') { - checkout scm - } - stage('SonarQube Analysis') { - def mvn = tool 'Default Maven'; - withSonarQubeEnv() { - sh "${mvn}/bin/mvn clean verify sonar:sonar -Dsonar.projectKey=WebGoat" +pipeline { + agent any + + stages { + stage('Build') { + steps { + sh mvn package + } + } + stage('Test') { + steps { + echo 'Testing..' + } + } + stage('Deploy') { + steps { + echo 'Deploying....' + } + } } - } } - From 2470d24bb53058a3bed72af501e63ae4059a358b Mon Sep 17 00:00:00 2001 From: HammerHam Date: Wed, 13 Jul 2022 13:56:52 -0700 Subject: [PATCH 45/57] Update Jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index b9822500b..65ab9ed89 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,6 +4,7 @@ pipeline { stages { stage('Build') { steps { + sh mvn build echo 'Building..' } } From 02dca8a506f9fd284f398ba5edecd5036c879c12 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Wed, 13 Jul 2022 13:59:42 -0700 Subject: [PATCH 46/57] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 65ab9ed89..d5a089500 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { stages { stage('Build') { steps { - sh mvn build + mvn build echo 'Building..' } } From b8ec34d563e08c3d26282042a2839eaac4cfe937 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Wed, 13 Jul 2022 14:17:35 -0700 Subject: [PATCH 47/57] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d5a089500..12b5ae6c8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { stages { stage('Build') { steps { - mvn build + echo 'Building..' } } From d460764a56fc1a2258d6ecfb08ce7409ba9bdc34 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Wed, 13 Jul 2022 14:20:07 -0700 Subject: [PATCH 48/57] Update Jenkinsfile --- Jenkinsfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 12b5ae6c8..c7f49567f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,8 +4,11 @@ pipeline { stages { stage('Build') { steps { - - echo 'Building..' + + sh '''#!/bin/bash + echo "hello world" + ''' + } } stage('Test') { From 4c97575fbcb21203f2d598feebf91dd4e0f67e53 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Wed, 13 Jul 2022 14:22:18 -0700 Subject: [PATCH 49/57] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c7f49567f..1e064cb17 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { steps { sh '''#!/bin/bash - echo "hello world" + mvn package ''' } From c083b4212e216170bd1bf9656a0454a8600de6fd Mon Sep 17 00:00:00 2001 From: HammerHam Date: Wed, 13 Jul 2022 14:26:19 -0700 Subject: [PATCH 50/57] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1e064cb17..949ac1fb5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { steps { sh '''#!/bin/bash - mvn package + mvn clean package ''' } From 51550d1db6031f10bbff46f8b3a0eaa80cc91702 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Thu, 14 Jul 2022 13:20:40 -0700 Subject: [PATCH 51/57] Update pom.xml --- pom.xml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index b07c2657a..df846428d 100644 --- a/pom.xml +++ b/pom.xml @@ -294,15 +294,10 @@ - - central - a0ioesjvvd3qy-artifactory-primary-0-releases - https://nawbary.jfrog.io/artifactory/default-maven-local - snapshots a0ioesjvvd3qy-artifactory-primary-0-snapshots - https://nawbary.jfrog.io/artifactory/default-maven-local + https://nawbary.jfrog.io/artifactory/default-libs-snapshot-local From 1f24651af2db2ca6874b2b6adfc243758017bb5a Mon Sep 17 00:00:00 2001 From: HammerHam Date: Thu, 14 Jul 2022 13:21:39 -0700 Subject: [PATCH 52/57] Update Jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 949ac1fb5..3294af9a3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,7 +6,7 @@ pipeline { steps { sh '''#!/bin/bash - mvn clean package + mvn deploy ''' } From 5718f0016b8d72e29b9478240afa18b2af6f8502 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Thu, 14 Jul 2022 13:51:16 -0700 Subject: [PATCH 53/57] Update Jenkinsfile --- Jenkinsfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3294af9a3..9f8ded5a4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,9 +4,9 @@ pipeline { stages { stage('Build') { steps { - + echo 'Building....' sh '''#!/bin/bash - mvn deploy + mvn package ''' } @@ -18,7 +18,10 @@ pipeline { } stage('Deploy') { steps { - echo 'Deploying....' + echo 'Deploying....' + sh '''#!/bin/bash + mvn deploy + ''' } } } From 04c1c7f94b350fc520c9723034e597b27c7965ad Mon Sep 17 00:00:00 2001 From: HammerHam Date: Mon, 7 Nov 2022 11:12:15 -0800 Subject: [PATCH 54/57] Update pom.xml --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index df846428d..d0951729a 100644 --- a/pom.xml +++ b/pom.xml @@ -294,11 +294,11 @@ - - snapshots - a0ioesjvvd3qy-artifactory-primary-0-snapshots - https://nawbary.jfrog.io/artifactory/default-libs-snapshot-local - + + central + Artifactory West-releases + http://35.236.103.251:8081/artifactory/hamid-maven-one-libs-release-local + From 17826b0f653c7924e45ddf15f92e56c765a13924 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 22 Nov 2022 13:54:53 -0800 Subject: [PATCH 55/57] Update pom.xml --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index d0951729a..8897dd591 100644 --- a/pom.xml +++ b/pom.xml @@ -294,11 +294,11 @@ - - central - Artifactory West-releases - http://35.236.103.251:8081/artifactory/hamid-maven-one-libs-release-local - + + snapshots + Artifactory West-snapshots + http://35.236.103.251:8081/artifactory/hamid-maven-one-libs-snapshot-local + From d786854eba8e6e6dc2fc1cf6e1cf4d840a15b641 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Tue, 22 Nov 2022 13:56:16 -0800 Subject: [PATCH 56/57] Update Jenkinsfile --- Jenkinsfile | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9f8ded5a4..8583f68e5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,18 +2,14 @@ pipeline { agent any stages { - stage('Build') { + stage('Do Nothing') { steps { - echo 'Building....' - sh '''#!/bin/bash - mvn package - ''' - + echo 'Doing Nothing..' } } - stage('Test') { + stage('Test Nothing') { steps { - echo 'Testing..' + echo 'Testing Nothing..' } } stage('Deploy') { From f0a5a28bb4a264f019f2b5e1478b62944be1b507 Mon Sep 17 00:00:00 2001 From: HammerHam Date: Wed, 18 Feb 2026 20:47:12 -0800 Subject: [PATCH 57/57] Update README with additional information Added 'Tester' to the README description. --- docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index dde40936b..34c67ffa1 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,5 +1,5 @@ # WebGoat landing page -Old Github page which now redirects to OWASP website. +Old Github page which now redirects to OWASP website. Tester