Skip to content

Commit

Permalink
MAN-256 csr connection fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
neil-mills committed Jan 14, 2025
1 parent 0f8173e commit d62e8b5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions server/middleware/setUpWebSecurity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function setUpWebSecurity(): Router {
helmet({
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
defaultSrc: ["'self'", 'js.monitor.azure.com', '*.applicationinsights.azure.com/v2/track'],
// This nonce allows us to use scripts with the use of the `cspNonce` local, e.g (in a Nunjucks template):
// <script nonce="{{ cspNonce }}">
// or
Expand All @@ -26,9 +26,15 @@ export default function setUpWebSecurity(): Router {
// page by an attacker.
scriptSrc: [
"'self' https://browser.sentry-cdn.com https://js.sentry-cdn.com",
'js.monitor.azure.com',
'*.applicationinsights.azure.com/v2/track',
(_req: Request, res: Response) => `'nonce-${res.locals.cspNonce}'`,
],
connectSrc: ["'self' https://*.sentry.io"],
connectSrc: [
"'self' https://*.sentry.io",
'js.monitor.azure.com',
'*.applicationinsights.azure.com/v2/track',
],
workerSrc: ["'self' blob:"],
styleSrc: ["'self'", (_req: Request, res: Response) => `'nonce-${res.locals.cspNonce}'`],
fontSrc: ["'self'"],
Expand Down

0 comments on commit d62e8b5

Please sign in to comment.