π§ AWS CloudTrail is not encrypted with KMS CMK - prod.logic.yamlπ’
- Contextual name: π§ prod.logic.yamlπ’
- ID:
/ce/ca/aws/cloudtrail/encryption-with-kms-cmk/prod.logic.yaml - Tags:
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Usesβ
- π AWS CloudTrail Trail
- π AWS KMS Key - object.extracts.yaml
- π AWS CloudTrail Trail - object.extracts.yaml
- π§ͺ test-data.json
Test Results π’β
Generated at: 2026-02-10T22:32:36.464428467Z Open
| Result | Id | Condition Index | Condition Text | Runtime Error |
|---|---|---|---|---|
| π’ | test1 | βοΈ 99 | βοΈ isDisappeared(CA10__disappearanceTime__c) | βοΈ null |
| π’ | test2 | βοΈ 199 | βοΈ isEmptyLookup('CA10__kmsKey__r') | βοΈ null |
| π’ | test3 | βοΈ 299 | βοΈ extract('CA10__kmsKey__r.CA10__state__c') != 'Enabled' | βοΈ null |
| π’ | test4 | βοΈ 399 | βοΈ extract('CA10__kmsKey__r.CA10__state__c') == 'Enabled' | βοΈ null |
Generation Bundleβ
| File | MD5 | |
|---|---|---|
| Open | /ce/ca/aws/cloudtrail/encryption-with-kms-cmk/policy.yaml | 041BDADEA81049BFE2B7A0DD7C443E6B |
| Open | /ce/ca/aws/cloudtrail/encryption-with-kms-cmk/prod.logic.yaml | 9A522B16ACED76940486432B75C775D6 |
| Open | /ce/ca/aws/cloudtrail/encryption-with-kms-cmk/test-data.json | 3B4C1B029B3F41BFEB844B6BB9A8AC0D |
| Open | /types/CA10__CaAwsKmsKey__c/object.extracts.yaml | EC6D0EFD0BFEAB3447A84529724D4AFE |
| Open | /types/CA10__CaAwsCloudTrailTrail__c/object.extracts.yaml | E81F4D5C3A3DF3406D05985DF80BF9C5 |
Available Commandsβ
repo-manager policies generate FULL /ce/ca/aws/cloudtrail/encryption-with-kms-cmk/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/aws/cloudtrail/encryption-with-kms-cmk/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/aws/cloudtrail/encryption-with-kms-cmk/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/aws/cloudtrail/encryption-with-kms-cmk/prod.logic.yaml
# Execute tests
repo-manager policies test /ce/ca/aws/cloudtrail/encryption-with-kms-cmk/prod.logic.yaml
Contentβ
---
inputType: "CA10__CaAwsCloudTrailTrail__c"
testData:
- file: "test-data.json"
importExtracts:
- file: "/types/CA10__CaAwsCloudTrailTrail__c/object.extracts.yaml"
- file: "/types/CA10__CaAwsKmsKey__c/object.extracts.yaml"
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "CloudTrail is not encrypted with a KMS CMK."
remediationMessage: "Configure CloudTrail to use an active KMS CMK."
check:
IS_EMPTY_LOOKUP: "CA10__kmsKey__r"
- status: "INCOMPLIANT"
currentStateMessage: "The CloudTrail KMS CMK is not enabled."
remediationMessage: "Configure CloudTrail to use an enabled KMS CMK."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10__kmsKey__r.CA10__state__c"
right:
TEXT: "Enabled"
- status: "COMPLIANT"
currentStateMessage: "CloudTrail is encrypted with a KMS CMK."
check:
IS_EQUAL:
left:
EXTRACT: "CA10__kmsKey__r.CA10__state__c"
right:
TEXT: "Enabled"
otherwise:
status: "UNDETERMINED"
currentStateMessage: "Unexpected values in the fields."