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

feat: add CSP header to all the pages #445

Merged
merged 6 commits into from
Aug 28, 2024
Merged

feat: add CSP header to all the pages #445

merged 6 commits into from
Aug 28, 2024

Conversation

DiogoSoaress
Copy link
Member

@DiogoSoaress DiogoSoaress commented Aug 23, 2024

What it solves

Adds an explicit Content Security Policy to the website pages

How this PR fixes it

Sets the Content Security Policy through a <meta> tag

I tried to keep the allowed src lists as restrictive as possible without braking anything or lose of functionality

Copy link

github-actions bot commented Aug 23, 2024

Branch preview

✅ Deployed successfully in branch deployment:

https://csp--homepage.review.5afe.dev

Copy link
Member

@schmanu schmanu left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Some rules are quite strict. If you experience that sometimes those id's or filenames change you could also allow the entire origin or the higher path as src.
e.g.
https://cdn.contentful.com/spaces/1i5gc724wjeu/
=>
https://cdn.contentful.com/spaces/

But if the ID is always fixed, being more strict is better :)

@DiogoSoaress
Copy link
Member Author

But if the ID is always fixed

Yes, in this case the Contentful space ID remains the same

@DiogoSoaress DiogoSoaress merged commit 2d198f3 into main Aug 28, 2024
4 checks passed
@DiogoSoaress DiogoSoaress deleted the csp branch August 28, 2024 09:40
@github-actions github-actions bot locked and limited conversation to collaborators Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants