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 API Gateway

CloudFormation guard rules template for API Gateway resources

The following rules are included: 

  • REST API Client Certificate Enabled
  • No Public REST APIs
  • REST API Stage Access Logging Enabled
  • REST API Stage Tracing Enabled
CloudFormation Validation Tool: Syntax and Security validation for your templates online

let apigateway_stages = Resources.*[
	Type == "AWS::ApiGateway::Stage"
]

let apigateway_restapis = Resources.*[
	Type == "AWS::ApiGateway::RestApi"
]

rule restapi_client_certificate_enabled when %apigateway_stages !empty {
	%apigateway_stages {
		Properties {
			ClientCertificateId exists <<ClientCertificateId is not configured.>>
		}
	}
}

rule restapi_private_public when %apigateway_restapis !empty {
	%apigateway_restapis {
		Properties {
			EndpointConfiguration exists <<EndpointConfiguration is not configured.>>
			when EndpointConfiguration exists {
				EndpointConfiguration {
					Types exists <<Types is not configured.>>
					when Types exists {
						Types == ["PRIVATE"] <<API gateway is not private.>>
					}
				}
			}
		}
	}
}

rule stage_access_logging when %apigateway_stages !empty {
	%apigateway_stages {
		Properties {
			AccessLogSetting exists <<AccessLogSetting is not configured.>>
		}
	}
}

rule restapi_stage_tracing_enabled when %apigateway_stages !empty {
	%apigateway_stages {
		Properties {
			TracingEnabled exists <<TracingEnabled is not configured.>>
			when TracingEnabled exists {
				TracingEnabled == true <<X-Ray tracing is disabled.>>
			}
		}
	}
}


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