Secure S3 Audit Trails and CloudTrail Loop Prevention
Specification & Description
Enable S3 server access logging for buckets tagged as sensitive while explicitly prohibiting logging on CloudTrail buckets to prevent infinite recursive logging loops and associated cost spikes.
Technical Specifications
AWS S3 server access logging is critical for auditing sensitive data access. However, enabling server access logging on a bucket that also serves as a target for AWS CloudTrail (or as its own logging target) creates an infinite recursive loop: every log delivery is recorded as an access event, which triggers a new log delivery. This results in massive storage growth and uncontrolled costs. This control mandates tagging for sensitive buckets to ensure audit trails exist where necessary, while enforcing a guardrail to prevent logging on the central CloudTrail log archive bucket.
Security Rationale
Tag-driven selective logging focuses forensic visibility on critical data (PII, financial, source code) without the overhead of logging every low-risk utility bucket. Prohibiting logging on the CloudTrail bucket is a mandatory operational safety guardrail to avoid service-wide log bombardment and financial loss from recursive storage events.
Business & Security Impact
Failure to disable logging on CloudTrail buckets can lead to service interruption due to S3 API throttling and unexpected high costs. Conversely, a lack of logging on sensitive buckets impairs forensic capabilities during a security incident.
Policy Exceptions (1)
Central logging buckets are exempt to prevent recursive loops.
Operational & Implementation Notes
Enabling server access logging on a bucket that receives its own logs or receives frequent CloudTrail logs will cause exponential log growth. Always use a separate, dedicated logging bucket that does not have logging enabled for itself.
Related Controls & Guardrails (2)
Official References
Compliance Framework Mappings (2)
Regulatory baselines and industry standards mapped to this control specification.
| Framework / Standard | Mapped Requirements & Controls | Controls |
|---|---|---|
CIS AWS Foundations Benchmark v3.0CIS AWS | 3.6 | 1 |
AWS Foundational Security Best PracticesAWS FSBP | S3.9 | 1 |
* Compliance framework mappings are provided for informational architectural reference. Always verify control alignment against your organization's formal audit requirements.
Automated Detection & Rule Logic
Detection Engine: config-rule • Automated: Yes
Uses S3_BUCKET_LOGGING_ENABLED scoped via tags to sensitive buckets. Additionally, a custom check should verify the CloudTrail bucket is NOT in the compliance list.
Preventative Enforcement Policies
Remediation Guide & Automation
Tag sensitive buckets, enable access logging targeting the Log Archive account, and verify that the primary CloudTrail log bucket has logging disabled.
Step-by-Step Instructions
- Tag sensitive buckets with SecuritySensitivity: High.
- Setup a central logging bucket in the Log Archive account.
- Enable server access logging on sensitive source buckets.
- Ensure the CloudTrail log bucket has NO access logging enabled to prevent loops.