π‘οΈ AWS CloudFront Web Distribution is not integrated with AWS WAFπ’
- Contextual name: π‘οΈ Web Distribution is not integrated with AWS WAFπ’
- ID:
/ce/ca/aws/cloudfront/distribution-waf-integration - Tags:
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
- Policy Type:
BEST_PRACTICE - Policy Categories:
SECURITY
Logicβ
- π§ prod.logic.yamlπ π’
- π AWS CloudFront Distribution
- π§ͺ test-data.json
Similar Policiesβ
- AWS Security Hub: [CloudFront.6] CloudFront distributions should have WAF enabled
- Cloud Conformity: CloudFront Integrated With WAF
Descriptionβ
Descriptionβ
This policy identifies AWS CloudFront Web Distributions that are not associated with an AWS WAF Classic or AWS WAF (WAF v2) web ACL.
All CloudFront web distributions should be integrated with AWS WAF to help protect against application-layer attacks that could compromise application security or impose unnecessary load on backend resources.
Rationaleβ
AWS WAF provides an additional layer of security by enabling fine-grained control over inbound web traffic through customizable rules that allow, block, or monitor requests. Without AWS WAF integration, CloudFront distributions are more susceptible to common web application attack vectors, including:
- SQL Injection: Attempts to manipulate backend databases through malicious query injection.
- Cross-Site Scripting (XSS): Injection of malicious scripts into web pages viewed by end users.
- Distributed Denial of Service (DDoS): High-volume illegitimate traffic intended to disrupt application availability.
- Malicious Bots: Automated scraping or scanning activity that can degrade performance and availability.
... see more
Remediationβ
Remediationβ
Associate an AWS WAF Web ACL with the CloudFront Distributionβ
To protect Amazon CloudFront distributions with AWS WAF, create and configure a web ACL and associate it with the target distribution.
From Command Lineβ
Create or identify an AWS WAF Web ACL
Ensure an appropriate web ACL exists with the required rule sets. This may include AWS Managed Rules, marketplace rule groups, or custom rules aligned with your organizationβs security policies.
Retrieve the current CloudFront distribution configuration and ETag
Download the existing distribution configuration and capture the associated
ETag, which is required to apply updates:aws cloudfront get-distribution-config \
--id {{distribution-id}} \
--query 'DistributionConfig' \
> {{distribution-config}}.json
ETAG=$(aws cloudfront get-distribution-config \
--id {{distribution-id}} \
--query 'ETag' \
--output text)Update the Web ACL association
Edit the downloaded
{{distribution-config}}.jsonfile and set theWebACLIdattribute:... see more