feat(security): production Compose topology, firewall rulesets, Docker mTLS
Named-bridge-network production Compose (not host networking, unlike dev) for rn-platform-01; egress-proxy + agents for rn-lab-host-01. Caddy reverse proxy, single public origin, Grafana restricted to management_cidr. iptables-restore firewall rulesets for all three hosts (Proxmox host, rn-platform-01, rn-lab-host-01) codifying the Platform/Lab-Host boundary: no student-to-student traffic, no direct Proxmox exposure, no direct Postgres/Provisioner exposure from the Lab Host. Mutual TLS for the Provisioner<->Lab Host Docker connection: certificate generation/verification scripts, dockerd TLS config, firewall-restricted port 2376. Application support already existed since Phase 1; this is purely the operational half. Validated: docker compose config, caddy validate, firewall structural lint, and a real openssl s_server/s_client mTLS handshake proving the cert chain and mutual-auth rejection (legitimate client verified, rogue client correctly rejected with verify code 19).
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
# Conservative production tuning baseline — deliberately NOT hand-tuned to a specific RAM
|
||||
# allocation before rn-platform-01's real resources are known (Phase 4 instruction: do not
|
||||
# over-tune before actual hardware exists). Sized for a modest ~4GB Postgres allocation, safe
|
||||
# defaults everywhere else. Revisit once VM RAM is final — see docs/PHASE4_PRODUCTION_INFRASTRUCTURE.md §11.
|
||||
|
||||
shared_buffers = 1GB
|
||||
effective_cache_size = 3GB
|
||||
maintenance_work_mem = 256MB
|
||||
work_mem = 16MB
|
||||
|
||||
max_connections = 100
|
||||
|
||||
# WAL — safe defaults for a single-instance setup with pg_dump/pg_basebackup-style backups
|
||||
# (infra/backup/). Not configured for streaming replication (out of scope this phase — see
|
||||
# docs/BACKUP_DR.md's DR model for why pg_dump + periodic pg_basebackup is the chosen approach,
|
||||
# not a hot standby).
|
||||
wal_level = replica
|
||||
max_wal_size = 2GB
|
||||
min_wal_size = 512MB
|
||||
checkpoint_completion_target = 0.9
|
||||
|
||||
# Query logging — slow queries only, never full statement logging (would capture bind
|
||||
# parameters that can include session tokens' hashes / PII in edge cases). See docs/OBSERVABILITY.md.
|
||||
log_min_duration_statement = 500
|
||||
log_line_prefix = '%m [%p] %q%u@%d '
|
||||
log_checkpoints = on
|
||||
log_connections = on
|
||||
log_disconnections = on
|
||||
|
||||
# Autovacuum stays on defaults — no reason to disable it for this workload size.
|
||||
Reference in New Issue
Block a user