VPC Flashcards
What are the 6 important parts of a VPC? What is the role of each?
- Subnet (s) - allows you to place resources within specific networks
- Security Group (s) - default way to allow traffic into a subnet
- Network ACL (s) - Optional extra security for your subnet
- Route Tables - Provides path from your subnet to other subnets or the internet
- Internet Gateway - Provides a path to the internet from a subnet.
- NAT Gateway - allows access to the internet from a private subnet.
Can a subnet span an availability zone?
no. A subnet must always be on one AZ
What important thing must you do with a custom create public and private subnets in a VPC?
Set autoassign IPV4 to True for the public subnet and False for the private subnet (s)
Which 2 entities in VPCs allow Internet access?
Internet Gateways
- Allow access to the internet. They are associated with VPCs, and from within a public subnet, you create a route table to the internet gateway.
NAT Gateways
- Used by private subnets to access the internet. You add them to the route table associated with the private subnet, and they point to the internet gateway and allow access out to the internet, but not into the private subnet. Note that NAT gateways are created in a public subnet.
Describe this diagram and talk about its parts.
Items in the network diagram
- A VPC (Virtual Private Cloud)
- Two Subnets, one private and one public.
- One Security Group per subnet
- One Network ACL per subnet
- One route Table Per subnet
- Private subnet route table has a route table entry pointing to the NAT gateway which is connected to the Internet gateway to allow access to the internet
- Public subnet route table has a route out to 0.0.0.0/0 mapped to the internet gateway allowing access out to the internet
Match up the terms and explain.
Security Group
Network ACLs
match to
Stateful
Stateless
- Security Groups are stateful. If you open up a port into a security group its open both ways
- Network ACLs are stateless. You’d need to open access in each direction, inbound and outbound
Is access blocked or open by default with Security Groups? What about Network ACLs? What about when you add a security group or NACL?
- Default
- Security Groups are Closed by default. You must open the ports you want open.
- Network ACLs are Open by default. You can block the ports you want blocked, both directions
- Custom Created
- Security Groups are Open
- NACLs are Closed
How many subnets can a Network ACL be associated with?
One or many. This is an optional layer of security for your VPC, set up by port.
Every subnet must be associated with a Network ACL.. If you don’t its associated with your DEFAULT network ACLs
How are the rules in NACLs evaluated?
They are evaluated from smallest to largest. the first rule is the wildcard which denies everything
What can you do with a Network ACL that you cant do with a Security group?
You can block IP addresses
Whats the weird thing you have to do about outbound ports in NACLs with web servers
You can open up “ephemeral ports” for 1024-65535. This covers responses on random ports that web servers might make.
What happens in an NACL when you create a rule number 300 that is a DENY on port 80 when you also have a rule number 200 which is an ALLOW for port 80?
The higher number does NOT override the earlier rule. We’ve allowed traffic on port 80 at rule 200, so anything after rule 200 won’t override that.
When blocking an IP address, how would you do it?
Use NACL’s. Create an inbound rule BEFORE any ALLOW rules for that port, and enter a deny on that IP address
What are VPC endpoints for?
Allows you to connect from your VPC into other AWS resources without leaving the AWS network
What are the two types of VPC Endpoints?
Interface: Support many more services, It’s an ENI
Gateways: Dynamo and S3 only - Creates a gateway machine similar to a NAT Gateway
What would the steps be to grant access to an EC2 instance in a private subnet to a DynamoDB database using VPC Endpoints?
Create the VPC Endpoint (Gateway)
Ensure the route table is updated to include a route to this VPC endpoint
What is VPC Peering?
Allows you to connect VPCs together. lets them act as if they were in the same network.
What is transitive peering?
Its not supported. Its allowing a VPC to indirectly connect to another one. VPCs that are peered must be directly connected.
Can you VPC Peer across regions? Across Accounts?
Yes and yes!
Are there caveats with VPC peering?
CIDR ranges cannot overlap.