Question 221 · 732 in bank
A company is using an Amazon CloudFront distribution to deliver content from two origins. One origin is a dynamic application that is hosted on Amazon EC2 instances. The other origin is an Amazon S3 bucket for static assets. A security analysis shows that HTTPS responses from the application do not comply with a security requirement to provide an X-Frame-Options HTTP header to prevent frame-related cross-site scripting attacks. A security engineer must make the full stack compliant by adding the missing HTTP header to the responses. Which solution will meet these requirements?
Show answer
Answer: A
Explanation
The best solution to meet the requirement of adding the X-Frame-Options HTTP header to the responses is: A. Create a Lambda@Edge function. Include code to add the X-Frame-Options header to the response. Configure the function to run in response to the CloudFront origin response event. This approach ensures that the header is added to all responses, regardless of the origin (EC2 or S3), and it does not require changes to the application code or the CloudFront distribution settings
Source: Adapted from community discussion — IPLogic