Skip to content

Commit

Permalink
Add healthchecks to services which have a non-trivial entrypoint/comm…
Browse files Browse the repository at this point in the history
…and. This prevents the eval from starting until they're ready.
  • Loading branch information
craigwalton-dsit committed Sep 19, 2024
1 parent 1913a04 commit 35a9046
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ services:
- cmd_injection_network
expose:
- 8080
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://0.0.0.0:8080/ || exit 1" ]
interval: 5s
timeout: 5s
retries: 5

attacker:
image: marshw/attacker
Expand Down
5 changes: 5 additions & 0 deletions evals/gdm_capabilities/in_house_ctf/data/db_3/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ services:
- db_3_network
expose:
- 5432
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U admin" ]
interval: 5s
timeout: 5s
retries: 5

attacker:
image: marshw/attacker
Expand Down
6 changes: 6 additions & 0 deletions evals/gdm_capabilities/in_house_ctf/data/grafana/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ services:
- grafana_network
expose:
- 3000
healthcheck:
# curl is not installed in the grafana image, so use wget
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1" ]
interval: 5s
timeout: 5s
retries: 5

attacker:
image: marshw/attacker
Expand Down
5 changes: 5 additions & 0 deletions evals/gdm_capabilities/in_house_ctf/data/idor/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ services:
- idor_network
expose:
- 8081
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://0.0.0.0:8081/ || exit 1" ]
interval: 5s
timeout: 5s
retries: 5

attacker:
image: marshw/attacker
Expand Down
10 changes: 10 additions & 0 deletions evals/gdm_capabilities/in_house_ctf/data/pw_reuse/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@ services:
- pw_reuse_network
expose:
- 22
healthcheck:
test: [ "CMD-SHELL", "nc -z localhost 22 || exit 1" ]
interval: 5s
timeout: 5s
retries: 5

pw_reuse_db:
image: marshw/pw_reuse_db
init: true
networks:
- pw_reuse_network
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U admin" ]
interval: 5s
timeout: 5s
retries: 5

attacker:
image: marshw/attacker
Expand Down
5 changes: 5 additions & 0 deletions evals/gdm_capabilities/in_house_ctf/data/spray/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ services:
- spray_network
expose:
- 8082
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://0.0.0.0:8082/ || exit 1" ]
interval: 5s
timeout: 5s
retries: 5

attacker:
image: marshw/attacker
Expand Down
5 changes: 5 additions & 0 deletions evals/gdm_capabilities/in_house_ctf/data/sqli/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ services:
- sqli_network
expose:
- 80
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://0.0.0.0:80/users || exit 1" ]
interval: 5s
timeout: 5s
retries: 5

attacker:
image: marshw/attacker
Expand Down
5 changes: 5 additions & 0 deletions evals/gdm_capabilities/in_house_ctf/data/ssh/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ services:
- ssh_network
expose:
- 22
healthcheck:
test: [ "CMD-SHELL", "nc -z localhost 22 || exit 1" ]
interval: 5s
timeout: 5s
retries: 5

attacker:
image: marshw/attacker
Expand Down
5 changes: 5 additions & 0 deletions evals/gdm_capabilities/in_house_ctf/data/webmin/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ services:
- webmin_network
expose:
- 10000
healthcheck:
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:10000 || exit 1" ]
interval: 5s
timeout: 5s
retries: 5

attacker:
image: marshw/attacker
Expand Down

0 comments on commit 35a9046

Please sign in to comment.