For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/cloudformation-aws-serverless-api-endpoint-config-not-private.md.
A documentation index is available at /llms.txt.
Serverless APIs should use a PRIVATE endpoint to avoid exposure to the public internet, since public endpoints can allow unauthenticated access and unintended invocation of backend services, leading to data exposure or service abuse. For AWS::Serverless::Api resources, the Properties.EndpointConfiguration.Types array must be defined and include the value PRIVATE. Resources missing EndpointConfiguration, missing Types, or where Types does not contain PRIVATE will be flagged.
AWSTemplateFormatVersion:'2010-09-09'Transform:AWS::Serverless-2016-10-31Description:AWS SAM template with a simple API definitionResources:ApiGatewayApi4:Type:AWS::Serverless::ApiProperties:StageName:prodTracingEnabled:trueCacheClusterEnabled:trueEndpointConfiguration:Types:- PRIVATE
Non-Compliant Code Examples
AWSTemplateFormatVersion:'2010-09-09'Transform:AWS::Serverless-2016-10-31Description:AWS SAM template with a simple API definitionResources:ApiGatewayApi:Type:AWS::Serverless::ApiProperties:StageName:prodTracingEnabled:trueCacheClusterEnabled:true
AWSTemplateFormatVersion:'2010-09-09'Transform:AWS::Serverless-2016-10-31Description:AWS SAM template with a simple API definitionResources:ApiGatewayApi2:Type:AWS::Serverless::ApiProperties:StageName:prodTracingEnabled:trueCacheClusterEnabled:trueEndpointConfiguration:VpcEndpointIds:- !Ref ApiGatewayVPCEndpoint
AWSTemplateFormatVersion:'2010-09-09'Transform:AWS::Serverless-2016-10-31Description:AWS SAM template with a simple API definitionResources:ApiGatewayApi3:Type:AWS::Serverless::ApiProperties:StageName:prodTracingEnabled:trueCacheClusterEnabled:trueEndpointConfiguration:Types:- EDGE
1
2
rulesets:- CloudFormation / AWS # Rules to enforce / AWS.
Request a personalized demo
Get Started with Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.