Check provider logo

CloudWatch log group has a retention policy of at least the configured minimum days or never expires

cloudwatch_log_group_retention_policy_specific_days_enabled

Severitymedium
Servicecloudwatch
by Prowler

CloudWatch Log Groups are assessed for a retention period at or above the configured threshold (e.g., 365 days) or for being set to never expire. Log groups with shorter retention are identified.

Risk

Short log retention erodes audit evidence. Adversaries can wait out the window, creating gaps in detection, forensics, and compliance reporting. This degrades the availability of historical logs and the integrity of incident timelines.

Run this check with Prowler CLI

prowler aws --checks cloudwatch_log_group_retention_policy_specific_days_enabled

Recommendation

Define a minimum retention baseline (e.g., >=365 days) aligned to legal and investigative needs. Apply it consistently with documented exceptions. Automate enforcement, monitor changes, and restrict who can modify retention under least privilege and defense in depth.

Remediation

CLI

aws logs put-retention-policy --log-group-name <LOG_GROUP_NAME> --retention-in-days <DAYS>

Native IaC
Terraform
Other
  1. In the AWS Console, go to CloudWatch > Log groups
  2. Select the target log group
  3. In the Expire events after/Retention column, click the current value
  4. Choose a retention value >= <DAYS> or select Never expire
  5. Click Save

Source Code

Resource Type

AwsLogsLogGroup

References