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

Fix CSP so that the policy can be enforced and not just report only #346

Open
dalelane opened this issue Nov 5, 2020 · 3 comments
Open

Comments

@dalelane
Copy link
Member

dalelane commented Nov 5, 2020

image

The CSP policy currently used is not correct.

export const CSP_DIRECTIVES = {
defaultSrc: ["'self'", "'unsafe-inline'",
'http://cdn.auth0.com',
'https://cdn.auth0.com',
'https://cdn.eu.auth0.com',
'https://unpkg.com',
'https://storage.googleapis.com',
'https://www.google-analytics.com',
],
styleSrc: ["'self'", "'unsafe-inline'",
'https://ton.twimg.com',
'https://platform.twitter.com',
],
scriptSrc: ["'self'", "'unsafe-inline'", "'unsafe-eval'",
'http://cdn.auth0.com',
'https://cdn.auth0.com',
'https://cdn.eu.auth0.com',
'https://unpkg.com',
'https://storage.googleapis.com',
'http://embed-assets.wakelet.com',
'http://platform.twitter.com',
'https://cdn.syndication.twimg.com',
'https://www.youtube.com',
'https://player.vimeo.com',
'https://www.google-analytics.com',
'https://www.googletagmanager.com',
'https://browser.sentry-cdn.com',
'https://d3js.org',
],
frameSrc: ["'self'",
'http://embed.wakelet.com',
'https://syndication.twitter.com',
'https://platform.twitter.com',
'https://www.youtube.com',
'https://player.vimeo.com'
],
imgSrc: ["'self'",
'https://auth0.com',
'http://cdn.auth0.com',
'https://cdn.auth0.com',
'https://cdn.eu.auth0.com',
'https://pbs.twimg.com',
'https://ton.twimg.com',
'https://platform.twitter.com',
'https://syndication.twitter.com',
'data:',
],
};

This was brought to light after a recent version update of the helmet module. To avoid breakages, the CSP was switched to report-only as a temporary workaround.

contentSecurityPolicy: {
// TODO : https://github.com/IBM/taxinomitis/issues/346 will remove this
reportOnly : true,

The CSP needs to be fixed so that the enforcement can be re-enabled.

@dalelane dalelane changed the title Fix CSP policy so that the policy can be enforced and not just report only Fix CSP so that the policy can be enforced and not just report only Nov 5, 2020
dalelane added a commit that referenced this issue Nov 25, 2020
@dalelane
Copy link
Member Author

styleSrc: ["'self'",
// TODO : https://github.com/IBM/taxinomitis/issues/346 should remove this
"'unsafe-inline'",

@dalelane
Copy link
Member Author

scriptSrc: ["'self'",
// TODO : https://github.com/IBM/taxinomitis/issues/346 should investigate these
"'unsafe-eval'",
"'unsafe-inline'",

@dalelane
Copy link
Member Author

Some of the errors that these are hiding are from angular - see https://docs.angularjs.org/api/ng/directive/ngCsp for details

dalelane added a commit that referenced this issue Dec 4, 2020
Contributes to: #346

Signed-off-by: Dale Lane <[email protected]>
dalelane added a commit that referenced this issue Dec 11, 2020
Contributes to: #346

Signed-off-by: Dale Lane <[email protected]>
dalelane added a commit that referenced this issue Dec 12, 2020
Incremental improvements towards being able to enforce CSP
properly.

Contributes to: #346

Signed-off-by: Dale Lane <[email protected]>
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

No branches or pull requests

1 participant