Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
83 lines (75 loc) · 2.29 KB
/
Copy pathdocker-compose.yml
File metadata and controls
83 lines (75 loc) · 2.29 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
75
76
77
78
79
80
81
82
83
# SecureFlow docker-compose — INTENTIONALLY VULNERABLE.
# Planted vulnerabilities:
# IV-01 hardcoded DB password
# IV-02 databases exposed on host network (ports 5432, 5433)
# IV-03 secrets in environment variables (SECRET_KEY, SESSION_SECRET, DB_PASSWORD)
# IV-06 no resource limits
# IV-07 no network segmentation between services
# CK-03 postgres:14 used without digest pinning
version: "3.8"
services:
auth-db:
image: postgres:14
environment:
POSTGRES_DB: authdb
POSTGRES_USER: authuser
POSTGRES_PASSWORD: authpass123
ports:
- "5432:5432" # IV-02 — exposed on host.
volumes:
- ./db/auth/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
- auth-db-data:/var/lib/postgresql/data
transaction-db:
image: postgres:14
environment:
POSTGRES_DB: transactiondb
POSTGRES_USER: txuser
POSTGRES_PASSWORD: txpass123
ports:
- "5433:5432" # IV-02 — exposed on host.
volumes:
- ./db/transaction/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
- transaction-db-data:/var/lib/postgresql/data
auth-service:
build: ./services/auth-service
environment:
DB_HOST: auth-db
DB_PORT: 5432
DB_NAME: authdb
DB_USER: authuser
DB_PASSWORD: authpass123 # IV-01, IV-03
JWT_SECRET: super-secret-key-123 # AV-07, IV-03
ports:
- "5001:5001"
depends_on:
- auth-db
transaction-service:
build: ./services/transaction-service
environment:
DB_HOST: transaction-db
DB_PORT: 5432
DB_NAME: transactiondb
DB_USER: txuser
DB_PASSWORD: txpass123 # IV-01, IV-03
AUTH_SERVICE_URL: http://auth-service:5001
ports:
- "5002:5002"
depends_on:
- transaction-db
- auth-service
frontend:
build: ./services/frontend
environment:
SESSION_SECRET: changeme # FV-03, IV-03
AUTH_SERVICE_URL: http://auth-service:5001
TRANSACTION_SERVICE_URL: http://transaction-service:5002
ports:
- "5000:5000"
depends_on:
- auth-service
- transaction-service
volumes:
auth-db-data:
transaction-db-data:
# IV-06 — no `deploy.resources.limits` on any service.
# IV-07 — no user-defined network isolation; everything on the default bridge.