Skip to content

Add browser security policy - #17

Merged
osiewicz merged 1 commit into
mainfrom
add-security-policy
Sep 15, 2026
Merged

osiewicz merged 1 commit into
mainfrom
add-security-policy

Conversation

@osiewicz

Copy link
Copy Markdown
Contributor

Summary

  • generate a restrictive per-page Content Security Policy with Astro
  • set an explicit strict-origin-when-cross-origin referrer policy
  • replace the docs search inline submit handler so scripts remain hash-restricted
  • allow only the external image origins currently used by the site

GitHub Pages does not support custom response headers, so this intentionally uses CSP and referrer meta policies. X-Frame-Options and CSP frame-ancestors are omitted because browsers require those protections to be delivered as HTTP headers.

Verification

  • npm run build
  • verified all 15 generated HTML pages contain CSP and referrer policies
  • verified every inline script and style element has a matching SHA-256 CSP hash
  • verified generated pages contain no inline event handlers

@osiewicz
osiewicz merged commit 2e14165 into main Sep 15, 2026
2 checks passed
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