π§ 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
- Located in: π AWS CloudTrail is not encrypted with KMS CMK π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π AWS CloudTrail Trail | CA10__CaAwsCloudTrailTrail__c | 8 | 1 | 3 |
Usesβ
- π AWS CloudTrail Trail - object.extracts.yaml
- π AWS KMS Key - object.extracts.yaml
- π§ͺ test-data.json
Test Results π’β
Generated at: 2025-04-24T23:44:26.464357969Z 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β
File | MD5 | |
---|---|---|
Open | /ce/ca/aws/cloudtrail/encryption-with-kms-cmk/policy.yaml | 8B29B12CB5ACFD1BB3BAA111485E6138 |
Open | /ce/ca/aws/cloudtrail/encryption-with-kms-cmk/prod.logic.yaml | A75437995A496E2A215EE0393ED1D137 |
Open | /types/CA10__CaAwsCloudTrailTrail__c/object.extracts.yaml | 3DD3C63AB8EE3DD1379ED26A102A68C4 |
Open | /types/CA10__CaAwsKmsKey__c/object.extracts.yaml | 0B059DB01E1D6F7518BF61709BB65A29 |
Open | /ce/ca/aws/cloudtrail/encryption-with-kms-cmk/test-data.json | 3B4C1B029B3F41BFEB844B6BB9A8AC0D |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/ca/aws/cloudtrail/encryption-with-kms-cmk/prod.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/ca/aws/cloudtrail/encryption-with-kms-cmk/prod.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/aws/cloudtrail/encryption-with-kms-cmk/prod.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/ca/aws/cloudtrail/encryption-with-kms-cmk/prod.logic.yaml
Execute testsβ
java -jar repo-manager.jar 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: "AWS CloudTrail is not encrypted with KMS CMK."
remediationMessage: "Ensure that CloudTrail is referencing an active S3 bucket."
check:
IS_EMPTY_LOOKUP: "CA10__kmsKey__r"
- status: "INCOMPLIANT"
currentStateMessage: "AWS CloudTrail KMS CMK is not enabled."
remediationMessage: "Ensure that CloudTrail is referencing an enabled KMS CMK."
check:
NOT_EQUAL:
left:
EXTRACT: "CA10__kmsKey__r.CA10__state__c"
right:
TEXT: "Enabled"
- status: "COMPLIANT"
currentStateMessage: "AWS CloudTrail is encrypted with 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."