π§ AWS CloudFront Web Distribution Cache Behaviors allow unencrypted traffic - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/prod.logic.yaml
- Located in: π AWS CloudFront Web Distribution Cache Behaviors allow unencrypted traffic π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π AWS CloudFront Distribution | CA10__CaAwsDistribution__c | 4 | 1 | 7 |
Usesβ
Test Results π’β
Generated at: 2025-07-08T23:23:04.898079083Z Open
Result | Id | Condition Index | Condition Text | Runtime 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β
File | MD5 | |
---|---|---|
Open | /ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/policy.yaml | 816E8C64A79382910AD17055ED1280E5 |
Open | /ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/prod.logic.yaml | 6FEE6C186CCD360E21878DF1D14CBA53 |
Open | /ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/test-data.json | E08B0BBD7FB6004988EB6E8321E6CF4A |
Open | /types/CA10__CaAwsCacheBehavior2__c/object.extracts.yaml | 9FCFD18140FB8C38265EB37003668054 |
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β
---
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."