An enterprise runs a public-facing web application behind an Application Load Balancer (ALB) in a production VPC in Account A. To strengthen network and application security, the enterprise deploys an Amazon CloudFront distribution in front of the ALB. An AWS WAF WebACL is associated with the CloudFront distribution to inspect and filter inbound traffic. During a security audit, the team discovers that the ALB's DNS name is publicly resolvable, allowing malicious traffic to bypass the CloudFront distribution and target the ALB directly. The solution must ensure that only requests routed through CloudFront are accepted by the ALB. The team wants to secure the custom header value used for validation by storing it as a secret in AWS Secrets Manager in a centralized Security Account (Account B) and allowing Account A's resources to retrieve it. Which of the following is the most secure and operationally efficient configuration to prevent direct public access to the ALB while ensuring CloudFront can successfully forward requests?
- Configure CloudFront to inject a custom HTTP header containing a secret value. Set the ALB listener rules to forward traffic only when this header is present and matches the secret value, and restrict the ALB's security group to allow inbound traffic only from CloudFront IP ranges using the AWS-managed prefix list. Store the secret in AWS Secrets Manager in Account B, encrypted with a Customer Managed Key (CMK), and configure its key policy to allow cross-account access from Account A.Cevap
- BConfigure CloudFront to inject a custom HTTP header containing a secret value. Set the ALB listener rules to forward traffic only when this header is present and matches the secret value, and restrict the ALB's security group to allow inbound traffic only from CloudFront IP ranges using the AWS-managed prefix list. Store the secret in AWS Secrets Manager in Account B, encrypted with the default AWS-managed KMS key for Secrets Manager, and configure a cross-account IAM policy to allow Account A's resources to retrieve and decrypt the secret.
- CConfigure CloudFront to inject a custom HTTP header containing a secret value. Set the ALB listener rules to forward traffic only when this header is present and matches the secret value, and attach a Service Control Policy (SCP) to the Root OU in AWS Organizations that explicitly allows traffic to the ALB only if the request originates from CloudFront, assuming this SCP automatically overrides local security group restrictions.
- DAssociate a second AWS WAF WebACL directly with the ALB instead of modifying the security group. In this WebACL, configure the default action to Allow, and place a rule that blocks all traffic not originating from CloudFront IPs at the end of the rule evaluation list, following other application-specific rules, to ensure CloudFront requests are not inadvertently blocked.