Skip to content

Commit 16e4f63

Browse files
fix: add Osano cookie consent CSP permissions (#463)
* fix: add Osano cookie consent CSP permissions - Add cmp.osano.com to connect-src for configuration API calls - Add cmp.osano.com to frame-src for consent UI iframe - Add www.googletagmanager.com to script-src for GTM integration Resolves CSP violations preventing Osano cookie consent from functioning properly. Signed-off-by: ahmedomosanya <[email protected]> * fix: Add Google Analytics & DoubleClick to connect-src CSP Add Google Analytics and DoubleClick domains to connect-src directive to allow Osano and GTM scripts to send analytics beacons: - www.google-analytics.com - Google Analytics beacons - analytics.google.com - Google Analytics 4 - www.googletagmanager.com - GTM fetch requests - googleads.g.doubleclick.net - DoubleClick advertising - stats.g.doubleclick.net - DoubleClick stats Addresses CodeRabbit review feedback for complete Osano/GTM integration. Signed-off-by: ahmedomosanya <[email protected]> * fix: remove DoubleClick advertising domain from CSP connect-src - Remove https://googleads.g.doubleclick.net from allowed connect sources - Keep https://stats.g.doubleclick.net for analytics functionality - Improves security by reducing CSP attack surface --------- Signed-off-by: ahmedomosanya <[email protected]>
1 parent a3713dd commit 16e4f63

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

edge/security-headers.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ function generateCSP(env, isDevServer) {
4343
'https://api.lfcla.dev.platform.linuxfoundation.org/',
4444
'https://easycla.dev.communitybridge.org/',
4545
'https://easycla.lfx.linuxfoundation.org/',
46-
'https://contributor.easycla.lfx.linuxfoundation.org/'
46+
'https://contributor.easycla.lfx.linuxfoundation.org/',
47+
'https://cmp.osano.com', // Cookie consent management
48+
'https://www.google-analytics.com', // Google Analytics beacons
49+
'https://analytics.google.com', // Google Analytics 4
50+
'https://www.googletagmanager.com', // GTM fetch requests
51+
'https://stats.g.doubleclick.net' // DoubleClick stats
4752
];
4853
let scriptSources = [SELF, UNSAFE_EVAL, UNSAFE_INLINE,
4954
'https://cdn.dev.platform.linuxfoundation.org/lfx-header-v2.js',
@@ -54,7 +59,8 @@ function generateCSP(env, isDevServer) {
5459
'https://cdn.dev.platform.linuxfoundation.org/lfx-footer-no-zone.js',
5560
'https://cdn.staging.platform.linuxfoundation.org/lfx-footer-no-zone.js',
5661
'https://cdn.platform.linuxfoundation.org/lfx-footer-no-zone.js',
57-
'https://cmp.osano.com' // Cookie consent
62+
'https://cmp.osano.com', // Cookie consent
63+
'https://www.googletagmanager.com' // Google Tag Manager for Osano
5864
];
5965

6066
const styleSources = [SELF, UNSAFE_INLINE, 'https://use.fontawesome.com/', 'https://communitybridge.org/'];
@@ -106,7 +112,8 @@ function generateCSP(env, isDevServer) {
106112
'https://linuxfoundation-dev.auth0.com',
107113
'https://linuxfoundation-staging.auth0.com',
108114
'https://linuxfoundation.auth0.com',
109-
'https://sso.linuxfoundation.org/'
115+
'https://sso.linuxfoundation.org/',
116+
'https://cmp.osano.com' // Cookie consent UI iframe
110117
],
111118
'child-src': [],
112119
'media-src': [],

0 commit comments

Comments
 (0)