Commit 7d56581
committed
fix: [#246] bind Prometheus to localhost for secure validation
**Issue**: Prometheus port was completely removed for security, but this broke
validation in e2e tests since the service couldn't be accessed from the host.
**Solution**: Bind Prometheus port to localhost only (127.0.0.1:9090:9090)
instead of removing it entirely or exposing it to all interfaces (0.0.0.0).
**Changes**:
- Update docker-compose template to bind port 9090 to 127.0.0.1 only
- Update test to verify localhost-only binding is present
- Prometheus remains accessible from Docker network for Grafana
- Validation works via SSH: curl http://localhost:9090
**Security Benefits**:
- Before: Port removed (no validation possible from host)
- After: Port bound to localhost (validation works, no external exposure)
- Grafana access: Unchanged (uses Docker network: http://prometheus:9090)
- External access: Still blocked (not accessible from outside VM)
**Verification**:
- All e2e deployment workflow tests passing (~73s)
- Prometheus smoke test successful via localhost
- Port not exposed to external network1 parent 5116f33 commit 7d56581
File tree
2 files changed
+6
-5
lines changed- src/infrastructure/templating/docker_compose/template/renderer
- templates/docker-compose
2 files changed
+6
-5
lines changedLines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
| 388 | + | |
389 | 389 | | |
390 | | - | |
391 | | - | |
| 390 | + | |
| 391 | + | |
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
| 69 | + | |
69 | 70 | | |
70 | | - | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
0 commit comments