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

Update CSP to move upgrade-insecure-requests to enforced policy #15782

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

robhudson
Copy link
Member

One-line summary

This PR adds the upgrade-insecure-requests directive to our Content Security Policy (CSP). This directive automatically upgrades HTTP requests to HTTPS, improving security by ensuring all content is loaded over a secure connection.

This has been in our report-only policy with no issue detected.

Issue / Bugzilla link

#11943

Testing

@robhudson robhudson requested a review from a team as a code owner December 19, 2024 20:08
@robhudson robhudson merged commit 041814f into main Dec 19, 2024
3 checks passed
@robhudson robhudson deleted the enforce-upgrade-insecure-requests branch December 19, 2024 20:43
@janbrasna
Copy link
Contributor

janbrasna commented Dec 22, 2024

Investigating if this can interfere with localhost development which is run over http://… (EDIT: ah so there's implementation differences as the spec is somewhat wild — I'll follow up in the tracking issue: …)

@@ -110,6 +110,7 @@
"connect-src": list(set(_csp_default_src + _csp_connect_src)),
# support older browsers (mainly Safari)
"frame-src": _csp_child_src,
"upgrade-insecure-requests": True,
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if there is a good condition to skip this in local dev (which if DEV is not, as that is used in demo/dev deployments too…), or if this has to be kept unconditionally.

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.

3 participants