Access & Networking Control Flashcards

1
Q

What is the purpose of EC2 Instance Metadata?

A

To allow an EC2 instance to learn about itself, such as instance ID, without needing IAM permissions.

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

What is the URL for EC2 Instance Metadata?

A

http://169.254.169.254/latest/meta-data

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

Can you retrieve IAM policy from EC2 metadata?

A

No, only IAM Role name is available, not the policy.

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

What is the difference between metadata and user data on EC2?

A

Metadata is instance information; user data is a launch script run once at boot.

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

What is the difference between IMDSv1 and IMDSv2?

A

IMDSv1 allows direct metadata access; IMDSv2 requires a session token for improved security.

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

How do you use MFA with the AWS CLI?

A

Use the STS GetSessionToken API to generate temporary credentials.

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

What is the command to get temporary credentials using MFA in AWS CLI?

A

aws sts get-session-token –serial-number <mfa-arn> --token-code <code> --duration-seconds 3600</code></mfa-arn>

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

Which programming languages are supported by AWS SDK?

A

Java, .NET, Node.js, PHP, Python (boto3), Go, Ruby, C++.

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

Which SDK does AWS CLI use internally?

A

Python SDK - boto3.

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

What region is used by default if not configured in SDK?

A

us-east-1.

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

What is Exponential Backoff used for in AWS?

A

To handle intermittent throttling errors with retries after increasing delays.

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

What should you do for consistent API throttling?

A

Request a service limit increase.

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

What are example API rate limits in AWS?

A

EC2 DescribeInstances: 100 calls/sec; S3 GET: 5500 per second per prefix.

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

What is the AWS CLI credentials provider chain order?

A
  1. CLI options 2. Env vars 3. CLI credentials file 4. CLI config file 5. ECS container creds 6. EC2 instance profile.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the AWS SDK default credentials provider chain?

A
  1. Java properties 2. Env vars 3. Credentials file 4. ECS container creds 5. EC2 instance profile.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

In a scenario where environment variables are used on an EC2 instance, why might it override instance profile permissions?

A

Because environment variables have higher priority in the credentials provider chain.

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

What is the top AWS credential management best practice?

A

Never store AWS credentials in your code.

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

How should credentials be managed inside AWS?

A

Use IAM roles: EC2 roles, Lambda roles, ECS roles.

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

How should credentials be managed outside AWS?

A

Use environment variables or named profiles.

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

What is SigV4 in AWS?

A

It’s the signing process used to authenticate AWS HTTP requests.

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

When do you need to manually use SigV4?

A

When making direct HTTP API calls without the SDK or CLI.

22
Q

Do AWS CLI and SDK sign requests automatically with SigV4?

A

Yes, they handle the signing process automatically.

23
Q

What is a VPC?

A

A Virtual Private Cloud, a private network in AWS to deploy resources.

24
Q

What is a subnet?

A

A partition of a VPC’s network; tied to an Availability Zone.

25
Q

What is the difference between public and private subnets?

A

Public subnets can access the internet; private subnets cannot.

26
Q

What component allows subnets to access the internet?

A

Internet Gateway for public subnets; NAT Gateway for private subnets.

27
Q

What is an Internet Gateway?

A

Allows instances in a VPC to connect to the internet.

28
Q

What is a NAT Gateway?

A

Allows instances in private subnets to access the internet while remaining unreachable from it.

29
Q

What is a NACL?

A

A subnet-level firewall that allows or denies traffic.

30
Q

What is a Security Group?

A

An instance-level firewall that only allows traffic.

31
Q

How do NACLs and Security Groups differ?

A

NACLs are stateless and support DENY rules; Security Groups are stateful and support only ALLOW rules.

32
Q

What is the purpose of VPC Flow Logs?

A

To capture information about IP traffic going to and from network interfaces in a VPC.

33
Q

Where can VPC Flow Logs send data?

A

Amazon S3, CloudWatch Logs, or Kinesis Data Firehose.

34
Q

What is VPC Peering?

A

A private connection between two VPCs using the AWS network.

35
Q

Can VPC peering be transitive?

A

No, VPC peering is not transitive.

36
Q

What is a VPC Endpoint?

A

Allows private access to AWS services from your VPC.

37
Q

What are the two types of VPC Endpoints?

A

Gateway (for S3/DynamoDB) and Interface (for other services).

38
Q

What is Site-to-Site VPN?

A

Encrypted VPN over the internet connecting on-premises to AWS.

39
Q

What is AWS Direct Connect?

A

A private, fast, secure physical connection from on-premises to AWS.

40
Q

Which connection goes over the public internet?

A

Site-to-Site VPN.

41
Q

Which connection is private and takes longer to set up?

A

AWS Direct Connect.

42
Q

What is a NAT Gateway used for?

A

Providing internet access to private subnets.

43
Q

What are NACLs and where are they applied?

A

Network Access Control Lists applied at the subnet level.

44
Q

What are Security Groups and where are they applied?

A

Instance-level firewalls applied to EC2 or ENI.

45
Q

What are VPC Flow Logs used for?

A

Monitoring IP traffic and troubleshooting network issues.

46
Q

Can you peer VPCs with overlapping CIDRs?

A

No, VPC peering requires non-overlapping CIDR blocks.

47
Q

What does LAMP stand for?

A

Linux, Apache, MySQL, PHP.

48
Q

Where does Apache run in the LAMP stack?

A

On EC2, serving as the web server.

49
Q

Where is the database hosted in a typical LAMP architecture on AWS?

A

Amazon RDS with MySQL.

50
Q

Which AWS service can be added for caching in LAMP?

A

Amazon ElastiCache.

51
Q

Where is application logic and data stored in EC2?

A

On an EBS volume (root or additional).