Question 1,587 of 1,738
Data ProtectionmediumMultiple ChoiceObjective-mapped

Quick Answer

The correct answer is to configure CloudFront to add a custom header to requests and then restrict the ALB’s security group to only allow traffic from CloudFront’s IP addresses that contains that header. This works because security groups filter at the network and transport layers based on IP, port, and protocol, but they cannot inspect HTTP headers; however, by combining an IP-based allowlist with a custom header requirement enforced at the application layer—typically via an ALB rule that checks for the header—you create a two-factor network-level gate. On the AWS Certified Security Specialty SCS-C02 exam, this scenario tests your understanding of defense-in-depth and the limitations of security groups versus web application firewalls; a common trap is confusing security groups with WAF rules or NACLs, which cannot perform header inspection. Remember the memory tip: “Header plus IP, direct access you’ll skip”—CloudFront adds the secret header, and the ALB only accepts traffic that knows the password.

SCS-C02 Data Protection Practice Question

This SCS-C02 practice question tests your understanding of data protection. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A company uses AWS Shield Advanced to protect its web application against DDoS attacks. The application runs behind an Application Load Balancer (ALB) and uses Amazon CloudFront as a CDN. The security team notices that some requests are bypassing CloudFront and hitting the ALB directly. They want to ensure that all traffic goes through CloudFront to benefit from DDoS protection and to enforce encryption in transit. The ALB has a public DNS name and is accessible from the internet. What should the security team do to restrict direct access to the ALB while allowing CloudFront traffic?

Question 1mediummultiple choice
Read the full DNS explanation →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Configure CloudFront to add a custom header to requests, and configure the ALB's security group to allow traffic only from CloudFront's IP addresses and that contains the custom header.

Option A is correct because CloudFront can be configured to add a custom header, and the ALB's security group can be set to allow traffic only if that header is present, preventing direct access. Option B is wrong because security groups do not support filtering by header values; they filter by IP, port, and protocol. Option C is wrong because NACLs are stateless and do not support header inspection. Option D is wrong because WAF rules inspect HTTP requests but are not designed to block direct access at the network level; also, WAF is typically used with CloudFront or ALB, but not to enforce CloudFront-only access.

Key principle: NAT direction and interface roles matter as much as the IP address mapping. Inside/outside designation controls which traffic is translated.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use a network ACL to restrict inbound traffic to only CloudFront's IP addresses.

    Why it's wrong here

    NACLs are stateless and cannot inspect headers; they also require rules for return traffic.

  • Configure CloudFront to add a custom header to requests, and configure the ALB's security group to allow traffic only from CloudFront's IP addresses and that contains the custom header.

    Why this is correct

    Security groups can allow traffic based on source IP, and CloudFront provides a list of its IP addresses. Adding a custom header provides an additional layer of verification.

    Related concept

    Static NAT maps one inside address to one outside address.

  • Deploy AWS WAF on the ALB with a rule that blocks requests that do not originate from CloudFront.

    Why it's wrong here

    WAF rules can block requests based on headers, but the ALB is still publicly accessible; the WAF rule would not prevent direct connections at the network level.

  • Create a security group rule that allows traffic only from CloudFront's IP addresses and denies all other traffic.

    Why it's wrong here

    This would block direct access, but without the custom header, it is still possible for spoofed requests to appear from CloudFront IPs if the attacker knows them.

Common exam traps

Common exam trap: NAT rules depend on direction and matching traffic

NAT is not only about the public address. The inside/outside interface roles and the ACL or rule that matches traffic are just as important.

Detailed technical explanation

How to think about this question

NAT questions usually test address translation, overload/PAT behaviour, static mappings and whether the right traffic is being translated. Read the interface direction and address terms carefully.

KKey Concepts to Remember

  • Static NAT maps one inside address to one outside address.
  • PAT allows many inside hosts to share one public address using ports.
  • Inside local and inside global describe the private and translated addresses.
  • NAT ACLs identify traffic for translation, not always security filtering.

TExam Day Tips

  • Identify inside and outside interfaces first.
  • Check whether the scenario needs static NAT, dynamic NAT or PAT.
  • Do not confuse NAT matching ACLs with normal packet-filtering intent.

Key takeaway

NAT direction and interface roles matter as much as the IP address mapping. Inside/outside designation controls which traffic is translated.

Real-world example

How this comes up in practice

A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.

What to study next

Got this wrong? Here's your next step.

Review the four NAT address types (inside local, inside global, outside local, outside global), PAT port overload, and static vs dynamic NAT use cases. Then practise related SCS-C02 NAT questions on configuration and troubleshooting.

Related practice questions

Related SCS-C02 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free SCS-C02 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this SCS-C02 question test?

Data Protection — This question tests Data Protection — Static NAT maps one inside address to one outside address..

What is the correct answer to this question?

The correct answer is: Configure CloudFront to add a custom header to requests, and configure the ALB's security group to allow traffic only from CloudFront's IP addresses and that contains the custom header. — Option A is correct because CloudFront can be configured to add a custom header, and the ALB's security group can be set to allow traffic only if that header is present, preventing direct access. Option B is wrong because security groups do not support filtering by header values; they filter by IP, port, and protocol. Option C is wrong because NACLs are stateless and do not support header inspection. Option D is wrong because WAF rules inspect HTTP requests but are not designed to block direct access at the network level; also, WAF is typically used with CloudFront or ALB, but not to enforce CloudFront-only access.

What should I do if I get this SCS-C02 question wrong?

Review the four NAT address types (inside local, inside global, outside local, outside global), PAT port overload, and static vs dynamic NAT use cases. Then practise related SCS-C02 NAT questions on configuration and troubleshooting.

What is the key concept behind this question?

Static NAT maps one inside address to one outside address.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Last reviewed: Jun 20, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This SCS-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SCS-C02 exam.