Skip to content

Commit

Permalink
Merge pull request #95 from aws-samples/fix-csp-media-directive
Browse files Browse the repository at this point in the history
Add alternate bucket url to CSP
  • Loading branch information
rstrahan authored Mar 5, 2022
2 parents 46c540c + 1f164e9 commit 4fd093d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pca-ui/cfn/lib/web.template
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ Resources:
Name: !Sub "${AWS::StackName}-SecurityHeaders"
SecurityHeadersConfig:
ContentSecurityPolicy:
ContentSecurityPolicy: !Sub "default-src 'none'; img-src 'self' https://${DataBucket}.s3.amazonaws.com data:; script-src 'self'; style-src 'self' 'unsafe-inline'; object-src 'none'; connect-src 'self' https://*.execute-api.${AWS::Region}.amazonaws.com https://*.auth.${AWS::Region}.amazoncognito.com; font-src data:; media-src https://${AudioBucket}.s3.amazonaws.com; manifest-src 'self';"
# Cover both S3 URL types for media-src entries as it
# varies by region
ContentSecurityPolicy: !Sub "default-src 'none'; img-src 'self' https://${DataBucket}.s3.amazonaws.com https://${DataBucket}.s3.${AWS::Region}.amazonaws.com data:; script-src 'self'; style-src 'self' 'unsafe-inline'; object-src 'none'; connect-src 'self' https://*.execute-api.${AWS::Region}.amazonaws.com https://*.auth.${AWS::Region}.amazoncognito.com; font-src data:; media-src https://${AudioBucket}.s3.amazonaws.com; manifest-src 'self';"
Override: True
ContentTypeOptions:
Override: True
Expand Down

0 comments on commit 4fd093d

Please sign in to comment.