This rule mandates a minimum retention period of 365 days for log groups.
Rule | Log group retention period should be at least 365 days |
Framework | FedRAMP Moderate Revision 4 |
Severity | ✔ High |
Log Group Retention Period for FedRAMP Moderate Revision 4
Rule Description
As per the FedRAMP Moderate Revision 4 compliance requirements, the log group retention period should be at least 365 days. This ensures that the log data is retained for an extended duration, allowing organizations to meet regulatory and auditing obligations and effectively investigate security incidents within the cloud environment.
Troubleshooting Steps (if applicable)
If you encounter any issues or errors related to adjusting the log group retention period, follow these troubleshooting steps:
Necessary Code (if applicable)
To modify the log group retention period, you can use the AWS Command Line Interface (CLI) or any available SDK in your preferred programming language. Below is an example of how to modify the retention period using the AWS CLI:
aws logs describe-log-groups --query 'logGroups[?logGroupName==`<log-group-name>`]' --output json aws logs put-retention-policy --log-group-name <log-group-name> --retention-in-days 365
Replace
<log-group-name>
with the actual name of the log group you want to modify.Step-by-Step Guide for Remediation
Follow these steps to modify the log group retention period to meet the FedRAMP Moderate Revision 4 compliance requirement:
Identify the target log group(s) for which you need to adjust the retention period.
Open a terminal or command prompt, and ensure that you have the AWS CLI configured and available.
Run the following command to retrieve information about the log group:
aws logs describe-log-groups --query 'logGroups[?logGroupName==`<log-group-name>`]' --output json
Replace
<log-group-name>
with the actual name of the log group.Validate the returned information to verify that the correct log group has been identified.
Run the following command to modify the retention period:
aws logs put-retention-policy --log-group-name <log-group-name> --retention-in-days 365
Replace
<log-group-name>
with the actual name of the log group.Wait for the command to complete successfully. You should see a confirmation message indicating that the retention policy has been updated.
Verify the change by confirming the new retention period for the log group using the
describe-log-groups
command.By following these steps, you can ensure that the log group retention period meets the FedRAMP Moderate Revision 4 compliance requirement of at least 365 days.