Skip to content

Commit

Permalink
Add mapcreator and reuters CSP headers (#12116)
Browse files Browse the repository at this point in the history
  • Loading branch information
amoore108 authored Oct 30, 2024
1 parent 46b9938 commit 39bcd02
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/server/utilities/cspHeader/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ const directives = {
'https://www.facebook.com', // Social Embeds, <amp-facebook />
'https://*.ampproject.net', // Social Embeds
'https://www.riddle.com', // STY Includes
'https://*.mapcreator.io', // Election includes
'https://*.thomsonreuters.com', // Election includes
...advertisingDirectives.frameSrc,
"'self'",
],
Expand All @@ -77,6 +79,8 @@ const directives = {
'https://flo.uri.sh', // STY includes
'https://www.riddle.com', // STY Includes
'https://public.flourish.studio', // Flourish embeds
'https://*.mapcreator.io', // Election includes
'https://*.thomsonreuters.com', // Election includes
...advertisingDirectives.frameSrc,
"'self'",
],
Expand All @@ -89,6 +93,8 @@ const directives = {
'https://www.facebook.com', // Social Embeds, <amp-facebook />
'https://*.ampproject.net', // Social Embeds
'https://www.riddle.com', // STY Includes
'https://*.mapcreator.io', // Election includes
'https://*.thomsonreuters.com', // Election includes
...advertisingDirectives.frameSrc,
"'self'",
],
Expand All @@ -107,6 +113,8 @@ const directives = {
'https://flo.uri.sh', // STY includes
'https://www.riddle.com', // STY Includes
'https://public.flourish.studio', // Flourish embeds
'https://*.mapcreator.io', // Election includes
'https://*.thomsonreuters.com', // Election includes
...advertisingDirectives.frameSrc,
"'self'",
],
Expand Down Expand Up @@ -177,6 +185,8 @@ const directives = {
'https://cdn.ampproject.org',
'https://*.chartbeat.com',
'https://*.twitter.com', // Social Embeds, <amp-twitter />
'https://*.mapcreator.io', // Election includes
'https://*.thomsonreuters.com', // Election includes
"'self'",
"'unsafe-inline'",
],
Expand All @@ -194,6 +204,8 @@ const directives = {
'https://*.twimg.com', // Social Embeds
'https://public.flourish.studio', // STY includes
'https://www.riddle.com',
'https://*.mapcreator.io', // Election includes
'https://*.thomsonreuters.com', // Election includes
...advertisingDirectives.scriptSrc,
"'self'",
"'unsafe-inline'",
Expand All @@ -203,6 +215,8 @@ const directives = {
'https://cdn.ampproject.org',
'https://*.chartbeat.com',
'https://*.twitter.com', // Social Embeds, <amp-twitter />
'https://*.mapcreator.io', // Election includes
'https://*.thomsonreuters.com', // Election includes
"'self'",
"'unsafe-inline'",
],
Expand All @@ -222,6 +236,8 @@ const directives = {
'https://*.twimg.com', // Social Embeds
'https://public.flourish.studio', // STY includes
'https://www.riddle.com',
'https://*.mapcreator.io', // Election includes
'https://*.thomsonreuters.com', // Election includes
...advertisingDirectives.scriptSrc,
"'self'",
"'unsafe-inline'",
Expand Down
16 changes: 16 additions & 0 deletions src/server/utilities/cspHeader/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ describe('cspHeader', () => {
'https://*.googleadservices.com',
'https://*.amazon-adsystem.com',
'https://*.teads.tv',
'https://*.mapcreator.io',
'https://*.thomsonreuters.com',
"'self'",
].sort(),
imgSrcExpectation: [
Expand Down Expand Up @@ -106,6 +108,8 @@ describe('cspHeader', () => {
'https://cdn.ampproject.org',
'https://*.chartbeat.com',
'https://*.twitter.com',
'https://*.mapcreator.io',
'https://*.thomsonreuters.com',
"'self'",
"'unsafe-inline'",
].sort(),
Expand Down Expand Up @@ -154,6 +158,8 @@ describe('cspHeader', () => {
'https://*.googleadservices.com',
'https://*.amazon-adsystem.com',
'https://*.teads.tv',
'https://*.mapcreator.io',
'https://*.thomsonreuters.com',
"'self'",
].sort(),
imgSrcExpectation: [
Expand Down Expand Up @@ -209,6 +215,8 @@ describe('cspHeader', () => {
'https://*.xx.fbcdn.net',
'https://*.amazon-adsystem.com',
'https://*.teads.tv',
'https://*.mapcreator.io',
'https://*.thomsonreuters.com',
...advertisingServiceCountryDomains,
"'self'",
"'unsafe-inline'",
Expand Down Expand Up @@ -255,6 +263,8 @@ describe('cspHeader', () => {
'https://*.googleadservices.com',
'https://*.amazon-adsystem.com',
'https://*.teads.tv',
'https://*.mapcreator.io',
'https://*.thomsonreuters.com',
"'self'",
].sort(),
imgSrcExpectation: [
Expand Down Expand Up @@ -288,6 +298,8 @@ describe('cspHeader', () => {
'https://cdn.ampproject.org',
'https://*.chartbeat.com',
'https://*.twitter.com',
'https://*.mapcreator.io',
'https://*.thomsonreuters.com',
"'self'",
"'unsafe-inline'",
].sort(),
Expand Down Expand Up @@ -336,6 +348,8 @@ describe('cspHeader', () => {
'https://*.googleadservices.com',
'https://*.amazon-adsystem.com',
'https://*.teads.tv',
'https://*.mapcreator.io',
'https://*.thomsonreuters.com',
"'self'",
].sort(),
imgSrcExpectation: [
Expand Down Expand Up @@ -395,6 +409,8 @@ describe('cspHeader', () => {
'https://*.webcontentassessor.com',
'https://*.amazon-adsystem.com',
'https://*.teads.tv',
'https://*.mapcreator.io',
'https://*.thomsonreuters.com',
...advertisingServiceCountryDomains,
"'self'",
"'unsafe-inline'",
Expand Down

0 comments on commit 39bcd02

Please sign in to comment.