Comments (4)
Let me try this out in my playground env
cc-lam wrote:
In my app, I have the following policy:
helmet.csp.policy
defaultPolicy:
"img-src" : ['*']
"style-src" : ["'self'", "'unsafe-inline'", "fonts.googleapis.com"]
"script-src" : ["'self'", "cdnjs.cloudflare.com", "login.persona.org",
"ajax.googleapis.com", "www.google-analytics.com"
http://www.google-analytics.com%22]This works well for all OS/browser combinations I'm testing, except
for mobile Safari on the iPad which refuses to load the script from
https://login.persona.org/include.jsThe persona script is the only one delivered through https protocol.
Maybe this has something to do with this ?—
Reply to this email directly or view it on GitHub
#8.
from helmet.
Adding the https in the policy seems to fix it:
"script-src" : ["'self'", "cdnjs.cloudflare.com", "https://login.persona.org", "ajax.googleapis.com", "www.google-analytics.com"]
Is this the correct way to do it ? More generally, should we always add the protocols in the policy ?
from helmet.
cool. that's what I was hoping to try out. I don't know if it's best
practice or required to always add protocols but I think it would be
once best interest with CSP to be as specific as possible. Leaves less
up to interpretation. ndm has this to say
https://twitter.com/ndm/status/348894065586225152
Still probably best to be specific imho.
cc-lam wrote:
Adding the https in the policy seems to fix it:
"script-src" : ["'self'", "cdnjs.cloudflare.com",
"https://login.persona.org", "ajax.googleapis.com",
"www.google-analytics.com" http://www.google-analytics.com%22]Is this the correct way to do it ? More generally, should we always
add the protocols in the policy ?—
Reply to this email directly or view it on GitHub
#8 (comment).
from helmet.
Thanks for the info.
from helmet.
Related Issues (20)
- helmet + sanitizeFilter HOT 1
- Require Node 18+ HOT 5
- Support `unsafe-none` in `helmet.crossOriginEmbedderPolicy`? HOT 1
- Typescript required versions HOT 2
- 7.1.0 Rollup error HOT 17
- Disable HSTS headers by default on localhost HOT 9
- Error "script-src-elem" is an invalid directive HOT 3
- 'self' and 'none' values lack quotes HOT 4
- swagger HOT 2
- Getting Name of Blocked Script? HOT 3
- Increase default Strict-Transport-Security maxAge to 1 year HOT 3
- remove block-all-mixed-content from helmet-csp default directives HOT 6
- helmet default directives doesnt match helmet-csp default directives HOT 3
- Strict-Transport-Security middleware should throw, not warn, when misspelling "includeSubDomains" option HOT 2
- Content-Security-Policy `getDefaultDirectives` should return a deep copy HOT 3
- csp header lack `script-src-elem` HOT 4
- [feature request] "simple allow everything" setting for development work? HOT 6
- Question: XSS HOT 3
- Request to add `Permissions-Policy` header HOT 2
- error is always undefined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from helmet.