how-to security-reviewerdeployer

OpenGov pins every runtime dependency by hash and base image by immutable SHA-256 digest. Automated gates inspect Python locks, JavaScript locks, static taint patterns, and container images on every pull request and schedule.

Build and runtime pinning

ArtifactPinning mechanism
Base runtime imageChainguard minimal Python image pinned by manifest-list @sha256 digest in Dockerfile.
Python packagesuv.lock hashes enforced via uv export --locked and pip install --require-hashes --no-deps.
Frontend workspacesCommitted package-lock.json files per workspace built with npm ci.
Deployment secretsSOPS plus age encryption checked before commit via detect-secrets.

Default production builds exclude optional curl_cffi browser wheels so the runtime image stays minimal and auditable.

Automated security gates

Every change passes five complementary checks in CI:

  1. pip-audit checks exported Python requirements against known advisories with a 72-hour remediation window.
  2. npm audit checks all frontend workspaces at moderate severity and above.
  3. osv-scanner audits every lockfile across ecosystems and checks that it read every lockfile.
  4. semgrep runs diff-aware Python, TypeScript, and custom SSRF taint rules.
  5. trivy scans built container images on schedule for OS and runtime vulnerabilities.

Vulnerability triage and acceptance

Open security alerts follow a deterministic state machine and strict SLA deadlines (72h critical, 7d high, 30d medium, 90d low). When an upstream dependency blocks a fix or a finding is non-exploitable, maintainers record a time-bounded entry in ci/accepted_security_alerts.yaml. Each acceptance requires a plain-language reason, owner, and expiry date of at most 90 days. Expired entries reopen automatically so no suppression becomes permanent.