VPC and Network Security Flashcards
What is automatically created when creating a VPC?
Creating a new VPC creates a default SG, a default NACL and a route table. Nothing more
For what are First 4 and last IP in subnet are reserved?
0=network addr, 1=VPC router, 2=DNS server, 3=future use, 255=broadcast
How many IGW can each VPC have?
1
What is the problem because net subnet created is first associated to default route table?
so don’t keep a route open to internet in default RT, instead create a new RT, add route out to IGW for Ipv4 and v6, and associate all public subnets to this RT
What do subnets by default have disabled?
Subnets by default have “auto assign public IP” disabled. Enable it if launching public EC2s in that subnet
What do you need to disable because EC2 only allows traffic for which it itself is the source or destination but NAT needs to pass-through traffic from others?
Remember to disable “Source/Dest check” on NAT instance (Not needed on NATGW)
How do you allow traffic out via NAT?
Add a route to default RT in VPC with destination=0.0.0.0/0, target=NAT instance/NATGW
How to get IPv4 and how IPv6?
NATGW does IPv4
Egress only IGW does IPv6
What does ALB at least require?
!! ALB requires at least 2 subnets in 2 different AZs to be deployed for a VPC. Cannot have a single AZ ALB
What is recommended way for private instances to access S3 etc. without going to internet via NAT?
A VPC Endpoint
Are NACLS Stateful or stateless?
Stateless. have to open inbound and outbound separately.
Are Security groups stateful or stateless?
Stateful. therefore opening inbound opens outbound ephemeral ports as needed
Where do NACL lives?
Within one VPC, can be applied to multiple subnets but each subnet can be tied to only one NACL
What is difference between new NACL and default NACL?
Default NACL for a VPC stats with allow all
New created NACL has all inbound and outbound on DENY
How are rules applied in NACL?
In order of rule. Lower number wins in conflict –unlike IAM where most restrictive wins