Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (68 loc) · 2.03 KB
/
Copy pathdocker-compose.yml
File metadata and controls
74 lines (68 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# vulnerable-nodejs (NodeBazaar store) — intentionally vulnerable shop.
# Usage: docker compose up --build
# App: http://localhost:8888
# (8888 on purpose: Caido and many tools already claim 8080)
services:
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: nodebazaar
POSTGRES_PASSWORD: nodebazaar
POSTGRES_DB: nodebazaar
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U nodebazaar -d nodebazaar"]
interval: 3s
timeout: 3s
retries: 20
mongo:
image: mongo:7
command: ["--quiet", "--bind_ip_all"]
volumes:
- mongodata:/data/db
healthcheck:
test: ["CMD", "mongosh", "--quiet", "--eval", "db.runCommand({ ping: 1 })"]
interval: 3s
timeout: 5s
retries: 20
# Fake cloud metadata service (IMDS). Only reachable inside the compose
# network — exactly how a real IMDS behaves. Target of the SSRF lab.
imds:
build: ./mocks/imds
# Fake secrets vault. Takes the IMDS token, hands out a "pipeline secret".
vault:
build: ./mocks/vault
web:
build: .
ports:
- "${APP_PORT:-8888}:3000"
environment:
DATABASE_URL: postgres://nodebazaar:nodebazaar@db:5432/nodebazaar
MONGO_URL: mongodb://mongo:27017/nodebazaar
IMDS_URL: http://imds:8090
VAULT_URL: http://vault:8091
# VULN: dev-grade secrets committed for the labs.
SESSION_SECRET: "nodebazaar-dev-secret-do-not-use-in-prod"
JWT_SECRET: "jwt-super-secret"
# VULN (A02): verbose errors on in a "shipping" compose.
DEBUG_ERRORS: "1"
NODE_ENV: development
depends_on:
db:
condition: service_healthy
mongo:
condition: service_healthy
imds:
condition: service_started
vault:
condition: service_started
# Hardening (deployment-level — the app stays vulnerable on purpose):
read_only: true
tmpfs:
- /tmp
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
volumes:
pgdata:
mongodata: