Skip to content

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

@dalelane

Description

@dalelane

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions