feat(apigateway): Add exposed_internet property based on endpoint type #2341
+42
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of change
Summary
This PR clarifies the distinction between two security concepts for API Gateway REST APIs:
anonymous_access(existing): Policy-level access determined by PolicyUniverse analysis of the resource policy. Indicates whether the policy allows anonymous/public access.exposed_internet(new): Network-level exposure based on endpoint configuration type:EDGE→ Internet exposed (default, via CloudFront)REGIONAL→ Internet exposed (direct regional access)PRIVATE→ NOT internet exposed (VPC-only via VPC Endpoints)Problem solved: Previously, a PRIVATE API Gateway with an open resource policy would show
anonymous_access=true, which is misleading because the API is not actually reachable from the internet. Now users can useexposed_internetto determine network reachability and combine both properties for accurate security assessment.New properties on
APIGatewayRestAPI:endpoint_typeEDGE,REGIONAL, orPRIVATE)exposed_internettruefor EDGE/REGIONAL endpoints,falsefor PRIVATE endpointsRelated issues or links
How was this tested?
test-001(REGIONAL):endpoint_type='REGIONAL',exposed_internet=truetest-002(PRIVATE):endpoint_type='PRIVATE',exposed_internet=falseChecklist
General
make lint).Proof of functionality
If you are changing a node or relationship
Notes for reviewers
endpointConfiguration.typesfield is already returned by the AWSget_rest_apisAPI and was present in our test data, so no additional API calls are needed.typesfield is a list for historical AWS API reasons but in practice contains only one element.anonymous_accesswill continue to work.