Ensure CloudTrail Logging is Enabled
Ensure that AWS CloudTrail is enabled for all AWS accounts to maintain a record of user activity and API calls.
Risk Level: Low
Cloud Entity: CloudTrail
CloudGuard Rule ID: D9.AWS.LOG.27
Covered by Spectral: No
Category: Management Tools
GSL LOGIC
List<CloudTrail> should have items length() > 0 and items contain [ status.isLogging = true ]
REMEDIATION
From Portal
- Navigate to the AWS Management Console.
- Go to the CloudTrail service.
- Choose 'Trails' from the navigation pane.
- If no trail exists, click on 'Create trail'.
From TF
resource "aws_cloudtrail" "example" {
name = "example"
s3_bucket_name = "example-bucket"
enable_logging = true
}
From Command Line
- Use AWS CLI to enable CloudTrail:
aws cloudtrail start-logging --name 'trail-name'
References
- https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudtrail
CloudTrail
AWS CloudTrail is a service that enables governance, compliance, operational auditing, and risk auditing of your AWS account. With CloudTrail, you can log, continuously monitor, and retain account activity related to actions across your AWS infrastructure. CloudTrail provides event history of your AWS account activity, including actions taken through the AWS Management Console, AWS SDKs, command line tools, and other AWS services. This event history simplifies security analysis, resource change tracking, and troubleshooting.
Compliance Frameworks
- CloudGuard AWS All Rules Ruleset
Updated about 1 year ago