Repository navigation
Description
Summary
Prevent secret sprawl at the deployment boundary and migrate the known non-secret settings currently stored as GitHub Actions secrets or Secret Manager entries.
This is one ratchet issue: new deployment settings must be classified and cannot be wired as secrets by default; existing safe-to-declassify settings move out incrementally.
No secret values belong in this issue, CI output, fixtures, or tests.
Why now
Read-only audit evidence found two recurring failure modes:
- Public client configuration is passed to Docker builds as GitHub
secrets.*even though it is intentionally shipped to browsers and is listed as public build configuration inapp/config/client_env_policy.yaml. - Identifiers, hostnames, URLs, redirect allowlists, and model-selection policy are co-located with credentials in the backend ExternalSecret contract.
Existing protections are valuable but do not close this gap:
scripts/check-public-client-secrets.pyprevents server credentials entering client artifacts.backend/scripts/validate-backend-runtime-env.pyvalidates runtime bindings.- Neither currently rejects a non-secret setting being introduced as a Secret Manager/GitHub secret binding.
Scope
A. Add a secret-boundary CI ratchet
Add a checked-in, name-only classification policy with three kinds:
secret: credential, private key, password, signing/auth material, or sensitive aggregate configuration;config: server-side non-secret runtime setting;public_build: intentional browser/client build configuration.
For every new or changed deployment binding, CI must enforce:
${{ secrets.NAME }}is classified assecret;${{ vars.NAME }}is classified asconfigorpublic_build;- Cloud Run
secrets:and Helm/ExternalSecret mappings only usesecretnames; - normal
env:/Helm values do not source asecretname; - public web build settings may not be supplied via
secrets.*.
Use a diff ratchet rather than requiring an all-at-once legacy migration. Existing unclassified bindings may be a shrinking baseline, but new or changed bindings must be classified. Any exception must declare an owner, reason, and expiry date.
Register the check in .github/checks-manifest.yaml for both local and ci lanes, so it runs via make preflight, pre-push, and PR CI. Add unit fixtures proving accepted and rejected classifications without loading production configuration values.
B. Migrate audited non-secret settings
Use normal GitHub environment variables, checked-in runtime manifest values, Helm values, or ConfigMap-style configuration as appropriate. Preserve an additive rollout and remove old secret bindings only after deployment validation.
1. Public web build configuration — move from GitHub Secrets to GitHub Variables
API_URLNEXT_PUBLIC_API_BASE_URLNEXT_PUBLIC_FIREBASE_API_KEYNEXT_PUBLIC_FIREBASE_AUTH_DOMAINNEXT_PUBLIC_FIREBASE_PROJECT_IDNEXT_PUBLIC_FIREBASE_STORAGE_BUCKETNEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_IDNEXT_PUBLIC_FIREBASE_APP_IDNEXT_PUBLIC_FIREBASE_MEASUREMENT_IDNEXT_PUBLIC_FIREBASE_VAPID_KEYNEXT_PUBLIC_MIXPANEL_TOKENNEXT_PUBLIC_EXTRA_PROMPT_RULES
Evidence:
- public-build allowlist:
app/config/client_env_policy.yaml:24-40; - current secret-backed web build args:
.github/workflows/gcp_app.yml:46-53,.github/workflows/gcp_frontend.yml:56-63,.github/workflows/gcp_personas.yml:53-61.
Confirm Firebase API restrictions/App Check remain appropriate. Moving values does not create new public exposure because they are already intentionally delivered to clients.
2. Backend runtime metadata — move out of Secret Manager/ExternalSecret
Strong candidates:
- STT route policy:
STT_PRERECORDED_MODEL; assessSTT_SERVICE_MODELSunder a schema that rules out credentials. - OAuth public metadata:
GOOGLE_CLIENT_ID,X_OAUTH_CLIENT_ID,X_OAUTH_REDIRECT_URI. - MCP public metadata:
MCP_AUTHORIZATION_SERVER_URL,MCP_RESOURCE_URL, public client IDs/names, and redirect-URI allowlists. - Endpoint and host configuration:
REDIS_DB_HOST,TYPESENSE_HOST,RAPID_API_HOST. - Twilio identifiers:
TWILIO_ACCOUNT_SID,TWILIO_API_KEY_SID,TWILIO_TWIML_APP_SID. - Product selection policy:
CONVERSATION_SUMMARIZED_APP_IDS.
Evidence:
- production ExternalSecret map:
backend/charts/backend-secrets/prod_omi_backend_secrets_values.yaml:33-34,45-46,63-78,83-100,101-122; - STT model preference is parsed as a model list:
backend/config/prerecorded_stt.py:81-115; - Claude MCP client uses
token_endpoint_auth_method: "none"with no client secret hash:backend/database/mcp_oauth.py:215-226; - Twilio code distinguishes
*_SIDidentifiers fromTWILIO_AUTH_TOKENandTWILIO_API_KEY_SECRET:backend/utils/twilio_service.py:34-70.
Explicitly retain as secrets
Keep real credentials protected, including provider API keys, passwords, signing/encryption secrets, OAuth client secrets, bearer tokens, private keys, and MCP_OAUTH_CLIENTS_JSON until its schema is split: its parser supports confidential-client material and client-secret hashes.
Do not declassify NEXT_PUBLIC_RAPIDAPI_KEY or NEXT_PUBLIC_LINKEDIN_API_KEY; despite misleading names, they are server-side provider credentials. Rename them as part of cleanup if practical.
Acceptance criteria
- A checked-in name-only secret/config/public-build policy exists with owner/reason/expiry for exceptions.
- CI and local preflight fail for a new or changed unclassified secret reference, a config value wired as a secret, or a public-build value wired through
secrets.*. - The check is registered in
.github/checks-manifest.yamlfor both local and CI lanes. - Tests use fake names/fixtures and never access or print live secret values.
- The listed public web settings use GitHub environment variables and corresponding workflows use
vars.*. - The listed backend config settings are moved from Secret Manager/ExternalSecret through additive dev then prod rollout with contract validation.
- Only live credential bindings remain in ExternalSecrets; GKE ExternalSecret and Cloud Run validation pass after each migration.
- Documentation explains the three classifications and how to add a new setting.
Non-goals
- Reading, logging, or committing any secret values.
- Replacing static GCP deployment credentials with GitHub OIDC/WIF in this issue; track that as a separate IAM migration.
- Removing
SERVICE_ACCOUNT_JSONwithout proving the relevant workload identity/ADC replacement. - Deploying production changes as part of issue creation.
Related
- Replace transcription release-gate config sprawl with ephemeral probe auth #9661 — zero-new-secret transcription candidate gate.
- Create canonical backend runtime config to prevent Cloud Run/GKE env drift #8515 — canonical backend runtime manifest, now the right place to express normal runtime config.
- P1: Build secret consumer registry and rotation verifier #8722 and P1: Add release-workflow secret hygiene scanner and artifact redaction tests #8726 — closed secret-consumer/release-hygiene work; this issue fills the classification and prevention gap.
- Prod GKE backend ExternalSecret still references missing SERVICE_ACCOUNT_JSON #9187 — stale prod ExternalSecret mapping; fix independently, then apply this guard to prevent recurrence.
Activity
fix(deploy): classify secret and public setting boundaries (#9670)
fix(deploy): classify secret and public setting boundaries (BasedHard…