-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
283 lines (263 loc) · 8.22 KB
/
Copy pathdocker-compose.yml
File metadata and controls
283 lines (263 loc) · 8.22 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
# ── Bawbel Scanner - docker-compose.yml ───────────────────────────────────────
#
# Version: 1.3.0
#
# Usage examples:
#
# Development shell:
# docker compose --profile dev up dev
#
# Run full test suite:
# docker compose --profile test run --rm test
#
# Scan a local skills directory (text output):
# SCAN_DIR=./skills docker compose run --rm scan
#
# Scan MCP server manifest (never starts the server):
# MCP_URL=https://server.example.com docker compose run --rm ssc
#
# Conformance check:
# MCP_URL=https://server.example.com docker compose run --rm conform
#
# AIBOM (AI Bill of Materials):
# SCAN_DIR=./skills docker compose run --rm aibom
#
# Pin skill files (rug pull protection):
# SCAN_DIR=./skills docker compose run --rm pin
#
# Check pins for drift:
# SCAN_DIR=./skills docker compose run --rm check-pins
#
# JSON output:
# SCAN_DIR=./skills docker compose run --rm scan-json
#
# SARIF output (GitHub Security upload):
# SCAN_DIR=./skills docker compose run --rm scan-sarif
#
# Full security audit of scanner codebase:
# docker compose --profile audit run --rm audit
#
# ─────────────────────────────────────────────────────────────────────────────
x-base: &base
build:
context: .
dockerfile: Dockerfile
environment:
BAWBEL_LOG_LEVEL: ${BAWBEL_LOG_LEVEL:-WARNING}
BAWBEL_LLM_MODEL: ${BAWBEL_LLM_MODEL:-}
BAWBEL_LLM_ENABLED: ${BAWBEL_LLM_ENABLED:-false}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
GEMINI_API_KEY: ${GEMINI_API_KEY:-}
MISTRAL_API_KEY: ${MISTRAL_API_KEY:-}
GROQ_API_KEY: ${GROQ_API_KEY:-}
PYTHONDONTWRITEBYTECODE: "1"
PYTHONUNBUFFERED: "1"
x-scan-base: &scan-base
<<: *base
build:
context: .
dockerfile: Dockerfile
target: production
volumes:
- ${SCAN_DIR:-./scan}:/scan:ro
read_only: true
security_opt:
- no-new-privileges:true
x-ssc-base: &ssc-base
<<: *base
build:
context: .
dockerfile: Dockerfile
target: production
read_only: true
security_opt:
- no-new-privileges:true
services:
# ── Development shell ──────────────────────────────────────────────────────
dev:
<<: *base
build:
context: .
dockerfile: Dockerfile
target: dev
container_name: bawbel-dev
volumes:
- .:/app
- pip-cache:/root/.cache/pip
environment:
BAWBEL_LOG_LEVEL: DEBUG
PYTHONDONTWRITEBYTECODE: "1"
PYTHONUNBUFFERED: "1"
stdin_open: true
tty: true
entrypoint: /bin/bash
profiles:
- dev
# ── Test runner ────────────────────────────────────────────────────────────
test:
<<: *base
build:
context: .
dockerfile: Dockerfile
target: test
container_name: bawbel-test
entrypoint: python
command:
- -m
- pytest
- tests/
- -v
- --tb=short
profiles:
- test
# ── Scan: text output (default) ────────────────────────────────────────────
scan:
<<: *scan-base
container_name: bawbel-scan
entrypoint: ["python", "-m", "scanner.cli"]
command:
- scan
- /scan
- --recursive
# ── Scan: JSON output ──────────────────────────────────────────────────────
scan-json:
<<: *scan-base
container_name: bawbel-scan-json
entrypoint: ["python", "-m", "scanner.cli"]
command:
- scan
- /scan
- --recursive
- --format
- json
profiles:
- json
# ── Scan: SARIF output (GitHub Security / GHAS) ────────────────────────────
scan-sarif:
<<: *scan-base
container_name: bawbel-scan-sarif
volumes:
- ${SCAN_DIR:-./scan}:/scan:ro
- ${REPORT_DIR:-./reports}:/reports
entrypoint: ["python", "-m", "scanner.cli"]
command:
- scan
- /scan
- --recursive
- --format
- sarif
- --output
- /reports/bawbel.sarif
profiles:
- sarif
# ── SSC: scan MCP server manifest (never starts the server) ────────────────
# Usage: MCP_URL=https://server.example.com docker compose run --rm ssc
ssc:
<<: *ssc-base
container_name: bawbel-ssc
entrypoint: ["python", "-m", "scanner.cli"]
command:
- ssc
- ${MCP_URL:-https://example.com}
# ── Conform: MCP server conformance grading (A+ to F) ─────────────────────
# Usage: MCP_URL=https://server.example.com docker compose run --rm conform
conform:
<<: *ssc-base
container_name: bawbel-conform
entrypoint: ["python", "-m", "scanner.cli"]
command:
- conform
- ${MCP_URL:-https://example.com}
# ── AIBOM: AI Bill of Materials ────────────────────────────────────────────
# Usage: SCAN_DIR=./skills docker compose run --rm aibom
aibom:
<<: *scan-base
container_name: bawbel-aibom
volumes:
- ${SCAN_DIR:-./scan}:/scan:ro
- ${REPORT_DIR:-./reports}:/reports
entrypoint: ["python", "-m", "scanner.cli"]
command:
- aibom
- /scan
- --output
- /reports/aibom.json
profiles:
- aibom
# ── Pin: record skill file hashes for rug pull detection ──────────────────
# Usage: SCAN_DIR=./skills docker compose run --rm pin
pin:
<<: *base
build:
context: .
dockerfile: Dockerfile
target: production
container_name: bawbel-pin
volumes:
- ${SCAN_DIR:-./scan}:/scan
entrypoint: ["python", "-m", "scanner.cli"]
command:
- pin
- /scan
profiles:
- pin
# ── Check-pins: detect drift from pinned hashes ────────────────────────────
# Usage: SCAN_DIR=./skills docker compose run --rm check-pins
check-pins:
<<: *scan-base
container_name: bawbel-check-pins
entrypoint: ["python", "-m", "scanner.cli"]
command:
- check-pins
- /scan
profiles:
- pins
# ── Report: full remediation guide ────────────────────────────────────────
report:
<<: *scan-base
container_name: bawbel-report
entrypoint: ["python", "-m", "scanner.cli"]
command:
- report
- /scan
profiles:
- report
# ── PiranhaDB: local threat intel API for offline development ─────────────
# Mirrors api.piranha.bawbel.io locally. No network calls from scanner.
piranha:
image: bawbel/piranha-api:latest
container_name: bawbel-piranha
ports:
- "8000:8000"
environment:
- PIRANHA_RECORDS_DIR=/app/records
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 10s
timeout: 5s
retries: 3
profiles:
- dev
- offline
# ── Security audit ─────────────────────────────────────────────────────────
audit:
<<: *base
build:
context: .
dockerfile: Dockerfile
target: dev
container_name: bawbel-audit
entrypoint: /bin/bash
command:
- -c
- |
echo "=== Bandit ===" && \
bandit -r scanner/ -f screen && \
echo "" && \
echo "=== pip-audit ===" && \
pip-audit -r requirements.txt
profiles:
- audit
volumes:
pip-cache: