Skip to content

Add default content security policy#8

Merged
rdhar merged 1 commit intomainfrom
add-default-content-security-policy
Apr 7, 2026
Merged

Add default content security policy#8
rdhar merged 1 commit intomainfrom
add-default-content-security-policy

Conversation

@rdhar
Copy link
Copy Markdown
Member

@rdhar rdhar commented Apr 7, 2026

This pull request adds a Content Security Policy (CSP) configuration to the Astro site settings to improve site security per Astro v6.0 (see docs).

Security enhancements:

  • Added a security.csp configuration with a directive of ["default-src 'self'"] in astro.config.mjs to restrict resource loading to the same origin.

@rdhar rdhar marked this pull request as ready for review April 7, 2026 16:23
@rdhar rdhar added this pull request to the merge queue Apr 7, 2026
Merged via the queue into main with commit 2a0f89d Apr 7, 2026
4 checks passed
@rdhar rdhar deleted the add-default-content-security-policy branch April 7, 2026 16:23
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0dd57faf52

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +10 to +13
security: {
csp: {
directives: ["default-src 'self'"],
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Switch Markdown highlighting before turning on CSP

Enabling security.csp here introduces a user-visible regression for code blocks because this repo still uses Astro’s default Markdown highlighter (Shiki) and Astro 6 explicitly notes Shiki is incompatible with CSP due to inline styles. Since no markdown.syntaxHighlight override is configured, pages with fenced code blocks (for example src/content/blog/markdown-style-guide.md) can lose syntax-highlighting styles under this policy unless highlighting is migrated (e.g., to Prism) or CSP handling is adjusted.

Useful? React with 👍 / 👎.

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