π AWS CloudFront Web Distribution Default Root Object is not configured π’
- Contextual name: π Web Distribution Default Root Object is not configured π’
- ID:
/ce/ca/aws/cloudfront/distribution-default-root-object
- Located in: π AWS CloudFront
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
BEST_PRACTICE
- Policy Category:
SECURITY
Similar Policiesβ
- AWS Security Hub
- [[CloudFront.1] CloudFront distributions should have a default root object configured]([CloudFront.1] CloudFront distributions should have a default root object configured (https://docs.aws.amazon.com/securityhub/latest/userguide/cloudfront-controls.html#cloudfront-1)]
- Internal
dec-x-4f944d13
Similar Internal Rulesβ
Rule | Policies | Flags |
---|---|---|
βοΈ dec-x-4f944d13 | 1 |
Logicβ
- π§ prod.logic.yaml π’
Descriptionβ
Descriptionβ
Ensure that AWS CloudFront Web Distributions are configured with a Default Root Object.
A Default Root Object (for example
index.html
) is the object that CloudFront returns when a client requests the distributionβs root URL (e.g.,https://example.com/
) rather than specifying a particular object in the distribution (e.g.,https://www.example.com/product-description.html
).A Default Root Object is most appropriate when your distribution serves a website or static content entry point and you expect clients to access
/
directly. Common scenarios include:
- Static websites or landing pages, ensuring that
GET /
returns anindex.html
or equivalent landing page.- Documentation hubs or singleβpage apps.
Conversely, you typically omit a Default Root Object when:
- Your distribution fronts APIs or microservices and clients always request specific paths.
- Your origin itself (e.g., a dynamic web server behind an ALB) handles root requests.
- You rely on routing logic via Lambda@Edge, CloudFront Functions, or S3 websiteβendpoint errorβpage configurations.
... see more
Remediationβ
Remediationβ
From Command Lineβ
You can update the Default Root Object by using the
--default-root-object
flag:aws cloudfront update-distribution \
--id {{distribution-id}} \
--default-root-object {{index.html}}