|
4 | 4 | //! used for service isolation. Each network serves a specific security purpose |
5 | 5 | //! in the deployment topology. |
6 | 6 | //! |
7 | | -//! ## Network Purposes |
| 7 | +//! ## Security: Three-Network Segmentation (Defense in Depth) |
8 | 8 | //! |
9 | | -//! | Network | Purpose | Connected Services | |
10 | | -//! |---------|---------|-------------------| |
11 | | -//! | `Database` | Isolates database access | Tracker ↔ `MySQL` | |
12 | | -//! | `Metrics` | Metrics scraping | Tracker ↔ Prometheus | |
13 | | -//! | `Visualization` | Dashboard queries | Prometheus ↔ Grafana | |
14 | | -//! | `Proxy` | TLS termination | Caddy ↔ backend services | |
| 9 | +//! Network isolation prevents lateral movement between services and reduces attack surface. |
| 10 | +//! Each service is placed in the minimum networks required for its function. |
| 11 | +//! |
| 12 | +//! ### Network Topology |
| 13 | +//! |
| 14 | +//! | Network | Purpose | Connected Services | Security Boundary | |
| 15 | +//! |---------|---------|-------------------|-------------------| |
| 16 | +//! | `Database` | Isolates database access | Tracker ↔ `MySQL` | Only tracker can access database | |
| 17 | +//! | `Metrics` | Metrics scraping | Tracker ↔ Prometheus | Prometheus cannot access database | |
| 18 | +//! | `Visualization` | Dashboard queries | Prometheus ↔ Grafana | Grafana cannot access tracker directly | |
| 19 | +//! | `Proxy` | TLS termination | Caddy ↔ backend services | External traffic goes through Caddy | |
| 20 | +//! |
| 21 | +//! ### Security Benefits |
| 22 | +//! |
| 23 | +//! 1. **`MySQL` isolation**: Only tracker has database access (least privilege) |
| 24 | +//! 2. **Metrics isolation**: Grafana must query through Prometheus (no direct tracker access) |
| 25 | +//! 3. **Lateral movement prevention**: Compromised service cannot access unrelated services |
| 26 | +//! 4. **Defense in depth**: Network segmentation + authentication + Docker port bindings + UFW |
| 27 | +//! |
| 28 | +//! ### References |
| 29 | +//! |
| 30 | +//! - ADR: `docs/decisions/docker-ufw-firewall-security-strategy.md` |
| 31 | +//! - Analysis: `docs/analysis/security/docker-network-segmentation-analysis.md` |
15 | 32 | //! |
16 | 33 | //! ## Usage |
17 | 34 | //! |
|
0 commit comments