Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·333 lines (311 loc) · 8.3 KB
/
Copy pathdocker-compose.yml
File metadata and controls
executable file
·333 lines (311 loc) · 8.3 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
services:
# ============================================
# Core: Eggsec security testing toolkit
# ============================================
eggsec:
build:
context: .
dockerfile: Dockerfile
image: eggsec:latest
container_name: eggsec
security_opt:
- no-new-privileges:true
cap_add:
- NET_RAW
- NET_ADMIN
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
volumes:
- ./scan-results:/app/results
- eggsec-sessions:/home/eggsec/.local/share/eggsec
environment:
- EGGSEC_LOG_LEVEL=info
- EGGSEC_CONFIG=/home/eggsec/.config/eggsec/eggsec.toml
- RUST_BACKTRACE=1
- EGGSEC_RATE_LIMIT=50
- REDIS_URL=redis://:eggsec123@redis:6379
healthcheck:
test: ["CMD", "eggsec", "--version"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
- scan-network
profiles:
- scanner
- testing
- full
- distributed
# ============================================
# Target: Vulnerable test application
# ============================================
dvwa:
image: vulnerables/web-dvwa:latest
container_name: dvwa-target
hostname: dvwa.target.local
ports:
- "8080:80"
environment:
- PHP_UPLOAD_LIMIT=10485760
- PHP_MAX_EXECUTION_TIME=300
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/setup.php"]
interval: 5s
timeout: 3s
retries: 15
start_period: 10s
networks:
- scan-network
profiles:
- testing
- full
# ============================================
# Target: OWASP Juice Shop (alternative)
# ============================================
juice-shop:
image: bkimminich/juice-shop:latest
container_name: juice-shop-target
hostname: juice-shop.target.local
ports:
- "3000:3000"
environment:
- NODE_ENV=secseed
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000"]
interval: 5s
timeout: 3s
retries: 15
start_period: 30s
networks:
- scan-network
profiles:
- testing
- full
# ============================================
# Storage: Elasticsearch for scan results
# ============================================
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
container_name: eggsec-elastic
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "ELASTIC_PASSWORD=eggsec123"
ports:
- "9200:9200"
volumes:
- elastic-data:/usr/share/elasticsearch/data
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:9200/_cluster/health || exit 1"]
interval: 10s
timeout: 5s
retries: 10
networks:
- scan-network
profiles:
- storage
- full
# ============================================
# Storage: Kibana for visualization
# ============================================
kibana:
image: docker.elastic.co/kibana/kibana:8.11.0
container_name: eggsec-kibana
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
ports:
- "5601:5601"
depends_on:
elasticsearch:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5601/api/status"]
interval: 10s
timeout: 5s
retries: 10
networks:
- scan-network
profiles:
- storage
- full
# ============================================
# Testing: Webhook receiver for notifications
# ============================================
webhook-receiver:
image: mendhak/http-https-echo:latest
container_name: webhook-receiver
hostname: webhook.target.local
ports:
- "8081:8080"
environment:
- HTTP_PORT=8080
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/"]
interval: 10s
timeout: 3s
retries: 5
networks:
- scan-network
profiles:
- testing
- full
# ============================================
# Anonymization: Tor proxy for anonymized scanning
# ============================================
tor-proxy:
image: dockage/tor-proxy:latest
container_name: tor-proxy
hostname: tor-proxy.target.local
ports:
- "9050:9050"
- "9051:9051"
environment:
- TOR_CONTROL_PORT=9051
- TOR_PASSWORD=eggsec123
healthcheck:
test: ["CMD", "torify", "curl", "-f", "http://localhost:9050"]
interval: 30s
timeout: 10s
retries: 3
networks:
- scan-network
profiles:
- testing
- full
cap_add:
- NET_ADMIN
# ============================================
# Storage: Redis for distributed coordinator
# ============================================
redis:
image: redis:7-alpine
container_name: eggsec-redis
command: redis-server --requirepass eggsec123
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "--no-auth-warning", "-a", "eggsec123", "ping"]
interval: 10s
timeout: 3s
retries: 5
networks:
- scan-network
profiles:
- distributed
- full
# ============================================
# Target: Metasploitable2 (additional vulnerable target)
# ============================================
metasploitable:
image: tleemcjr/metasploitable2:latest
container_name: metasploitable-target
hostname: metasploitable.target.local
ports:
- "2222:22"
- "3001:3000"
- "3306:3306"
- "5432:5432"
- "5900:5900"
- "6667:6667"
- "8009:8009"
- "8180:8180"
- "10000:10000"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
networks:
- scan-network
profiles:
- testing
- full
# ============================================
# Lab DBs for db-pentest real smoke (Phase 2+)
# Profile: db-lab
# These are intentionally misconfigured for defense-lab regression validation.
# Only bring up with: docker compose --profile db-lab up -d
# Use with: ./scripts/test-db-pentest.sh --real
# ============================================
postgres-lab:
image: postgres:16-alpine
container_name: db-pentest-postgres-lab
hostname: postgres-lab.local
environment:
POSTGRES_USER: lab
POSTGRES_PASSWORD: labpass
POSTGRES_DB: labdb
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U lab -d labdb || exit 1"]
interval: 5s
timeout: 3s
retries: 20
networks:
- scan-network
profiles:
- db-lab
# Deliberate misconfig applied after start by the smoke script (dangerous extension + grant)
mysql-lab:
image: mysql:8.0
container_name: db-pentest-mysql-lab
hostname: mysql-lab.local
environment:
MYSQL_ROOT_PASSWORD: labpass
MYSQL_DATABASE: labdb
MYSQL_USER: lab
MYSQL_PASSWORD: labpass
ports:
- "3307:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-u", "lab", "-plabpass"]
interval: 5s
timeout: 3s
retries: 20
networks:
- scan-network
profiles:
- db-lab
command: --local-infile=1 # deliberate misconfig for the FILE/local_infile checks
mssql-lab:
image: mcr.microsoft.com/mssql/server:2022-latest
container_name: db-pentest-mssql-lab
hostname: mssql-lab.local
environment:
ACCEPT_EULA: "Y"
MSSQL_SA_PASSWORD: "LabPassw0rd!Strong"
ports:
- "1434:1433"
healthcheck:
test: ["CMD-SHELL", "/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P 'LabPassw0rd!Strong' -Q 'SELECT 1' || exit 1"]
interval: 10s
timeout: 5s
retries: 30
start_period: 60s
networks:
- scan-network
profiles:
- db-lab
# xp_cmdshell and other misconfigs are applied by the smoke script after startup
networks:
scan-network:
driver: bridge
ipam:
config:
- subnet: 172.28.0.0/16
volumes:
eggsec-sessions:
elastic-data:
redis-data: