generated from amazon-archives/__template_MIT-0
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
Great example! However, the Resource Policy in the apigw-to-private-apig-cdk pattern currently allows API traffic from any VPCE in the region. So while it prevents direct access from the public internet, it probably is not what most users are expecting.
serverless-patterns/apigw-to-private-apig-cdk/src/api/index.ts
Lines 47 to 56 in e95b8ca
| const apiResourcePolicy = new iam.PolicyDocument({ | |
| statements: [ | |
| new iam.PolicyStatement({ | |
| effect: iam.Effect.ALLOW, | |
| actions: ['execute-api:Invoke'], | |
| principals: [new iam.AnyPrincipal()], | |
| resources: ['execute-api:/*/*/*'], | |
| }) | |
| ] | |
| }); |
The PolicyDocument needs to be updated with a "Deny" statement restricting access to only the VPCE (or VPC) created by the stack. I'm happy to submit a PR if you're accepting them.
Metadata
Metadata
Assignees
Labels
No labels