ADR 012: SDLC Security-First Network Isolation & Localhost Invariant
Context
During SDLC run sdlc-1016-49db (GoLinks microservice), the service was built and deployed listening on a wildcard interface (0.0.0.0:<port>). This exposed the internal port directly to the public internet on http://<vps-ip>:<port>, bypassing reverse proxy authorization and security controls. The VPS Cockpit dashboard detected the listening socket and flagged it as Rogue / Unprotected.
Decision
Enforce a non-negotiable Security Invariant (Highest Priority) across all agent workflows, SDLC stages, and service implementations:
-
Strict Localhost Network Binding:
- ALL backend services, APIs, and microservices MUST bind strictly to
127.0.0.1(loopback). - NEVER bind to
0.0.0.0,::, or:<port>directly. - Public access is permitted ONLY through Caddy reverse proxy (
/etc/caddy/Caddyfile).
- ALL backend services, APIs, and microservices MUST bind strictly to
-
Automated Pre-Review Security Gate (
sdlc-scanner.sh):- Added rule
SECURITY_WILDCARD_NETWORK_BINDING(HIGH severity). - Scans for
0.0.0.0,fmt.Sprintf(":%s"),ListenAndServe(":"), and wildcard host assignments. - Any
HIGHseverity finding hard-blocks approval at Gate 2 (05_code_review).
- Added rule
-
Post-Deployment Port Hygiene Verification:
hermes-sdlc.pyautomatically inspectsss -tulpnafter service reload.- Any service detected listening on
0.0.0.0or wildcard interfaces triggers an immediate critical security alert.
-
Zero Untracked / Committed Build Artifacts:
- Compiled binaries and SQLite database files (
*.db) must be excluded via.gitignoreand never committed into Git branches.
- Compiled binaries and SQLite database files (
Status
Accepted and Enforced across GEMINI.md, agent-profiles.md, sdlc/SKILL.md, and sdlc-scanner.sh.