π§ AWS CloudTrail S3 Bucket Access Logging is not enabled. - prod.logic.yamlπ’
- Contextual name: π§ prod.logic.yamlπ’
- ID:
/ce/ca/aws/cloudtrail/s3-bucket-access-logging/prod.logic.yaml - Tags:
- π’ Logic test success
- π’ Logic with extracts
- π’ Logic with test data
Usesβ
- π AWS CloudTrail Trail
- π AWS CloudTrail Trail - object.extracts.yaml
- π AWS S3 Bucket - object.extracts.yaml
- π§ͺ test-data.json
Test Results π’β
Generated at: 2026-02-10T22:32:36.926329939Z Open
| Result | Id | Condition Index | Condition Text | Runtime Error |
|---|---|---|---|---|
| π’ | test1 | βοΈ 99 | βοΈ isDisappeared(CA10__disappearanceTime__c) | βοΈ null |
| π’ | test2 | βοΈ 199 | βοΈ isEmptyLookup('CA10__bucket__r') | βοΈ null |
| π’ | test3 | βοΈ 299 | βοΈ extract('CA10__bucket__r.CA10__loggingDestinationBucketName__c').isEmpty() | βοΈ null |
| π’ | test4 | βοΈ 399 | βοΈ extract('CA10__bucket__r.CA10__arn__c') == extract('CA10__bucket__r.CA10__loggingDestinationBucketArn__c') | βοΈ null |
| π’ | test5 | βοΈ 499 | βοΈ isEmptyLookup('CA10__bucket__r.CA10__loggingDestinationBucket__r') | βοΈ null |
| π’ | test6 | βοΈ 599 | βοΈ notEmptyLookup('CA10__bucket__r.CA10__loggingDestinationBucket__r') | βοΈ null |
Generation Bundleβ
| File | MD5 | |
|---|---|---|
| Open | /ce/ca/aws/cloudtrail/s3-bucket-access-logging/policy.yaml | 102C4D7FA1C60A070459124C7C5F910A |
| Open | /ce/ca/aws/cloudtrail/s3-bucket-access-logging/prod.logic.yaml | 0B9CF2F5AAE560A0BB5978FD3360FACE |
| Open | /ce/ca/aws/cloudtrail/s3-bucket-access-logging/test-data.json | 92620BF0E6E7675C775FC2DDB9FC16CB |
| Open | /types/CA10__CaAwsCloudTrailTrail__c/object.extracts.yaml | E81F4D5C3A3DF3406D05985DF80BF9C5 |
| Open | /types/CA10__CaAwsBucket__c/object.extracts.yaml | F56AFA293B0B19D4F39C1EBB70F4C56F |
Available Commandsβ
repo-manager policies generate FULL /ce/ca/aws/cloudtrail/s3-bucket-access-logging/prod.logic.yaml
repo-manager policies generate DEBUG /ce/ca/aws/cloudtrail/s3-bucket-access-logging/prod.logic.yaml
repo-manager policies generate CAPTURE_TEST_DATA /ce/ca/aws/cloudtrail/s3-bucket-access-logging/prod.logic.yaml
repo-manager policies generate TESTS /ce/ca/aws/cloudtrail/s3-bucket-access-logging/prod.logic.yaml
# Execute tests
repo-manager policies test /ce/ca/aws/cloudtrail/s3-bucket-access-logging/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__CaAwsBucket__c/object.extracts.yaml"
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "AWS CloudTrail references a missing bucket."
remediationMessage: "Configure CloudTrail to reference an active S3 bucket."
check:
IS_EMPTY_LOOKUP: "CA10__bucket__r"
- status: "INCOMPLIANT"
currentStateMessage: "Server access logging is not enabled."
remediationMessage: "Enable server access logging."
check:
IS_EMPTY:
arg:
EXTRACT: "CA10__bucket__r.CA10__loggingDestinationBucketName__c"
# When source bucket is its own destination bucket,
# then ARNs will be the same but CA10__loggingDestinationBucket__c will be empty
- status: "COMPLIANT"
currentStateMessage: "Server access logging is enabled. The bucket uses itself as the logging destination."
check:
IS_EQUAL:
left:
EXTRACT: "CA10__bucket__r.CA10__arn__c"
right:
EXTRACT: "CA10__bucket__r.CA10__loggingDestinationBucketArn__c"
- status: "INCOMPLIANT"
currentStateMessage: "The destination bucket is missing."
remediationMessage: "Configure bucket access logging to reference an active S3 bucket."
check:
IS_EMPTY_LOOKUP: "CA10__bucket__r.CA10__loggingDestinationBucket__r"
- status: "COMPLIANT"
currentStateMessage: "Server access logging is enabled."
check:
NOT_EMPTY_LOOKUP: "CA10__bucket__r.CA10__loggingDestinationBucket__r"
otherwise:
status: "UNDETERMINED"
currentStateMessage: "Unexpected values in the fields."