Docker Proxy Hardening
Cheatsheet hardening Docker + reverse proxy (2026)
Most exposed self-hosted stacks fail at proxy boundaries and container defaults. Use this cheatsheet as a fast baseline before advanced tuning.
Hardening checklist
- - Expose only proxy entrypoints publicly; keep app containers on private networks.
- - Enforce TLS everywhere with strict redirect and modern cipher policy.
- - Set security headers (HSTS, CSP baseline, X-Content-Type-Options, Referrer-Policy).
- - Restrict upstream routes and remove debug/admin paths from public exposure.
- - Use least-privilege container runtime settings (read-only FS where possible, dropped capabilities).
- - Pin image versions and apply regular vulnerability scans before deployment.
- - Protect secrets via runtime secret stores, never hardcoded env files in public repos.
- - Monitor 4xx/5xx/auth anomalies and rate-limit abusive request patterns.
Config sanity checks
- - Proxy config is source-controlled and peer-reviewed before release.
- - Compose/network policy blocks lateral traffic between unrelated services.
- - Access logs include request ID, source, and upstream target for incident tracing.
Verification criteria
- - External scan shows only expected TLS-enabled entrypoints.
- - Sensitive internal routes are inaccessible from public interfaces.
- - Alerting catches simulated abuse traffic within defined SLA.
Cheatsheet guidance is operational best practice and not a formal penetration test.