π§ 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 - Tags:
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Usesβ
- π AWS CloudFront Distribution
- π AWS CloudFront Cache Behavior - object.extracts.yaml
- π§ͺ test-data.json
Test Results π’β
Generated at: 2026-02-10T22:32:36.018935688Z 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 Bundleβ
| 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 | BDCFB4A4F1CDA3202BA5FBDCCDCEC5E6 |
| Open | /ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/test-data.json | E08B0BBD7FB6004988EB6E8321E6CF4A |
| Open | /types/CA10__CaAwsCacheBehavior2__c/object.extracts.yaml | 9FCFD18140FB8C38265EB37003668054 |
Available Commandsβ
repo-manager policies generate FULL /ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/aws/cloudfront/distribution-unencrypted-cache-behaviors/prod.logic.yaml
# Execute tests
repo-manager 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: "Set the viewer protocol policy to Redirect HTTP to HTTPS or HTTPS Only for all cache behaviors."
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: "Set the viewer protocol policy to Redirect HTTP to HTTPS or HTTPS Only for the default cache behavior."
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: "Set the viewer protocol policy to Redirect HTTP to HTTPS or HTTPS Only for all cache behaviors."
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."