← knowledge.oriz.in

Security headers — strict CSP via _headers + dual CI audit

decision decisionssecurityheaderscsphsts

Security headers — strict CSP via _headers + dual CI audit

Decision

Every family site ships a strict security-headers preset via a _headers file at the project root, sourced from @chirag127/oriz-kit. Cloudflare Pages reads the file at deploy and applies the rules at the edge.

Every PR runs two auditors in parallel:

  1. securityheaders.com — Scott Helme's rubric (headers grade)
  2. Mozilla Observatory — TLS + cookies + redirects + headers (comprehensive)

PR fails if either score drops below A.

Why

The locked preset

The kit's _headers template:

/*
  Content-Security-Policy: default-src 'self'; script-src 'self' 'wasm-unsafe-eval' https://challenges.cloudflare.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: https://*.imagekit.io https://*.cloudinary.com; connect-src 'self' https://api.oriz.in https://*.firebaseio.com https://firestore.googleapis.com https://*.knock.app https://vitals.vercel-insights.com; frame-ancestors 'none'; base-uri 'self'; form-action 'self'
  Strict-Transport-Security: max-age=63072000; includeSubDomains; preload
  X-Frame-Options: DENY
  X-Content-Type-Options: nosniff
  Referrer-Policy: strict-origin-when-cross-origin
  Permissions-Policy: accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(self), usb=()
  Cross-Origin-Opener-Policy: same-origin
  Cross-Origin-Resource-Policy: same-site

connect-src includes the family's known endpoints: api.oriz.in, Firestore, Knock, and Vercel Speed Insights. Per-site additions are allowed but must be reviewed.

Implications

Architecture

CI gate

What "below A" means

What we don't do

Cross-refs