Module 2 - Account Security Flashcards

1
Q

What is AWS IAM?

A

AWS Identity & Access Management, a web service that helps you securely control access to AWS resources.

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

What is an IAM user? How many can you have per AWS account?

A

An entity that allows people to sign in to the Management Console (or CLI) to make requests. These exist within one AWS account but each has its own credentials.

5000 users per account max.

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

What do you need to access the Management Console or CLI?

A

A user with a username and password, and up to 2 access keys.

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

How do you grant permissions to an IAM user? E.g. I need to give a dev access to a resource. How would I go about doing that?

A
  • Make it a member of a user group that has appropriate permission policies attached. (This is the recommended method.)
  • Attach policies to the user
  • Clone the permissions of an existing IAM user, which automatically makes the new user a member of the same user groups and attaches all the same policies
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a security principal?

A

An entity that can request an action or operation on an AWS resource, e.g. IAM user. It can also be a service or an identity outside of AWS (such as Google login).

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

What is a root user?

A

The user with complete access to services and resources. NOT for day-to-day operations. This account cannot be restricted.

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

What is the principle of least privilege?

A

Grant users only the level of access they require and nothing more.

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

How do you manage access in AWS, broadly?

A

You create policies and attach them to users, groups of users, roles, or to specific services.

Note: a group is not an identity itself and cannot be a principal in a policy.

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

How are most policies stored in AWS? I.e. what format?

A

As JSON.

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

What is a federated user?

A

An external identity that does not have an AWS account. You assign it a role to grant temporary access.

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

When do you need an access key ID and secret access key?

A

When you need programmatic access, such as API calls or using the CLI. If you are just using the Management Console then you only need a username and password.

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

Why might you use the AWS CLI?

A

You can control multiple AWS services from the command line and automate them through scripts.

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

What is an IAM role?

A

A way to deliver temporary credentials. Users can assume a role without sharing credentials, and permissions are only valid when operating under that role. Like limited sudo access to AWS.

Commonly used to allow EC2 instances or Lambda to call services on your behalf.

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

How do you assume an IAM role? How is access granted when you assume a role?

A

Use the console or CLI and use the AssumeRole API. This calls AWS Security Token Service (AWS STS) which provides a temporary access key ID, a secret access key, and a security token. Then you use those credentials to access resources.

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

What are the different policy types? There are 4.

A
  • Identity-based policies – users, groups, and roles.
  • Resource-based policies – E.g. Amazon S3 bucket policies and IAM role trust policies.
  • AWS Organizations Service Control Policies (SCPs) – define the maximum permissions for account members of an organization or organizational unit (OU).
  • IAM permissions boundaries - set the maximum permissions that an IAM entity can receive.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is an identity-based policy?

A

A document that controls what actions a user can perform, on what resources, under what conditions.

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

What kinds of identity-based policies are there?

A

Managed: standalone policies that you attach to multiple users/groups/roles, managed by AWS or the customer.

Inline: Policies that you add directly to a single user, group, or role. These maintain a strict one-to-one relationship between a policy and an identity.

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

How does a resource-based policy work?

A

They grant the principal permission to do specific actions under specific circumstances. These are inline policies, never managed.

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

What is AWS KMS?

A

AWS Key Management Service. The main purpose is to store and manage encryption keys that encrypt your data outside of AWS KMS.

20
Q

What is the difference between AWS KMS and secrets manager?

A

AWS Secrets Manager is an AWS service that encrypts and stores your secrets, and transparently decrypts and returns them to you in plaintext.
It’s designed especially to store application secrets, such as login credentials, that change periodically and should not be hard-coded or stored in plaintext in the application. In place of hard-coded credentials or table lookups, your application calls Secrets Manager.

Secrets Manager integrates with AWS Key Management Service (AWS KMS) to encrypt every version of every secret value with a unique data key that is protected by an AWS KMS key. This integration protects your secrets under encryption keys that never leave AWS KMS unencrypted

Secrets Manager uses the plaintext data key and the Advanced Encryption Standard (AES) algorithm to encrypt the secret value outside of AWS KMS. It removes the plaintext key from memory as soon as possible after using it.

21
Q

Which is better, inline or customer-managed policy?

A

An inline policy is one that you create and embed directly to an IAM group, user, or role.

Inline policies can’t be reused on other identities or managed outside of the identity where they exist.

As a best practice, use customer-managed policies instead of inline policies.

22
Q

What is included in a policy? When you look at a policy JSON, what are the individual parts?

A

CARPE(S)

  • Sid (statement ID, optional)
  • Effect – Allow or Deny access.
  • Principal (required in only some circumstances) – If you create a resource-based policy, you must indicate the account, user, role, or federated user to which you want to allow or deny access. If you are creating an IAM permissions policy to attach to a user or role, you cannot include this element. The principal is implied as that user or role.
  • Action – a list of allowed actions
  • Resource (required only in some circumstances) – If you create an IAM permissions policy, you must specify a list of resources to which the actions apply. If you create a resource-based policy, this element is optional. If you do not include this element, the resource to which the action applies is the resource to which the policy is attached.
  • Condition – Specify the circumstances.
23
Q
What does this policy do? 
{
"Effect":"Deny", 
"Action": [ 
"dynamodb:*",
"s3:*”
], 
"NotResource": 
[ "arn:aws:dynamodb:region:account-number-without-hyphens:table/EXAMPLE-TABLE", "arn:aws:s3:::DOC-EXAMPLE-BUCKET", "arn:aws:s3:::DOC-EXAMPLE-BUCKET/*”
] }
A

Denies access to any resource in Amazon Simple Storage Service (Amazon S3) or Amazon DynamoDB, except for three listed resources

24
Q

What does this policy do?
{
“Version”: “2012-10-17”,
“Statement”: [ {
“Effect”: “Allow”,
“Action”: [
“ec2:StartInstances”, “ec2:StopInstances”
],
“Resource”: “arn:aws:ec2:::instance/*”,
“Condition”: { “StringEquals”: {
“ec2:ResourceTag/Owner”: “${aws:username}” } } } ] }

A

Grants the user permission to start and stop instances, only if the EC2 owner tag matches the username of the entity making the call.

25
Q

What is the IAM Access Analyzer?

A

A service that identifies resources that are shared with external principals. You can use this to identify unintended access to your resources and data.

26
Q

How do permission boundaries work?

A

You can set the maximum permissions that an identity-based policy can grant to an IAM entity. An entity’s permissions boundary allows it to perform only the actions that are allowed by BOTH its identity-based policies and its permissions boundaries.

27
Q

What is an IdP?

A

Identity Provider. Works like OAuth. You can configure your AWS accounts to integrate with your IdP using SAML.

28
Q

What is AWS SSO?

A

Single Sign-On: central access management and user permissions for:
• all AWS accounts
• third-party software as a service (SaaS), applications, applications integrated with AWS SSO
• custom applications that support SAML 2.0.

29
Q

Why would you use multiple AWS accounts?

A
  • Improve security
  • Limit impact in case of unauthorized access
  • Simplify management to different environments
30
Q

How do you easily manage multiple AWS accounts?

A

AWS Organizations.

31
Q

What is an SCP?

A

Service Control Policy (Organization level). Like an IAM but it never grants permissions. An SCP defines a guardrail, or sets limits, on the actions that the account’s administrator can delegate to the IAM users and roles in the affected accounts. The administrator must still attach identity-based or resource-based policies to IAM users or roles, or to the resources in your accounts to actually grant permissions.

32
Q

What is the difference between AWS Organizations and AWS Control Tower?

A

AWS Organizations enables you to manage your environment across multiple accounts centrally.
AWS Control Tower automates many of the steps required to build your environment and govern at scale

33
Q

IAM user groups can contain other groups. True or False?

A

False. IAM User Groups can contain only IAM Users.

34
Q

What is the consistency of IAM users? When you create a user, is it immediately available or eventually consistent?

A

Eventually consistent.

35
Q

What is the “scope” of an IAM user?

A

Global. Not limited to your region.

36
Q

What is the default setting of an IAM user?

A

You can log in, but you have access to nothing.

37
Q

What is the best practice for applying permissions to many users who perform the same job role?

A

Add the users to an IAM Group and apply a permissions policy to the group

38
Q

What kinds of MFA are available?

A

Virtual MFA device (google auth, Authy)
Universal 2nd Factor (U2F) physical key
3rd party key fob

39
Q

What is IAM Credentials Report?

A

Lists all your account users and the status of their credentials.

40
Q

What is IAM Access Advisor?

A

Shows service permissions granted to a user and when the user accessed a service last. (USER level, not account). This is a good place to review and revise policies.

41
Q

When you first download a file (like the key pair for SSHing into your EC2 instance), what is the permission setting?

A
  1. That is too open for a security key. To change from CLI:

chmod 0400

42
Q

We need to give AWS Console access to developers. We must use identity federation and role-based access control. Currently, the roles are already assigned using groups in the corporate Active Directory.

What services can provide developers access to the AWS console? (Name TWO.)

A

IAM Roles (not IAM groups because they are not currently IAM users)

AWS Directory Service AD Connector (not Simple AD since you can’t manage user accounts and memberships with it)

43
Q

A Lambda function is storing sensitive database and API credentials. How can this information be secured to prevent other developers in the team, or anyone, from seeing these credentials in plain text? Select the best option that provides maximum security.

A

Create a new KMS key and use it to store and encrypt the sensitive information.

Lambda does encrypt env variables using KMS, but when the Lambda function is invoked it decrypts them and it is visible to the code (and therefore anyone with access to the Lambda console). You can use encryption helpers in KMS to keep things encrypted.

44
Q

We got DDoS attacked. What should we do?

A

AWS Shield Advanced.

45
Q

What is the best method to quickly and temporarily deny access from specified IP addresses outside the VPC?

A

Modify the NACL associated with public subnets to deny access from the specific IP block.