-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Improve default Content-Security-Policy value #224
Conversation
In all honesty from a security perspective the CSP should be deny everything for all directives by default. Then whitelist per directive as needed. That's the most secure and least shoot your security in the foot scenario by accident. |
Thanks for your comment, @quantumpacket! 👍 |
@LeoColomb these would be more restrictive baseline CSPs templates. This way the application has a secure starting point, and an admin can then loosen it if needed. CSP2:
CSP3: (some experimental directives, browser support will vary)
|
Thanks @quantumpacket. |
Unfortunately there is currently no way (maybe in the future) for this CSP directive to provide any granular control by saying "hey! require SRI for only this one script". It's all or nothing, and I think this is why the directive has seen limited usage amongst developers. (You can still opt-in for SRI matching by setting the So I'd say no to The
This is a tad bit confusing but it seems to suggest that If I ( Personally I don't think that's a good default because I'd imagine the majority of website owners do not care for, or want that type of restriction (maybe something an advertiser would want to use). I'd even go as far as to say that such a behavior (navigation blocking) doesn't match users expectations of how the web works. The directive is under development still: I've addressed my approach to most of the other directives that you mentioned in h5bp/server-configs-apache#181 (comment). |
* 'master' of github.com:h5bp/server-configs-nginx: (92 commits) Additional compression method added for gzip (h5bp#236) Bump server-config-test to 1.2.1 Switch tertiary DNS used for OCSP checking to OpenDNS (h5bp#235) Revert "Drop Cache-Control: no-transform usage" Release v3.1.0 Fix CHANGELOG formatting Use generic `$host` instead of host name Pre-compressed content usage config files Fix rebase artifacts Documentation formatting and reviewing (h5bp#232) Fix 304 responses Cache-control override Fix dropped Cache-Control: no-transform usage for SVGZ Compression Bump server-configs-test to v1.1.0 Improve wording and file headers Drop Cache-Control: no-transform usage Add Google Public DNS IPv6 and Cloudflare DNS IP addresses to `resolver` (h5bp#229) Fix misc typos in comments (h5bp#228) Update README.md Fix typo in example conf (h5bp#226) Improve default Content-Security-Policy value (h5bp#224) ...
See h5bp/server-configs-apache#181