Skip to content

Replace SecureHeaders CSP tooling with built in Rails tooling#5757

Merged
jmhooper merged 43 commits intomainfrom
jmhooper-integrate-secure-headers
Jan 25, 2022
Merged

Replace SecureHeaders CSP tooling with built in Rails tooling#5757
jmhooper merged 43 commits intomainfrom
jmhooper-integrate-secure-headers

Conversation

@jmhooper
Copy link
Contributor

Why: So that we can use the baked in Rails behavior for managing the CSP.

This commit includes a feature flag so we can test this without potentially breaking the world.

**Why**: So that we can use the baked in Rails behavior for managing the CSP.
@jmhooper
Copy link
Contributor Author

Okay, I finally have everything passing and think this is finally ready to go

Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

default_csp_config[:script_src] = ["'self'", "'unsafe-eval'"] if !Rails.env.production?

if IdentityConfig.store.rails_mailer_previews_enabled
default_csp_config[:style_src] << "'unsafe-inline'"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oo thanks for cleaning up here

@jmhooper jmhooper merged commit d5c10f6 into main Jan 25, 2022
@jmhooper jmhooper deleted the jmhooper-integrate-secure-headers branch January 25, 2022 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants