This rule ensures integration of CloudTrail trails with CloudWatch logs for enhanced monitoring and security.
Rule | CloudTrail trails should be integrated with CloudWatch logs |
Framework | NIST Cybersecurity Framework (CSF) v1.1 |
Severity | ✔ Critical |
Rule Description:
The rule requires the integration of CloudTrail trails with CloudWatch logs to align with the NIST Cybersecurity Framework (CSF) v1. This integration enhances the security posture of the cloud environment by collecting and analyzing logs from the CloudTrail service and forwarding them to CloudWatch logs for further monitoring and analysis.
Troubleshooting Steps:
Verify CloudTrail Configuration:
Check CloudWatch Logs Configuration:
Verify IAM Roles and Permissions:
Necessary Code:
No specific code is required for this rule. However, you may need to use AWS CLI commands for troubleshooting and verifying the configuration.
Remediation Steps:
To integrate CloudTrail trails with CloudWatch logs, follow these step-by-step instructions:
Open the AWS Management Console and navigate to the CloudTrail service.
Select the appropriate CloudTrail trail that needs to be integrated with CloudWatch logs.
Click on the "Edit" button to modify the trail configuration.
In the "Storage location" section, ensure that the trail is configured to store log files in an Amazon S3 bucket.
Scroll down to the "CloudWatch Logs" section and enable the toggle switch for "Enable CloudWatch Logs."
Select the desired existing log group or create a new log group in CloudWatch logs to receive the CloudTrail logs.
Choose the appropriate IAM role under "IAM Role" that allows CloudTrail to deliver logs to CloudWatch logs.
Click on the "Save" button to apply the changes and enable the integration.
Repeat the above steps for each CloudTrail trail that needs to be integrated with CloudWatch logs.
CLI Commands:
If you prefer using AWS CLI, here are the corresponding commands to enable CloudWatch integration for CloudTrail trails:
aws cloudtrail update-trail --name <trail_name> --cloud-watch-logs-log-group-arn <log_group_arn> --cloud-watch-logs-role-arn <role_arn>
Replace
<trail_name>
with the name of the CloudTrail trail, <log_group_arn>
with the ARN of the desired log group, and <role_arn>
with the ARN of the IAM role that allows CloudTrail to deliver logs to CloudWatch logs.aws cloudtrail describe-trails --trail-name-list <trail_name>
Replace
<trail_name>
with the name of the CloudTrail trail to check if CloudWatch logs integration is enabled.Conclusion:
By integrating CloudTrail trails with CloudWatch logs as per the NIST Cybersecurity Framework (CSF) v1, the organization ensures improved monitoring and analysis of AWS API activity, enhancing the overall security posture and compliance with cybersecurity best practices.