nerdexam
Amazon

SCS-C02 · Question #206

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…

The correct answer is A. Create a Lambda@Edge function. Include code to add the X-Frame-Options header to the. It allows the security engineer to add the X-Frame-Options header to the HTTPS responses from the application origin without modifying the origin itself. A Lambda@Edge function is a Lambda function that runs in response to CloudFront events, such as viewer request, origin…

Submitted by sofia.br· Mar 6, 2026Infrastructure Security

Question

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 ipake the full stack compliant by adding the missing HTTP header to the responses. Which solution will meet these requirements?

Options

  • ACreate a Lambda@Edge function. Include code to add the X-Frame-Options header to the
  • BCreate a Lambda@Edge function. Include code to add the X-Frame-Options header to the
  • CUpdate the CloudFront distribution by adding X-Frame-Options to custom headers in the origin
  • DCustomize the EC2 hosted application to add the X-Frame-Options header to the responses that

How the community answered

(35 responses)
  • A
    74% (26)
  • B
    3% (1)
  • C
    14% (5)
  • D
    9% (3)

Explanation

It allows the security engineer to add the X-Frame-Options header to the HTTPS responses from the application origin without modifying the origin itself. A Lambda@Edge function is a Lambda function that runs in response to CloudFront events, such as viewer request, origin request, origin response, or viewer response. By configuring the function to run in response to the origin response event, the security engineer can modify the response headers that CloudFront receives from the origin before sending them to the viewer. The function can include code to add the X- Frame-Options header with the desired value, such as DENY or SAMEORIGIN, to prevent frame- related cross-site scripting attacks.

Topics

#Lambda@Edge#CloudFront#X-Frame-Options#HTTP security headers

Community Discussion

No community discussion yet for this question.

Full SCS-C02 Practice