π§ AWS Account Object-level CloudTrail Logging for Write Events for S3 Buckets is not enabled - prod.logic.yaml π’
- Contextual name: π§ prod.logic.yaml π’
- ID:
/ce/ca/aws/account/object-level-cloudtrail-logging-for-write-events-for-buckets/prod.logic.yaml
- Located in: π AWS Account Object-level CloudTrail Logging for Write Events for S3 Buckets is not enabled π’
Flagsβ
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Input Typeβ
Type | API Name | Extracts | Extract Files | Logic Files | |
---|---|---|---|---|---|
π | π AWS Account | CA10__CaAwsAccount__c | 1 | 1 | 11 |
Usesβ
Test Results π’β
Generated at: 2025-04-24T23:44:11.445355676Z Open
Result | Id | Condition Index | Condition Text | Runtime Error |
---|---|---|---|---|
π’ | test1 | βοΈ 199 | βοΈ CA10__AWS_CloudTrail_Trails__r.has(COMPLIANT) | βοΈ null |
π’ | test2 | βοΈ 199 | βοΈ CA10__AWS_CloudTrail_Trails__r.has(COMPLIANT) | βοΈ null |
π’ | test3 | βοΈ 200 | βοΈ otherwise | βοΈ null |
Generationβ
File | MD5 | |
---|---|---|
Open | /ce/ca/aws/account/object-level-cloudtrail-logging-for-write-events-for-buckets/policy.yaml | ECE275916CB15A7833CDCBE80DE9F532 |
Open | /ce/ca/aws/account/object-level-cloudtrail-logging-for-write-events-for-buckets/prod.logic.yaml | A6EB9015DA0D67AFC54B97B49628D79D |
Open | /ce/ca/aws/account/object-level-cloudtrail-logging-for-write-events-for-buckets/test-data.json | BA7C8C7C86576D4B4A75A2D0708A1E5E |
Open | /types/CA10__CaAwsCloudTrailTrail__c/object.extracts.yaml | 3DD3C63AB8EE3DD1379ED26A102A68C4 |
Generate FULL scriptβ
java -jar repo-manager.jar policies generate FULL /ce/ca/aws/account/object-level-cloudtrail-logging-for-write-events-for-buckets/prod.logic.yaml
Generate DEBUG scriptβ
java -jar repo-manager.jar policies generate DEBUG /ce/ca/aws/account/object-level-cloudtrail-logging-for-write-events-for-buckets/prod.logic.yaml
Generate CAPTURE_TEST_DATA scriptβ
java -jar repo-manager.jar policies generate CAPTURE_TEST_DATA /ce/ca/aws/account/object-level-cloudtrail-logging-for-write-events-for-buckets/prod.logic.yaml
Generate TESTS scriptβ
java -jar repo-manager.jar policies generate TESTS /ce/ca/aws/account/object-level-cloudtrail-logging-for-write-events-for-buckets/prod.logic.yaml
Execute testsβ
java -jar repo-manager.jar policies test /ce/ca/aws/account/object-level-cloudtrail-logging-for-write-events-for-buckets/prod.logic.yaml
Contentβ
---
inputType: "CA10__CaAwsAccount__c"
testData:
- file: "test-data.json"
conditions:
- status: "COMPLIANT"
currentStateMessage: "This AWS Account has a CloudTrail with object-level logging for write events for all S3 buckets."
check:
RELATED_LIST_HAS:
status: "COMPLIANT"
relationshipName: "CA10__AWS_CloudTrail_Trails__r"
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "This AWS Account doesn't have a CloudTrail with object-level logging for write events for all S3 buckets."
remediationMessage: "Consider creating a new CloudTrail or updating an existing one with object-level logging for write events for all S3 buckets."
relatedLists:
- relationshipName: "CA10__AWS_CloudTrail_Trails__r"
importExtracts:
- file: "/types/CA10__CaAwsCloudTrailTrail__c/object.extracts.yaml"
conditions:
- status: "COMPLIANT"
currentStateMessage: "CloudTrail with object-level logging for write events for all S3 buckets."
check:
AND:
args:
- IS_EQUAL:
left:
EXTRACT: "CA10__multiRegionTrail__c"
right:
BOOLEAN: true
- IS_EQUAL:
left:
JSON_QUERY_TEXT:
arg:
EXTRACT: "caJsonFrom__eventSelectorsJson__c"
expression: "[].dataResources[?type=='AWS::S3::Object'].type[] | [0]"
undeterminedIf:
evaluationError: "The JSON text query has failed."
resultTypeMismatch: "The JSON query did not return a text type."
right:
TEXT: "AWS::S3::Object"
- IS_EQUAL:
left:
JSON_QUERY_BOOLEAN:
arg:
EXTRACT: "caJsonFrom__eventSelectorsJson__c"
expression: "contains([].dataResources[].values[], 'arn:aws:s3')"
undeterminedIf:
evaluationError: "The JSON boolean query has failed."
resultTypeMismatch: "The JSON query did not return a boolean type."
right:
BOOLEAN: true
- OR:
args:
- IS_EQUAL:
left:
EXTRACT: "caJsonText__eventSelectorsJson_readWriteType__c"
right:
TEXT: "All"
- IS_EQUAL:
left:
EXTRACT: "caJsonText__eventSelectorsJson_readWriteType__c"
right:
TEXT: "WriteOnly"
otherwise:
status: "INAPPLICABLE"
currentStateMessage: "Unrelated CloudTrail."