Skip to main content

🧠 AWS CloudFront Web Distribution Cache Behaviors allow unencrypted traffic - prod.logic.yaml 🟒

Flags​

Input Type​

TypeAPI NameExtractsExtract FilesLogic Files
πŸ”’πŸ“• AWS CloudFront DistributionCA10__CaAwsDistribution__c417

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-07-08T23:23:04.898079083Z Open

ResultIdCondition IndexCondition TextRuntime Error
🟒test1βœ”οΈ 99βœ”οΈ isDisappeared(CA10__disappearanceTime__c)βœ”οΈ null
🟒test2βœ”οΈ 199βœ”οΈ not(setOfText(['caWebDistribution']).contains(RecordType.DeveloperName))βœ”οΈ null
🟒test3βœ”οΈ 499βœ”οΈ extract('CA10__defaultCacheBehavior__r.CA10__viewerProtocolPolicy__c') == 'allow-all'βœ”οΈ null
🟒test4βœ”οΈ 599βœ”οΈ CA10__AWS_CloudFront_Cache_Behaviors__r.has(INCOMPLIANT)βœ”οΈ null
🟒test5βœ”οΈ 600βœ”οΈ otherwiseβœ”οΈ null
🟒test6βœ”οΈ 399βœ”οΈ isEmptyLookup('CA10__defaultCacheBehavior__r')βœ”οΈ null
🟒test7βœ”οΈ 299βœ”οΈ isEmptyLookup('CA10__defaultCacheBehavior__r') && CA10__AWS_CloudFront_Cache_Behaviors__r.has(INCOMPLIANT)βœ”οΈ null

Generation​

FileMD5
Open/ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/policy.yaml816E8C64A79382910AD17055ED1280E5
Open/ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/prod.logic.yaml6FEE6C186CCD360E21878DF1D14CBA53
Open/ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/test-data.jsonE08B0BBD7FB6004988EB6E8321E6CF4A
Open/types/CA10__CaAwsCacheBehavior2__c/object.extracts.yaml9FCFD18140FB8C38265EB37003668054

Generate FULL script​

java -jar repo-manager.jar policies generate FULL /ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/prod.logic.yaml

Generate DEBUG script​

java -jar repo-manager.jar policies generate DEBUG /ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/prod.logic.yaml

Generate CAPTURE_TEST_DATA script​

java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/prod.logic.yaml

Generate TESTS script​

java -jar repo-manager.jar policies generate TESTS /ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/prod.logic.yaml

Execute tests​

java -jar repo-manager.jar policies test /ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/prod.logic.yaml

Content​

Open File

---
inputType: "CA10__CaAwsDistribution__c"
importExtracts:
- file: "/types/CA10__CaAwsCacheBehavior2__c/object.extracts.yaml"
testData:
- file: "test-data.json"
recordTypes:
- "caWebDistribution"
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "At least one CloudFront Distribution cache behavior allows unencrypted HTTP traffic."
remediationMessage: "Modify the Viewer Protocol Policy for all cache behaviors to either Redirect HTTP to HTTPS or HTTPS Only."
check:
AND:
args:
- IS_EMPTY_LOOKUP: "CA10__defaultCacheBehavior__r"
- RELATED_LIST_HAS:
status: "INCOMPLIANT"
relationshipName: "CA10__AWS_CloudFront_Cache_Behaviors__r"
- status: "UNDETERMINED"
currentStateMessage: "The default CloudFront Distribution cache behavior is not present in the CMDB."
check:
IS_EMPTY_LOOKUP: "CA10__defaultCacheBehavior__r"
- status: "INCOMPLIANT"
currentStateMessage: "The default CloudFront Distribution cache behavior allows unencrypted HTTP traffic."
remediationMessage: "Modify the Viewer Protocol Policy for the default cache behaviors to either Redirect HTTP to HTTPS or HTTPS Only."
check:
IS_EQUAL:
left:
EXTRACT: "CA10__defaultCacheBehavior__r.CA10__viewerProtocolPolicy__c"
right:
TEXT: "allow-all"
- status: "INCOMPLIANT"
currentStateMessage: "At least one CloudFront Distribution cache behavior allows unencrypted HTTP traffic."
remediationMessage: "Modify the Viewer Protocol Policy for all cache behaviors to either Redirect HTTP to HTTPS or HTTPS Only."
check:
RELATED_LIST_HAS:
status: "INCOMPLIANT"
relationshipName: "CA10__AWS_CloudFront_Cache_Behaviors__r"
otherwise:
status: "COMPLIANT"
currentStateMessage: "All CloudFront Distribution cache behaviors enforce encrypted communications."
relatedLists:
- relationshipName: "CA10__AWS_CloudFront_Cache_Behaviors__r"
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "The viewer protocol policy for this cache behavior is set to allow-all."
check:
IS_EQUAL:
left:
EXTRACT: "CA10__viewerProtocolPolicy__c"
right:
TEXT: "allow-all"
otherwise:
status: "COMPLIANT"
currentStateMessage: "The viewer protocol policy for this cache behavior encrypts communications."