From 09df939574bf8a68f7b421f5a58eacfd0afe25b6 Mon Sep 17 00:00:00 2001 From: Ravi Lodhi Date: Wed, 20 Nov 2024 18:25:19 +0530 Subject: [PATCH] Improved: Added X-Frame-Options, CSP, strict-transport-security and Permissions-Policy headers in firebase config in context of soc2 compliance (#104). --- firebase.json | 62 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/firebase.json b/firebase.json index 6282c4c..b7c2d0f 100644 --- a/firebase.json +++ b/firebase.json @@ -11,8 +11,25 @@ "rewrites": [ { "source": "**", "destination": "/index.html" - } ] - + } ], + "headers": [ { + "source": "**", + "headers": [ { + "key": "X-Frame-Options", + "value": "SAMEORIGIN" + }, + { + "key": "Content-Security-Policy", + "value": "default-src 'self';font-src 'self' data: *;script-src 'self' 'unsafe-inline' 'unsafe-eval' fonts.googleapis.com;img-src 'self' 'unsafe-inline' *.shopify.com javascript: ;style-src 'self' 'unsafe-inline' *; connect-src 'self' *" + }, + { + "key": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + },{ + "key": "Permissions-Policy", + "value": "camera=self" + } ] + }] }, { "target": "dev", @@ -25,8 +42,25 @@ "rewrites": [ { "source": "**", "destination": "/index.html" - } ] - + } ], + "headers": [ { + "source": "**", + "headers": [ { + "key": "X-Frame-Options", + "value": "SAMEORIGIN" + }, + { + "key": "Content-Security-Policy", + "value": "default-src 'self';font-src 'self' data: *;script-src 'self' 'unsafe-inline' 'unsafe-eval' fonts.googleapis.com;img-src 'self' 'unsafe-inline' *.shopify.com javascript: ;style-src 'self' 'unsafe-inline' *; connect-src 'self' *" + }, + { + "key": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + },{ + "key": "Permissions-Policy", + "value": "camera=self" + } ] + }] }, { "target": "uat", @@ -39,7 +73,25 @@ "rewrites": [ { "source": "**", "destination": "/index.html" - } ] + } ], + "headers": [ { + "source": "**", + "headers": [ { + "key": "X-Frame-Options", + "value": "SAMEORIGIN" + }, + { + "key": "Content-Security-Policy", + "value": "default-src 'self';font-src 'self' data: *;script-src 'self' 'unsafe-inline' 'unsafe-eval' fonts.googleapis.com;img-src 'self' 'unsafe-inline' *.shopify.com javascript: ;style-src 'self' 'unsafe-inline' *; connect-src 'self' *" + }, + { + "key": "strict-transport-security", + "value": "max-age=31536000; includeSubDomains" + },{ + "key": "Permissions-Policy", + "value": "camera=self" + } ] + }] } ] }