This summary explains the security posture of a single self-hosted OpenGov country deployment. It outlines defended threat classes, residual operational responsibilities, and automated verification controls. Detailed internal audit notes remain restricted until pre-production hardening items close.
Scope and standing context
One OpenGov deployment serves one country instance: five frontend workspaces, one FastAPI backend, one Procrastinate worker, Keycloak, ClamAV, and PostgreSQL 18. Physical host compromise by the infrastructure owner sits outside software threat scope. Deployers must review all residual operational controls before serving live citizen traffic.
Core mitigations
| Threat area | Control summary |
|---|---|
| Cross-site request forgery | API authentication uses OIDC bearer tokens only, enforced by automated tests. |
| Cross-site scripting | Responses ship strict Content-Security-Policy and X-Content-Type-Options: nosniff headers. |
| Self-registration abuse | Applicant registration defaults closed (registrationAllowed: false) and requires SMTP verification plus proxy rate limits. |
| Audit log tampering | Audit records use an append-only, hash-chained PostgreSQL table enforced by database triggers. |
| Malicious file uploads | Uploads validate magic bytes, enforce size ceilings, and scan in an isolated clamav container. |
| Outbound connector abuse | SmartLink validates outbound targets and blocks private network ranges, enforced by Semgrep taint rules. |
| Route access control | Every served endpoint declares its caller audience and passes stranger-refusal tests in CI. |
Residual operator responsibilities
Deployers must complete three operational controls before production launch:
- Off-host backups: Default backup scripts write encrypted bundles to local disk. Operators must replicate bundles off-host while keeping KEK keys separate.
- Proxy rate limiting: Login endpoints carry Traefik rate-limit labels. Operators should add edge rate limits on public read endpoints matched to country traffic.
- Repository and host hardening: Operators control host firewall rules, SSH access, and private-CA trust settings (
OPENGOV_HSTS_ENABLED).