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

  1. Navigate to the AWS Management Console.
  2. Go to the CloudTrail service.
  3. Choose 'Trails' from the navigation pane.
  4. 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

  1. Use AWS CLI to enable CloudTrail:
aws cloudtrail start-logging --name 'trail-name'

References

  1. https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html
  2. 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