Guided Walkthroughs

Configuration Packages

By Implementation

Service Control PoliciesConfig RulesAuto Remediation RulesConformance PacksAmazon GuardDutyAmazon InspectorAWS Security HubAWS Network FirewallRoute53 Resolver SecurityAmazon MacieS3 Bucket PoliciesCloudWatch Alarms and Event RulesAWS WAFAWS Secrets ManagerAWS Systems ManagerSecurity Groups & NACLsAWS KMSAWS SSOIAM PoliciesVPC Endpoint PoliciesCloudFormation Guard RulesLoad BalancersRDS Event SubscriptionsAWS Resource Access Manager (RAM)

By Service Protected

Reference Guides

Other

CloudFormation Guard Rules

Cloudformation Guard Rules for AWS CloudTrail

CloudFormation guard rules template for AWS CloudTrail resources

The following rules are included: 

  • Multi-Region Trail
  • Forwarding to Cloudwatch Logs Enabled
  • KMS Encryption Enabled
  • Log File Validation Enabled
  • Trail Insights Enabled
  • Global Service Event Recording Enabled
  • Organization Trail Enabled
CloudFormation Validation Tool: Syntax and Security validation for your templates online

let cloudtrail_trails = Resources.*[
	Type == "AWS::CloudTrail::Trail"
]

rule cloudtrail_multiregion when %cloudtrail_trails !empty {
	%cloudtrail_trails {
		Properties {
			IsMultiRegionTrail exists <<IsMultiRegionTrail is not configured (i.e. disabled).>>
			when IsMultiRegionTrail exists {
				IsMultiRegionTrail == true <<Not a multi-region trail.>>
			}
		}
	}
}

rule cloudtrail_cloudwatch_forwarding when %cloudtrail_trails !empty {
	%cloudtrail_trails {
		Properties {
			CloudWatchLogsLogGroupArn exists <<Trail is not configured to forward logs to CloudWatch.>>
		}
	}
}

rule cloudtrail_kms_encryption when %cloudtrail_trails !empty {
	%cloudtrail_trails {
		Properties {
			KMSKeyId exists <<Encryption with KMS is not enabled for this trail.>>
		}
	}
}

rule cloudtrail_log_file_validation when %cloudtrail_trails !empty {
	%cloudtrail_trails {
		Properties {
			EnableLogFileValidation exists <<EnableLogFileValidation is not configured (i.e. disabled).>>
			when EnableLogFileValidation exists {
				EnableLogFileValidation == true <<Log file validation is disabled.>>
			}
		}
	}
}

rule cloudtrail_insights_enabled when %cloudtrail_trails !empty {
	%cloudtrail_trails {
		Properties {
			InsightSelectors exists <<CloudTrail Trail Insights is disabled.>>
		}
	}
}

rule cloudtrail_global_services_enabled when %cloudtrail_trails !empty {
	%cloudtrail_trails {
		Properties {
			IncludeGlobalServiceEvents exists <<IncludeGlobalServiceEvents is not configured (i.e. disabled).>>
			when IncludeGlobalServiceEvents exists {
				IncludeGlobalServiceEvents == true <<Global service events is disabled.>>
			}
		}
	}
}

rule organizations_trail when %cloudtrail_trails !empty {
	%cloudtrail_trails {
		Properties {
			IsOrganizationTrail exists <<IsOrganizationTrail is not configured (i.e. disabled).>>
			when IsOrganizationTrail exists {
				IsOrganizationTrail == true <<Not a organization trail.>>
			}
		}
	}
}



Actions



Customize Template

* Required field

Upgrade to Premium for More Features
Sign up

Guided Walkthroughs
Step-by-step configuration wizards for your environment
Dedicated Security Account
AWS Backup Strategy
VPC Connectivity Setup
Automated Patching
All Guides
Configuration Packages
Pre-built packages for common configuration
Common SCPs
CloudFormation Guard Rules
Auto Remediation Rules
IAM Monitoring & Compliance
All Packages
Automated Assessments
  • 350+ security checks
  • Well-architected reviews
  • Detailed compliance reports
  • Remediation templates
  • Email summaries
  • Learn more