Skip to content

app/: security headers (sc-8900) - #80

Closed
ndbroadbent wants to merge 2 commits into
mainfrom
laravel-security-headers
Closed

ndbroadbent wants to merge 2 commits into
mainfrom
laravel-security-headers

Conversation

@ndbroadbent

Copy link
Copy Markdown
Member

Part of sc-8900. Ports server/src/security_headers.rs as global middleware, outermost so that the host check's 404s carry the headers too.

  • X-Content-Type-Options: nosniff and Referrer-Policy: strict-origin-when-cross-origin.
  • X-Frame-Options: DENY. Laravel's own default is SAMEORIGIN; this sets it explicitly, to match the policy's frame-ancestors 'none'.
  • The Content-Security-Policy, the same as today's:
    • scripts: VisualCI's own, Plausible's and Cloudflare's, and the hashes of the built page's inline scripts (read from VISUALCI_FRONTEND_DIR, default frontend/dist, on the first response);
    • images also from S3_PUBLIC_ENDPOINT's origin, for a dev server;
    • no form-action, so MCP OAuth callbacks aren't blocked.
  • x-powered-by is dropped.
  • The gallery's /g/ paths get CORS * and CORP cross-origin, so its images can be embedded anywhere.
  • A header a route sets itself (the gallery's sandbox policy) is kept.

Tests: today's unit tests, ported (only inline scripts hashed; the policy's contents), and an integration test that a normal response and a host-check 404 both carry the headers. The whole app suite passes on docspring-dev, and clippy is clean.

…ff, the referrer policy, no framing (DENY, over Laravel's SAMEORIGIN) and the Content-Security-Policy allowing only VisualCI's scripts, the built page's inline script hashes (VISUALCI_FRONTEND_DIR) and the analytics; x-powered-by dropped; the gallery's /g/ paths CORS and CORP cross-origin; outermost, so the host check's 404s carry them too
@visualci-com

visualci-com Bot commented Dec 2, 2026

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #282 · 331 unchanged · no changes

This PR vs base: nothing since #273, across 1 build

Updated as builds change. Agents can review with VisualCI's MCP tools.

…e the server serves (public/index.html under the application's base path, the frontend in the same image), read once at boot; in production a missing page or one with no inline scripts stops the boot (the theme script would be blocked), elsewhere it's logged
@ndbroadbent

Copy link
Copy Markdown
Member Author

Included in #87.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant