Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use vite plugin to generate http-equiv meta tags for csp #269

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

collinlokken
Copy link
Contributor

@collinlokken collinlokken commented Feb 13, 2025

Why is this pull request needed?

  • add_header directive in nginx only actually included on the innermost level, causing security.conf to be left out
  • refrain from using unsafe-inline on scripts by instead whitelisting inline scripts using SRI (subresource integrity), that allows scripts to be run only if the hash of their content matches the computed hash in the meta tag

What does this pull request change?

Move CSP out of security.conf into vite plugin that is able to generate CSP in the DOM as a meta tag and add SRI to allow the scripts we need to run

Issues related to this change:

Closes #268

@collinlokken collinlokken requested a review from a team as a code owner February 13, 2025 10:01
@collinlokken collinlokken changed the title fix: set security conf in dev and prod environments fix: use vite plugin to generate http-equiv meta tags for csp Feb 13, 2025
@collinlokken collinlokken force-pushed the fix/nginx-security-include branch from fbd5ae6 to f5c0f9e Compare February 13, 2025 13:43
@collinlokken collinlokken merged commit df215da into main Feb 13, 2025
7 checks passed
@collinlokken collinlokken deleted the fix/nginx-security-include branch February 13, 2025 14:09
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.

nginx is not setting security headers
2 participants