Description
Associating an AWS WAF web ACL with a CloudFront distribution lets it inspect web requests at the edge and control them according to configured rules and actions. A distribution without an associated web ACL does not receive this WAF protection layer.
Association alone does not block every attack. Rule scope and actions matter, and the Count action records requests without blocking them. WAF does not replace application authentication, input validation or vulnerability fixes.
Potential impact
- An opportunity to limit malicious requests or abnormal request volumes at the edge may be lost.
- An application vulnerability could be exploited without WAF rules that could mitigate the attack.
Remediation
- Prepare an AWS WAF web ACL with
CLOUDFRONTscope and setdistributionConfig.webACLIDto its ARN inus-east-1. - Configure managed rules and rate limits appropriate for the service. Use Count mode and logs to assess their effects before enabling the required blocking actions.
- Verify that the web ACL is associated with the actual distribution, and test its handling of malicious and legitimate requests.
Examples
These partial distribution examples compare only the web ACL association. Required settings such as certificates and origins are omitted. Replace the example ARN with an actual web ACL ARN for CloudFront.
Before
apiVersion: cloudfront.aws.crossplane.io/v1alpha1
kind: Distribution
spec:
forProvider:
distributionConfig:
enabled: true
viewerCertificate:
minimumProtocolVersion: TLSv1.2_2018
This definition has no WAF web ACL association. Review the required protection together with the application's other security controls.
After
apiVersion: cloudfront.aws.crossplane.io/v1alpha1
kind: Distribution
spec:
forProvider:
distributionConfig:
enabled: true
viewerCertificate:
minimumProtocolVersion: TLSv1.2_2018
webACLID: arn:aws:wafv2:us-east-1:123456789012:global/webacl/example/473e64fd-f30b-4765-81a0-62ad96dd167a
The AWS WAF web ACL is associated by ARN. Which requests are allowed or blocked depends on that web ACL's actual rules and actions.