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

A few tweaks to our report-only CSP header #2955

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions config/initializers/content_security_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Rails.application.config.content_security_policy do |policy|
policy.default_src :self
policy.font_src :self, "https://www2.buildkiteassets.com/"
policy.object_src :none, "https://beacon-v2.helpscout.net"
policy.object_src "https://beacon-v2.helpscout.net"
policy.style_src :self, :unsafe_inline, "https://beacon-v2.helpscout.net"

policy.img_src(
Expand All @@ -44,6 +44,8 @@
policy.script_src *policy.script_src, :unsafe_eval, "http://#{ ViteRuby.config.host_with_port }" if Rails.env.development?

policy.connect_src(
"https://www.google-analytics.com",

# allow AJAX queries against our search vendor
"https://#{ENV['ALGOLIA_APP_ID']}-dsn.algolia.net",
"https://#{ENV['ALGOLIA_APP_ID']}-1.algolianet.com",
Expand All @@ -52,14 +54,22 @@

"https://cdn.segment.com/",
"https://api.segment.io/",

# We have Datadog Real User Monitoring enabled
"https://rum.browser-intake-datadoghq.com",

# For collecting feedback from customers
"https://emojicom.io/",

# helpscout beacon sends data to two places
"https://beacon-v2.helpscout.net",
"https://rum.browser-intake-datadoghq.com"
"https://d3hb14vkzrxvla.cloudfront.net",
)

# Allow @vite/client to hot reload changes in development
policy.connect_src *policy.connect_src, "ws://#{ ViteRuby.config.host_with_port }" if Rails.env.development?

# For collecting feedback from customers
policy.frame_src(
"https://cdn.emojicom.io/"
)
Expand Down
Loading