Repository navigation
Closed
Labels
backendBackend Task (python)p1Priority: Critical (score 22-29)security-reviewTouches auth, provider routing, secrets, or security-sensitive surfacesstability
Description
Problem
During the emergency rotation, secret stores could be correct while running Cloud Run revisions and GKE pods still held stale env vars. We had to manually identify consumers, sync K8s/Cloud Run secret wiring, restart/roll services, and verify no stale runtimes remained.
Scope
Add a machine-readable registry and read-only verifier for high-risk runtime secrets.
Proposed deliverables
- A registry schema for secrets/env vars with fields such as:
- secret/env var name
- environment
- consuming service/job/workflow
- runtime type: Cloud Run, GKE, GitHub Actions, client build, etc.
- refresh method: new revision, rollout restart, ExternalSecret sync, release rebuild, etc.
- safe verification method
- owner / docs link
- Initial entries for
OPENAI_API_KEY, Google OAuth/client secret vars, Google Maps vars, and other current high-risk backend/provider secrets. - A redacted verifier that reports presence/version/hash metadata and stale-runtime risk without printing secret values.
- CI validation that referenced runtime env vars are present in the registry/contract.
Acceptance criteria
OPENAI_API_KEYhas complete entries for backend, backend-sync, backend-integration, desktop-backend, backend-listen, pusher, llm-gateway, and any current consumers.- The verifier never prints secret values; tests use fake sentinel values to prove redaction.
- The verifier can classify consumers that require restart/redeploy after rotation.
- CI fails when charts/workflows/code add a new high-risk secret reference without registry/contract updates.
- Docs include a rotation checklist with explicit read-only vs prod-write boundaries.
Related context
- Existing runtime env validator:
backend/scripts/validate-backend-runtime-env.py - Existing Cloud Run secret sync helper:
backend/scripts/sync_cloudrun_secrets_from_chart.sh - Related issue: Backend runtime missing Google OAuth secret wiring after key rotation #8719 for missing Google secret wiring.
Safety / agent notes
- Do not include raw secrets, tokens, provider keys, private keys, or user content in PRs, logs, fixtures, docs, or issue comments.
- Public code should run without production credentials. Prefer fake fixtures, dry-run/read-only modes, and
PASS/FAIL/SKIP_NO_CREDENTIALS/NOT_RUNoutputs. - Production writes, key rotation/revocation, deploys, traffic shifts, and break-glass actions require explicit maintainer approval outside this issue.
- If implementation changes setup, deploy commands, env vars, safety rules, service boundaries, or runtime contracts, update docs/AGENTS.md as appropriate.
Metadata
Metadata
Assignees
Labels
backendBackend Task (python)p1Priority: Critical (score 22-29)security-reviewTouches auth, provider routing, secrets, or security-sensitive surfacesstability
Activity
Add secret consumer registry verifier (#8733)