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 MSK

CloudFormation guard rules template for Amazon MSK (Managed Apache Kafka) resources

The following rules are included: 

  • Client-Broker Encryption In-Transit Enabled
  • In-Cluster Encryption In-Transit Enabled
  • Broker Logs Enabled
  • IAM Authentication Enabled
CloudFormation Validation Tool: Syntax and Security validation for your templates online

let msk_clusters = Resources.*[
	Type == "AWS::MSK::Cluster"
]

rule msk_encrypt_in_transit_tls when %msk_clusters !empty {
	%msk_clusters {
		Properties {
			EncryptionInfo !exists OR
			EncryptionInfo exists
			when EncryptionInfo exists {
				EncryptionInfo {
					EncryptionInTransit !exists OR
					EncryptionInTransit exists
					when EncryptionInTransit exists {
						EncryptionInTransit {
							ClientBroker !exists OR
							ClientBroker exists
							when ClientBroker exists {
								ClientBroker == "TLS" <<Only encryption in transit (Client-broker) is disabled.>>
							}
						}
					}
				}
			}
		}
	}
}

rule msk_encrypt_within_cluster when %msk_clusters !empty {
	%msk_clusters {
		Properties {
			EncryptionInfo !exists OR
			EncryptionInfo exists
			when EncryptionInfo exists {
				EncryptionInfo {
					EncryptionInTransit !exists OR
					EncryptionInTransit exists
					when EncryptionInTransit exists {
						EncryptionInTransit {
							InCluster !exists OR
							InCluster exists
							when InCluster exists {
								InCluster == true <<Encryption in-transit is disabled within the cluster nodes.>>
							}
						}
					}
				}
			}
		}
	}
}

rule msk_broker_logs_enabled when %msk_clusters !empty {
	%msk_clusters {
		Properties {
			LoggingInfo exists <<LoggingInfo is not configured.>>
			when LoggingInfo exists {
				LoggingInfo {
					BrokerLogs {
						CloudWatchLogs exists OR
						Firehose exists OR
						S3 exists <<No broker logs delivery configured.>>

						when CloudWatchLogs exists OR
						Firehose exists OR
						S3 exists {
							CloudWatchLogs.Enabled == true OR
							Firehose.Enabled == true OR
							S3.Enabled == true
						}
					}
				}
			}
		}
	}
}

rule msk_iam_authentication when %msk_clusters !empty {
	%msk_clusters {
		Properties {
			ClientAuthentication exists <<ClientAuthentication is not configured.>>
			when ClientAuthentication exists {
				ClientAuthentication {
					Sasl exists <<Sasl is not configured.>>
					when Sasl exists {
						Sasl {
							Iam exists <<Iam is not configured.>>
							when Iam exists {
								Iam {
									Enabled == true <<IAM authentication is disabled for Apache Kafka actions.>>
								}
							}
						}
					}
				}
			}
		}
	}
}


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