Merge pull request #4025 from betagouv/enable-subdomains-csp-connectsrc

enable static + activate csp in production
This commit is contained in:
Keirua 2019-07-02 10:41:31 +02:00 committed by GitHub
commit 1fcc2fec6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -110,7 +110,7 @@ Rails.application.configure do
}
# The Content-Security-Policy is NOT in Report-Only mode
config.content_security_policy_report_only = true
config.content_security_policy_report_only = false
config.lograge.enabled = ENV['LOGRAGE_ENABLED'] == 'enabled'
end

View file

@ -14,7 +14,7 @@ Rails.application.config.content_security_policy do |policy|
# c'est trop compliqué pour être rectifié immédiatement (et sans valeur ajoutée:
# c'est hardcodé dans les vues, donc pas injectable).
policy.style_src :self, "*.crisp.chat", "crisp.chat", :unsafe_inline
policy.connect_src :self, "wss://*.crisp.chat"
policy.connect_src :self, "wss://*.crisp.chat", "*.demarches-simplifiees.fr"
# Pour tout le reste, par défaut on accepte uniquement ce qui vient de chez nous
# et dans la notification on inclue la source de l'erreur
policy.default_src :self, :data, :report_sample, "fonts.gstatic.com", "in-automate.sendinblue.com", "player.vimeo.com", "app.franceconnect.gouv.fr", "sentry.io", "static.demarches-simplifiees.fr", "*.crisp.chat", "crisp.chat", "*.sibautomation.com", "sibautomation.com", "data"