Implement S3 Lifecycle Policies for Log Data
Specification & Description
Configure S3 lifecycle policies on the central logging buckets in the Log Archive account to automatically transition log data through cheaper storage classes over time and enforce retention-based expiration.
This control applies to all log data centralised in the Log Archive account. The sources, retention requirements, and bucket structure for each log type are defined in the following controls:
- [AWS-LOG-001] Centralized and Immutable CloudTrail Logging - defines CloudTrail log delivery configuration, bucket naming, and minimum retention requirements.
- [AWS-LOG-004] Centralized VPC Flow Logging with Partitioning and Compression - defines Flow Log delivery targets, format, and account-level activation scope.
- AWS Config Recording - defines Config snapshot and history delivery to the Log Archive bucket.
Lifecycle policies defined in this control must be applied to the buckets referenced in those controls and must not reduce retention below the minimums they specify.
Technical Specifications
Log data delivered to the Log Archive account accumulates continuously from all Landing Zone accounts. Without lifecycle management, standard S3 storage costs compound linearly with organisational growth. This control defines storage class transition schedules and expiration rules per log type, balancing access frequency patterns against cost and compliance obligations.
Recommended transition schedule by log type
| Log Type | Standard → Intelligent-Tiering | → Glacier IR | → Glacier Deep Archive | Expiration |
|---|---|---|---|---|
| CloudTrail | 30 days | 90 days | 365 days | 3650 days (10 years) |
| VPC Flow Logs | 30 days | 60 days | 180 days | 365 days |
| ALB / WAF Access Logs | 14 days | 60 days | 180 days | 365 days |
Retention minimums for CloudTrail and Config are driven by compliance standards. Adjust expiration only after confirming with your compliance team.
S3 Intelligent-Tiering is preferred over a direct Standard → Glacier transition for the first 30–90 day window because access patterns for recent logs are non-uniform - incident response queries frequently target logs from the past 30 days.
Security Rationale
Log storage is a significant and predictable cost driver in Landing Zone architectures. Lifecycle policies are the lowest-effort, highest-return cost optimisation available for the Log Archive account. Establishing them at Landing Zone build time prevents cost accumulation that becomes difficult to remediate retroactively once bucket objects number in the billions.
Business & Security Impact
Without lifecycle policies, log storage costs grow uncapped as the organisation scales. At high log volumes, the delta between Standard and Deep Archive storage pricing can represent tens of thousands of euros annually. Equally, missing expiration rules create compliance risk if data is retained beyond legally mandated maximum periods.
Compliance Framework Mappings (3)
Regulatory baselines and industry standards mapped to this control specification.
| Framework / Standard | Mapped Requirements & Controls | Controls |
|---|---|---|
NIST 800-53 Rev 5NIST 800-53 | AU-11CP-9 | 2 |
PCI DSS v4.0PCI DSS | 10.5.1 | 1 |
ISO 27001:2022ISO 27001 | A.12.4.1 | 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: aws-api • Automated: Yes
For each central logging bucket in the Log Archive account, retrieve the lifecycle configuration and verify: (1) at least one transition rule to INTELLIGENT_TIERING or GLACIER_IR exists within 90 days, (2) a DEEP_ARCHIVE transition exists within 365 days, and (3) an expiration rule is present.
Remediation Guide & Automation
Apply S3 lifecycle configurations to the central logging buckets in the Log Archive account using the transition schedules defined above. Use Terraform to ensure the policies are version-controlled and reproducible.
Step-by-Step Instructions
- Identify all central logging buckets in the Log Archive account (CloudTrail, VPC Flow Logs, CloudWatch, ALB/WAF, ...).
- For each bucket, apply the lifecycle configuration matching the log type schedule from the table in the details section.
- Confirm that no transition rule reduces retention below the minimum specified in the sourcing control for that log type.
- Validate the applied configuration using the detection CLI command below and confirm rules are in Active status.