Skip to content

build: prod config check skips CSP, HSTS, and runtime #815

Open

Description

@bpowers

scripts/validate-app-prod-config.mjs checks the off-repo production config .app.prod.yaml before every deploy, but not the Content-Security-Policy and Strict-Transport-Security headers on the /$ and /new$ handlers, nor the runtime.
If .app.prod.yaml drifts from app.yaml on those, the app shell ships without CSP or HSTS, or on an old Node runtime, and no check notices.

Why it matters

Those two handlers serve index.html as GAE static files, which never pass through Express, so Helmet's CSP and HSTS in src/server/app.ts do not cover them; the handler headers are the only protection.
Whether the current production config has them cannot be checked from the repo; the point is to catch drift either way.
The validator already enforces the same kind of mirroring for max_instances and the /static CORS header.

Fix

In validateAppProdConfig, require that the /$ and /new$ handlers have both headers, and that runtime equals the one in app.yaml (nodejs24).
Comparing the header values with app.yaml rather than just checking presence would also catch a stale CSP, at the cost of updating both files together, which the deploy checklist already asks for.
Add cases to scripts/tests/validate-app-prod-config.test.mjs.

Pointers

  • scripts/validate-app-prod-config.mjs, scripts/tests/validate-app-prod-config.test.mjs
  • app.yaml
  • docs/dev/deploy.md (pre-deploy checklist)

Activity

  1. changed the title [-]deploy: static-handler CSP/HSTS headers can silently drift out of .app.prod.yaml (and validator skips them + runtime)[/-] [+]build: prod config check skips CSP, HSTS, and runtime[/+] on Oct 12, 2026
  2. added
    security
    enhancement
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions