π§ 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 - Tags:
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Usesβ
- π AWS Account
- π AWS CloudTrail Trail - object.extracts.yaml
- π§ͺ test-data.json
Test Results π’β
Generated at: 2026-02-10T22:32:29.476772654Z 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 Bundleβ
| File | MD5 | |
|---|---|---|
| Open | /ce/ca/aws/account/object-level-cloudtrail-logging-for-write-events-for-buckets/policy.yaml | 0CFDC9A5643A2758838084A80B7108B9 |
| Open | /ce/ca/aws/account/object-level-cloudtrail-logging-for-write-events-for-buckets/prod.logic.yaml | 6ED9892F694BC8233BF282B89C23D3B1 |
| 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 | E81F4D5C3A3DF3406D05985DF80BF9C5 |
Available Commandsβ
repo-manager policies generate FULL /ce/ca/aws/account/object-level-cloudtrail-logging-for-write-events-for-buckets/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/aws/account/object-level-cloudtrail-logging-for-write-events-for-buckets/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/aws/account/object-level-cloudtrail-logging-for-write-events-for-buckets/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/aws/account/object-level-cloudtrail-logging-for-write-events-for-buckets/prod.logic.yaml
# Execute tests
repo-manager 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 enabled for all S3 buckets."
check:
RELATED_LIST_HAS:
status: "COMPLIANT"
relationshipName: "CA10__AWS_CloudTrail_Trails__r"
otherwise:
status: "INCOMPLIANT"
currentStateMessage: "This AWS account does not have a CloudTrail with object-level logging for write events enabled for all S3 buckets."
remediationMessage: "Create a new CloudTrail or update an existing one to enable 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 enabled 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__eventSelectorsJsonReadWriteType__c"
right:
TEXT: "All"
- IS_EQUAL:
left:
EXTRACT: "caJsonText__eventSelectorsJsonReadWriteType__c"
right:
TEXT: "WriteOnly"
otherwise:
status: "INAPPLICABLE"
currentStateMessage: "Unrelated CloudTrail configuration."