-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Make autoCSP configurable #29615
Comments
/cc @aaronshim We talked a bit about configurability here and IIRC, the current goal is to keep things as simple and constrained as we can since the goal is to automate CSP generation, not just plumb through user-provided directives, which shifts the burden to the developer. I suspect directly managing something like |
Since you don't specify default-src all these are not-restricted anyhow. Anyway I think in the end I will add an extra logic that will grab tag from index.html, enrich it with extra options (specifically default-src 'none' for example ) and provide it via header. As multiple CSP policies might be confusing and absence of CSP header will be very annoying for auditors P.S. You implement a feature and unskilled developer will think it works out of the box and no additional actions required. While yes additional actions required. |
Had a brief discussion on this today and one option which came up was using multiple CSP headers. We can auto-generate One potential issue with that is |
Command
build
Description
Great to see autoCSP property cause looks like it's the only way to go with PWA.
Please could you make possible to add extra options to generated CSP ? I'd love to specify for example
default-src
,img-src
e.t.c.Describe the solution you'd like
Make it somehow configurable:
Describe alternatives you've considered
A header still will be needed for frame-ancestors to add (for example in nginx):
It works nicely in conjuction with autoCSP and I can even specify
The issue here is that if I add
default-src
Angular app will be broken because the least permissive policy (this one) wins.
To workaround it I will have to specify each case separately here
worker-src; frame-src
e.t.c but do not specifyscript-src
which will make it enormous and hard to maintain.I would love to specify them in index.html directly
The text was updated successfully, but these errors were encountered: