Ensure log retention period of at least 90 days retention period for AWS CloudWatch Log Group

HIGH

Description

CloudWatch logs are all kept without deletion by default, however this can become costly over time so many administrators will configure a retention period. It is important to ensure that this is configured with a specific timeframe in accordance with regulatory requirements; the most common retention period recorded for compliance is 90 days. This can also be used in conjunction with the archive setting to rotate logs. For more information, see the AWS documentation.
References:
https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html

Remediation

In AWS Console -

  1. Sign in to AWS Console and go to the CloudWatch console.
  2. Select Log Groups in the navigation pane.
  3. Select the log group to update.
  4. Select 'Edit retention' and change the log retention value to 90 days or more.

In Terraform -

  1. In the aws_cloudwatch_log_group resource, set the field retention_in_days to 90 days or more.

References:
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group#retention_in_days

Policy Details

Rule Reference ID: AC_AWS_0448
CSP: AWS
Remediation Available: Yes
Resource Category: Logging and Monitoring
Resource Type: CloudWatch

Frameworks