(EC2): document how to workaround Network ACL rule 100
See original GitHub issueThe default NACL created with a custom VPC has a default “100 - Allow All” ingress rule. This should not be since we can’t delete rules after the fact thru the CDK.
Reproduction Steps
What did you expect to happen?
What actually happened?
Environment
- CDK CLI Version :
- Framework Version:
- Node.js Version:
- OS :
- Language (Version):
Other
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Control traffic to subnets using Network ACLs
In the details pane, select either the Inbound Rules or Outbound Rules tab, and then choose Edit. Choose Remove for the rule you...
Read more >create-network-acl-entry — AWS CLI 2.9.8 Command Reference
Creates an entry (a rule) in a network ACL with the specified rule number. Each network ACL has a set of numbered ingress...
Read more >AWS Security Groups & Network ACLs troubleshooting
Scenario 2: Subnet B (traffic destination) with OUTBOUND DENY NACL rule ... Like the previous scenario, source EC2 ENI VPC flow log entries...
Read more >AWS: Error accessing the Internet with a custom Network ACL
I know the "problem rule" is inbound no 1000, which allows all ephemeral ports from 10.0.0.0/16 . If I change this rule to...
Read more >AWS EC2 Network Access Control List Creation - Elastic
Network ACL's may be created by a network administrator. Verify whether the user identity, user agent, and/or hostname should be making changes in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For anyone stumbling on this in the future, there’s a much simpler solution than expressed above (I’m guessing due to CDK updates). Leaving an example below for a basic VPC with a public subnet and private subnet with a NAT Gateway (CDK default).
This solution of course mirrors the “allow everything” model, but the skeleton is there to customize it however you want. This solution creates a separate network ACL for the public and private subnets (regardless of how many subnets you have).
The not-so-obvious part of this solution is the fact that
subnetSelection: { subnetType: ... }
is the line that does all the network acl to subnet associations for you. It will dissociate the default network ACL (CDK default) and re-associate these newly created ACLs.Hope this helps!
my current work around building off of this concept