Skip to content

Commit 66a2829

Browse files
Merge branch 'OWASP:main' into main
2 parents d42e8c7 + 6547bd7 commit 66a2829

File tree

148 files changed

+9810
-9630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+9810
-9630
lines changed

.github/workflows/tests.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "Training Portal Tests"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
tests:
11+
name: Portal Unit Tests
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Repo Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: 14
22+
23+
- name: Setup Portal
24+
working-directory: ./trainingportal
25+
run: |
26+
npm install
27+
cp config.json.docker config.json
28+
node tools/devSetup.js
29+
30+
- name: Run Tests
31+
working-directory: ./trainingportal
32+
run: npm test

AttackGrams.pptx

-808 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
**Input Validation** is one of the basic tenets of software security. Verifying that the values provided to the application match the expected type or format, goes a long way in reducing the attack surface. Validation is a simple countermeasure with super results.
22

3-
It is important to note that a common mistake is to use `block lists` for validation. For example an application will prevent symbols that are known to cause trouble. The weakness of this approach is that some symbols may be overlooked.
3+
It is important to note that a common mistake is to use `deny lists` for validation. For example an application will prevent symbols that are known to cause trouble. The weakness of this approach is that some symbols may be overlooked.
44

codereview101/definitions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
],
1616
"answer":1,
1717
"correctReasoning":"You're right! The code sample is preventing a vulnerability by using input allow listing.",
18-
"incorrectReasoning": "Incorrect! While there is some validation, it is based on block listing and will still allow command injection (ex. `rm -rf /`)."
18+
"incorrectReasoning": "Incorrect! While there is some validation, it is based on deny listing and will still allow command injection (ex. `rm -rf /`)."
1919
}
2020
]
2121

docker-compose.insecureinc.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ version: "3.7"
33
services:
44
insecureinc:
55
image: securecodingdojo/insecure.inc
6+
deploy:
7+
resources:
8+
limits:
9+
cpus: "0.9"
10+
memory: 512M
11+
reservations:
12+
cpus: "0.9"
13+
memory: 512M
614
build:
715
context: ./insecureinc
816
dockerfile: Dockerfile.insecureinc

docker-compose.trainingportal.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ version: "3.7"
33
services:
44
trainingportal:
55
image: securecodingdojo/trainingportal
6+
deploy:
7+
resources:
8+
limits:
9+
cpus: "0.9"
10+
memory: 512M
11+
reservations:
12+
cpus: "0.9"
13+
memory: 512M
614
restart: "always" #change to always if you want the image to auto start
715
build:
816
context: ./trainingportal

docker-compose.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ version: "3.7"
33
services:
44
insecureinc:
55
image: securecodingdojo/insecure.inc
6+
deploy:
7+
resources:
8+
limits:
9+
cpus: "0.3"
10+
memory: 256M
11+
reservations:
12+
cpus: "0.3"
13+
memory: 256M
614
build:
715
context: ./insecureinc
816
dockerfile: Dockerfile.insecureinc
@@ -16,6 +24,14 @@ services:
1624

1725
trainingportal:
1826
image: securecodingdojo/trainingportal
27+
deploy:
28+
resources:
29+
limits:
30+
cpus: "0.3"
31+
memory: 256M
32+
reservations:
33+
cpus: "0.3"
34+
memory: 256M
1935
restart: "always" #change to always if you want the image to auto start
2036
build:
2137
context: ./trainingportal
@@ -34,6 +50,14 @@ services:
3450

3551
host1:
3652
image: securecodingdojo/hackerden-host1
53+
deploy:
54+
resources:
55+
limits:
56+
cpus: "0.1"
57+
memory: 128M
58+
reservations:
59+
cpus: "0.1"
60+
memory: 128M
3761
build:
3862
context: ./hackerden
3963
dockerfile: Dockerfile.host1
@@ -47,6 +71,14 @@ services:
4771

4872
host2:
4973
image: securecodingdojo/hackerden-host2
74+
deploy:
75+
resources:
76+
limits:
77+
cpus: "0.1"
78+
memory: 128M
79+
reservations:
80+
cpus: "0.1"
81+
memory: 128M
5082
build:
5183
context: ./hackerden
5284
dockerfile: Dockerfile.host2
@@ -60,6 +92,14 @@ services:
6092

6193
front:
6294
image: securecodingdojo/hackerden-front
95+
deploy:
96+
resources:
97+
limits:
98+
cpus: "0.2"
99+
memory: 128M
100+
reservations:
101+
cpus: "0.2"
102+
memory: 128M
63103
build:
64104
context: ./hackerden
65105
dockerfile: Dockerfile.front

hackerden/Dockerfile.front

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ WORKDIR /home/node/app
88

99
RUN npm install
1010
RUN npm install pm2@latest -g
11+
RUN npm test
1112

1213
USER node
1314

hackerden/Dockerfile.host2

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
FROM tomcat:8.5-jre8
22
COPY commandproc/commandproc.war /usr/local/tomcat/webapps
3-
RUN echo "user=admin" > /etc/credentials.properties
4-
RUN echo password=$(openssl rand -hex 32) >> /etc/credentials.properties
5-
RUN echo "SECRET2=FLAG-xxe" >> /usr/local/tomcat/conf/catalina.properties
6-
RUN echo "SECRET3=FLAG-deserialization" >> /usr/local/tomcat/conf/catalina.properties
7-
RUN openssl rand -out /etc/commandauth.bin 128
3+
COPY commandproc/start-commandproc.sh /usr/local/tomcat/start-commandproc.sh
4+
RUN chmod +x /usr/local/tomcat/start-commandproc.sh
5+
RUN chown -R www-data:www-data /usr/local/tomcat/logs
6+
RUN chown -R www-data:www-data /usr/local/tomcat/webapps
7+
RUN chown -R www-data:www-data /usr/local/tomcat/work
88
EXPOSE 8080
9+
ENTRYPOINT ["/bin/bash","-c","/usr/local/tomcat/start-commandproc.sh" ]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
echo "user=admin" > /etc/credentials.properties
2+
echo password=$(openssl rand -hex 32) >> /etc/credentials.properties
3+
openssl rand -out /etc/commandauth.bin 128
4+
export JAVA_OPTS="-DSECRET2=FLAG-xxe-$FLAG_SECRET -DSECRET3=FLAG-deserialization-$FLAG_SECRET "
5+
su - www-data -s /bin/bash -c '/usr/local/tomcat/bin/catalina.sh run' -w JAVA_HOME,JAVA_OPTS

0 commit comments

Comments
 (0)