Skip to main content

🧠 AWS CloudTrail is not encrypted with KMS CMK - prod.logic.yaml 🟒

Flags​

Input Type​

TypeAPI NameExtractsExtract FilesLogic Files
πŸ”’πŸ“• AWS CloudTrail TrailCA10__CaAwsCloudTrailTrail__c813

Uses​

Test Results πŸŸ’β€‹

Generated at: 2025-04-24T23:44:26.464357969Z Open

ResultIdCondition IndexCondition TextRuntime 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​

FileMD5
Open/ce/ca/aws/cloudtrail/encryption-with-kms-cmk/policy.yaml8B29B12CB5ACFD1BB3BAA111485E6138
Open/ce/ca/aws/cloudtrail/encryption-with-kms-cmk/prod.logic.yamlA75437995A496E2A215EE0393ED1D137
Open/types/CA10__CaAwsCloudTrailTrail__c/object.extracts.yaml3DD3C63AB8EE3DD1379ED26A102A68C4
Open/types/CA10__CaAwsKmsKey__c/object.extracts.yaml0B059DB01E1D6F7518BF61709BB65A29
Open/ce/ca/aws/cloudtrail/encryption-with-kms-cmk/test-data.json3B4C1B029B3F41BFEB844B6BB9A8AC0D

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​

Open File

---
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."