You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Overview
It would be great if fullstack-serverless exposed an option, potentially called headers that would allow to set any custom headers for the static content using lambda@edge or some other solution.
I found it difficult to set any security headers since s3 bucket and cloudfront support very limited amount of headers. Specifically, almost none of the commonly used headers for security hardening like Strict Transport Security, Content-Security-Policy, X-Content-Type-Options, X-Frame-Options, X-XSS-Protection, Referrer-Policy (infosec.mozilla).
As of right now, one of the workarounds is to setup lambda@edge manually and map it to the cloudfront distribution created by the fullstack-serverless plugin. In addition, you will need to configure Basic Lambda Execution Policy allowing logs to be written to CloudWatch and Trust Relationship allowing Lambda and Lambda@Edge to assume the role. (configuring-x-frame-options-response-header-on-aws-cloudfront-and-s3).
The text was updated successfully, but these errors were encountered:
Overview
It would be great if
fullstack-serverless
exposed an option, potentially calledheaders
that would allow to set any custom headers for the static content usinglambda@edge
or some other solution.I found it difficult to set any security headers since s3 bucket and cloudfront support very limited amount of headers. Specifically, almost none of the commonly used headers for security hardening like
Strict Transport Security
,Content-Security-Policy
,X-Content-Type-Options
,X-Frame-Options
,X-XSS-Protection
,Referrer-Policy
(infosec.mozilla).Possible Solution with lambda@edge
Here is how the process works:
Edge function source
Reference
As of right now, one of the workarounds is to setup lambda@edge manually and map it to the cloudfront distribution created by the fullstack-serverless plugin. In addition, you will need to configure
Basic Lambda Execution Policy allowing logs to be written to CloudWatch
andTrust Relationship allowing Lambda and Lambda@Edge to assume the role
. (configuring-x-frame-options-response-header-on-aws-cloudfront-and-s3).The text was updated successfully, but these errors were encountered: