This rule ensures integration of CloudTrail trails with CloudWatch logs for better monitoring.
Rule | CloudTrail trails should be integrated with CloudWatch logs |
Framework | NIST 800-171 Revision 2 |
Severity | ✔ Critical |
Rule Description
Enabling CloudTrail integration with CloudWatch Logs ensures that your organization complies with the NIST 800-171 Revision 2 standard. CloudTrail captures and logs all API activity within your AWS account, while CloudWatch Logs provides the centralized storage and analysis of these logs.
Troubleshooting Steps
1. Verify CloudTrail Configuration
2. Check CloudWatch Logs Configuration
3. Verify IAM Permissions
4. Verify CloudWatch Logs Subscription
5. Check CloudWatch Log Retention
Necessary Code
No specific code is required for the integration of CloudTrail with CloudWatch Logs.
Step-by-Step Guide for Remediation
Access the AWS Management Console and log in to your AWS account.
Open the CloudTrail service from the services menu.
Ensure that CloudTrail is enabled globally or within the desired regions for compliance.
Review the existing trails and their status. Create a new trail if necessary.
For each trail, check if the "CloudWatch Logs" setting is enabled. If not, click on the trail name and then click on the "Edit" button.
In the "Trail details" section, scroll down to the "CloudWatch Logs" section.
Enable the "Create a new CloudWatch log group" option or select an existing log group.
Click on "Save" to apply the changes.
Check if the IAM role used by CloudTrail has sufficient permissions by navigating to "IAM" from the services menu.
Select "Roles" from the left sidebar and search for the CloudTrail role.
Verify if the required policies, such as "CloudTrailToCloudWatchLogs" or custom policies for CloudWatch Logs access, are attached to the role.
If needed, add or edit the necessary policies to grant CloudTrail permissions to write logs to CloudWatch Logs.
Confirm that CloudWatch Logs groups for CloudTrail are created by opening the CloudWatch service from the services menu.
Select "Logs" from the left sidebar and search for the log group associated with CloudTrail.
If the log group does not exist, create a new log group with an appropriate name.
Ensure that the log group's retention period complies with the requirements of NIST 800-171 Revision 2.
Review the subscription filter configuration for CloudTrail logs by selecting the log group.
Click on the "Actions" button and select "Stream to AWS Lambda" or "Stream to Amazon Elasticsearch Service" based on your requirements.
Configure the necessary details for the stream and click on "Start Streaming" to begin the subscription.
Monitor the CloudTrail logs to ensure they are delivered to the CloudWatch Logs group effectively.
By following these steps, you can integrate CloudTrail with CloudWatch Logs to meet the requirements of NIST 800-171 Revision 2.