Description
Use EDGE or REGIONAL for REST APIs that need internet reachability. For internal APIs, PRIVATE limits the network path. Keep method authentication and application permission checks in place.
Potential impact
A public path with insufficient access checks may expose internal functions. Switching before private connectivity is ready can also disconnect existing clients.
Remediation
Prepare an interface VPC endpoint, security groups and DNS. Set the API resource policy to allow the required VPCs or endpoints. Change the endpoint type, redeploy and test connectivity and authentication for approved clients.
Examples
The excerpts compare EndpointConfiguration.Types on the same REST API. They omit the VPC endpoint, resource policy, methods and authentication settings.
Before
Resources:
InternalApi:
Type: AWS::ApiGateway::RestApi
Properties:
Name: internal-api
EndpointConfiguration:
Types:
- EDGE
EDGE provides a public path. Authentication and access policies determine who can call the API.
After
Resources:
InternalApi:
Type: AWS::ApiGateway::RestApi
Properties:
Name: internal-api
EndpointConfiguration:
Types:
- PRIVATE
PRIVATE routes calls through a VPC endpoint.