VPC Flashcards

1
Q

What is an EIP?

A

An Elastic IP address is a static IPv4 address designed for dynamic cloud computing. By using an Elastic IP address, you can mask the failure of an instance or software by rapidly remapping the address to another instance in your account. An Elastic IP address is allocated to your AWS account, and is yours until you release it.

An Elastic IP address is a public IPv4 address, which is reachable from the internet. If your instance does not have a public IPv4 address, you can associate an Elastic IP address with your instance to enable communication with the internet. For example, this allows you to connect to your instance from your local computer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a VPC endpoint (vpce)?

A

An endpoint allows instances in a subnet to access services outside the subnet. These services are either AWS services such as a S3 or Dynamodb or other services you may have created yourself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an Internet Gateway (igw)?

A

An internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows communication between your VPC and the internet.
An internet gateway serves two purposes: to provide a target in your VPC route tables for internet-routable traffic, and to perform network address translation (NAT) for instances that have been assigned public IPv4 addresses. An Internet Gateway allows resources within your VPC to access the internet, and vice versa.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a NAT gateway?

A

You can use a network address translation (NAT) gateway to enable instances in a private subnet to connect to the internet or other AWS services, but prevent the internet from initiating a connection with those instances.
It allows resources in a private subnet to access the internet (think yum updates, external database connections, wget calls, OS patch, etc). It only works one way. The internet at large cannot get through your NAT to your private resources unless you explicitly allow it.
- Security Groups cannot be associated with a NAT Gateway
- You’ll need one in each AZ since they only operate in a single AZ

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How many IGWs per VPC?

A

Only one can be associated with each VPC

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How many NAT gateways in a Region?

A

One per AZ - for redundancy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Relationship between a VPC/IGW/NAT/SUBNET?

A

An IGW is per VPC and it allows internet traffic to and from the VPC.
A NATGW is deployed in a public subnet inside the VPC
Instances in the public and private subnets can route traffic to the NATGW from their respective subnets
The NATGW routes traffic to the Internet via the IGW attached to the VPC
NATGWs are AZ resilient - HA inside an AZ (but if whole AZ fails then it would fail)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a Route table?

A

A route table contains a set of rules, called routes, that are used to determine where network traffic from your subnet or gateway is directed.

  • Your VPC has an implicit router
  • Each subnet in your VPC must be associated with a route table
  • You can explicitly associate a subnet with a particular route table, otherwise, the subnet is implicitly associated with the main route table.
  • A subnet can only be associated with one route table at a time, but you can associate multiple subnets with the same subnet route table.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Difference between IGW and NATGW?

A
  • IGW allows trafficto be initiated from the internet into your VPC and vice-versa, by default
  • NATGW allows traffic to be initiated only one way - from subnet to Internet - not the other way round
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What CIDR notation should you choose when creating a VPC?

A
  • A large enough address range to support the needed subnets
  • Any CIDR range between /16 and /28 can be chosen.
    source: LinkedIn Learning
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Can subnets span AZs?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Can VPCs span AZs?

A

Yes - since VPCs can comprise of multiple subnets and each subnet could be in its own AZ theoretically.
Source: myself

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Manage by DNS - explain this?

A

Do not be IP-aware, rely on DNS as much as possible.

Source: LinkedIn Learning

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a Transit Gateway?

A

AWS Transit Gateway connects VPCs and on-premises networks through a central hub

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the difference between NACL and Security Groups?

A
  • NACLS has explicit ALLOW and DENY rules and are stateless
  • SGs DENY everything by default, needs ALLOW rules
  • SGs evaluate all the rules in them before allowing a traffic whereas NACLs do it in the number order, from top to bottom.
  • NACLs are used where resources are not involved and subnets are involved
  • When SGs are supported on a resource use SGs (reduces number of rules and complexity)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a Security Group?

A
  • They are firewall rules attached to an instance (ENI)
  • They can only ALLOW and not explicitly DENY traffic. - Anything not ALLOW’ed is DENY’ed.
  • Separate INBOUND and OUTBOUND rules can be specified.
  • They are stateful - if you send a request from your instance, the response traffic for that request is allowed to flow in regardless of inbound security group rules.
  • Responses to allowed inbound traffic are allowed to flow out, regardless of outbound rules.
  • Security group rules enable you to filter traffic based on protocols and port numbers.
17
Q

How many SGs per instance?

A

Can have up to 5. Can be increased upon request.

18
Q

What is VPC Peering?

A
  • A way to connect two VPCs

- is not transitive (A->B, B-> C does not imply A->C)

19
Q

What is a Gateway Endpoint (GWE)?

A

A private connection between a VPC and an AWS resource like S3 or DynamoDB. Only S3 and DynamoDB use GEs. All other AWS services use Interface Endpoints.

20
Q

What is AWS PrivateLink?

A

AWS PrivateLink provides private connectivity between VPCs and services hosted on AWS or on-premises, securely on the Amazon network. By providing a private endpoint to access your services, AWS PrivateLink ensures your traffic is not exposed to the public internet

21
Q

What is an Interface Endpoint?

A

An interface endpoint is an elastic network interface with a private IP address from the IP address range of your subnet. It serves as an entry point for traffic destined to a supported AWS service or a VPC endpoint service

It is not HA since it is associated with the subnet unlike a GWE which is HA and associated with the VPC, so put IEs in every AZ you have

IEs use DNS, not simple routing (like a GWE) to resolve to the private IP of the IE which then routes the traffic to the AWS service you are trying to reach to

22
Q

What is a Virtual Private Gateway (VPGW)?

A

The VPN concentrator on the Amazon side of the Site-to-Site VPN connection. You use a virtual private gateway or a transit gateway as the gateway for the Amazon side of the Site-to-Site VPN connection.

23
Q

What are Flow Logs?

A

It is for capturing networking traffic metadata in your network, they don’t capture data (ie not a packet sniffer)

  • Apply them at VPC level
  • apply at subnet level
  • NIC level
  • not real time
  • can be used to log to S3 or CW
24
Q

What does enableDnsHostnames do?

A

If set to true, gives instances DNS names

25
Q

What does enableDnsSupport do?

A

Enables DNS resolution in a VPC

26
Q

What is the IP address of DNS in a VPC?

A

Base IP address + 2 so: 10.0.0.0 -> DNS host is: 10.0.0.2

provided by Route53

27
Q

How many DHCP options set per VPC?

A

1 per VPC, flows to all subnets

28
Q

Can an EC2 instance see its own public address?

A

No. The OS of an EC2 instance has no clue about its public address. It only sees the private IPV4 address. The IGW handles comms on behalf of an EC2 instance that has a public IP by keeping a look up table.

29
Q

What are NACLs?

A
  • Network Access Control List
  • Rules for traffic entering/leaving subnets
  • Can explicitly ALLOW or DENY
  • applied only to Subnet, not other resources
  • One subnet = one NACL at a time
  • use with SGs to add explicit DENYs
30
Q

What are ephemeral ports?

A

When webserver wants to communicate to user’s browser an ephemeral port is used, between 1024-65535 on the user’s desktop

31
Q

Can NATGWs have security groups applied on them?

A

No. Only NAT Instances you stand up yourself as an EC2 instance can have SGs on them.

32
Q

What is WAF

A

Web Application Firewall
- Layer 7 Firewall
- understands HTTP and HTTPS
- Complex application layer attacks like SQL injection or Cross site scripting, Geo blocks, Rate awareness
- WEBACL integrated with ALB, APIGW, and CloudFront
-

33
Q

What is Shield?

A

Protect from DDoS

  • Shield Standard - comes free with R53 or CloudFront
  • Layer 3 and 4 protection against DDoS

Shield Advanced $3000/pm

  • Protects EC2, ELB, CloudFront, Global Accelerator and R53
  • 24/7/365 Advanced response team
  • Financial insurance against increased AWS costs
34
Q

What is CloudHSM

A

True “single tenant” Hardware Security Module
- Tamper-resistant piece of hardware
- AWS provisions it but customer manages it
- Federal Information Processing Standard (FIPS) compliant - FIPS-140-2 L3 compliant
(KMS is L2 overall some L3)

Use Industry standard Cryptography - PKCS-11, JCE (java cryptography) or CryptoNG (microsoft) to access the cluster

CloudHSM - VPC - deploy multiple HSM in multiple AZs for HA, they replicate keys between all the HSM modules in the cluster

HSM ENI is injected into your VPC so you can access them
CloudHSM client is installed on the EC2 instances for access to the HSM appliances

35
Q

Cloud HSM use cases

A
  • No native integration between CloudHSM and AWS products so no SSE-S3
  • Offload SSL/TLS processing for Webservers (efficient)
  • Enable Transparent Data Encryption (TDE) for Oracle Databases
  • Protect private keys for an issuing Certificate Authority (CA)