IAM, Accounts, and AWS Orgs Flashcards

1
Q

What are the 3 types of identity policies in AWS?

A
  1. IAM
  2. USER
  3. ROLE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a Policy Document created with?

A

JSON

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

What is a policy document?

A

One or more statements which contain permit or deny actions to products/features/services for an identity which uses/consumes that policy.

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

What are the 4 categories in a Policy Document?

A
  1. Statement ID - what it does
  2. Effect - permit/deny
  3. Action - operation you’re trying to perform
  4. Resource - service or product being used/communicated with q
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

REVIEW:

You can have overlapping statements in a policy document, but an Explicit Deny statement trumps everything else.

A

By default, there is an Implicit Deny at the bottom of the statement, denying access to everything i.e the statement starts off with no access to AWS.

Deny, Allow, Deny

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

What are the 2 main types of policies? (Hint: it’s how they are applied)

A
  1. Inline - assigned individually to IAM account; good for exceptional rights/access to a specific user/group/role.
  2. Managed - policy is created as an object for which user/group/role will point to to then gain access to whatever they need to have access to.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the 2 types of Managed Policies?

A
  1. AWS Managed

2. Customer Managed

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

What is a Principal?

A

A physical person, application, device or process within IAM which wants to authenticate with AWS.

IAM will Authenticate (makes sure the Principal is what it says it is) and then Authorize (attach appropriate policy/statement).

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

What is an Amazon Resource Name (ARN)?

A

Method of uniquely identifying resources in AWS. This is required when provisioning resources.

Ex. arn:aws:s3:::sportsgifs (where double colon skips the field)

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

How many IAM Users per AWS account?

How many groups can an IAM User be part of?

A

5000 users per account.

10 groups per user.

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

What is a IAM Group?

A

A container for IAM Users and/or a way to organize IAM users.

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

REVIEW

IAM users can be part of multiple IAM groups. Policies can be attached INLINE or MANAGED, where Users within a group can also have separate policies assigned via INLINE or MANAGED.

A

If a user is in multiple groups, they will get the policy associated with that group AND they will also have the policies assigned to them directly.

AWS merges all of these policies into a set of permissions for a specific users.

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

True/False: Can you “nest” within a Group?

A

No - you can’t have a group within another group.

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

How many groups can a single AWS account contain?

A

300 max.

If more are required, you can open a support ticket to get approval for more Groups.

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

True/False: Can a Group be a Principal?

A

No - Groups are not a true “identity”

You can grant access to users within a group, but you can’t grant permissions to a group where all the users in that group suddenly have access.

Ex - you can’t create a resource policy for an S3 bucket and then apply it to the Developers Group, where the Dev Group is the acting “Identity” or Principal.

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

When is an IAM Role used?

A

When there is an unknown number of entities and/or multiple principles.

Permissions are borrowed for a finite amount of time i.e the policy/credentials are temporary and do not stay with the user/app/service as opposed to a IAM User.

17
Q

What are the 2 types of policies that can attach to an IAM Role which give the user consuming that Role access?

A

Trust Policy - permit/deny which identities can assume the Role.

Permission Policy - dictates what the identity assigned to the Role is allowed to access/do.

18
Q

What are the temporary credentials called when assigning permissions to a Role?

A

Secure Token Service (STS)

Once the task is completed the credentials are discarded.

19
Q

REVIEW

The most common use case for IAM Roles is for AWS Services . Services are set up in your account and then need access rights or permissions to perform actions or run certain functions.

Ex. - You enabled LAMBDA in your environment, and upload your code to it. Lambda then is required to run it’s functions instructed via the code upload - like starting or stopping a set of EC2 instances - which requires permissions to do.

Lambda will assume an IAM Role which enables it to work with EC2 to create/tear down instances.

A

A trust-policy is assigned which “trusts” Lambda, and a permission-policy is assigned to grant Lambda access to the services or resources that it needs to access.

Roles are always the preferred method for invoking services in AWS to do something on your behalf. This way, you don’t have to provide any static credentials, the service will get temp credentials via the Role that it get assigned.

20
Q

What IAM policy would you use when prompting users to create an account to access a new service?

A

IAM Role - this way you don’t have to set up individual IAM Users (5K user maximum per account), but rather, they can use their AD credentials to sign into the Role associated with that service.

This is called “ID Federation”

21
Q

What is the hierarchy for AWS Organizations? i.e Which account is at the top and what falls beneath it?

A

The Root Account is the top of the tree.

You can then have a Master account.

Then within that Member accounts and Organizational Units.

22
Q

What is a Service Control Policy (SCP)?

A

A feature within AWS Orgs that restrict what Member accounts within an AWS Org can do - they basically outline permission boundaries.

SCPs are inherited top-down - if they’re placed @ Root level, all accounts in the Org are affected.

23
Q

Which account is never affected by an SCP?

A

Master Account i.e this account cant be restricted.

24
Q

REVIEW

SCPs by themselves don’t grant permissions - they just lay the boundaries on what is/isn’t allowed in Accounts. You can either Whitelist (Allow List) or Blacklist (Deny List) services. Deny List is Default and much easier to manage in AWS i.e grant access to all but Deny specific things.

A

The full set of permissions that an Identity in an AWS account gets is the overlap of:

  1. any direct identity policies (Inline or Managed)
  2. SCPs on that account

That’s how we can deny access to certain services, even to a Root User. An Identity policy might allow something within an Account but a portion of it might be beyond what the SCP attached allows.

** think of the picture of 2 circles overlapping **

25
Q

What is a CloudWatch Log?

A

A regional service that allows you to store/monitor/access log data from AWS Services (Logging Sources) which gather the data (Log Events) into the repository.

26
Q

What is a Log Group?

A

Multiple Log Streams coming from the same Source type are grouped together i.e 20 different streams from 20 x EC2 instances could be organized into a Log Group.

27
Q

What is CloudTrail?

A

Service that logs API calls/actions, which are called Events, that affect any AWS accounts.

Any action taken by a User, Role, or Service from a management (control plane) or data (data plane) perspective.

28
Q

REVIEW

CloudTrail (just like Cloudwatch Logs) is a REGIONAL Service i.e it will only log trails within that isolated region that it’s created in. Because services in AWS are split into Regional and Global services, any Global service will automatically log data trails into US-EAST-1 N. Virginia.

A

The types of Trails are:

One Region Trail - always isolated to 1 region; you’d have to manually create a trail in every region

All Regions Trail - encompasses all the regions in AWS and auto-updated when AWS creates new regions (new DCs)

29
Q

How long are Trails (CloudTrail) stored for by default? How do you get around this if needed?

A

90 days.

Integrate Trails with CW Logs or store them into a centralized S3 bucket where the files get compressed and can be stored indefinitely.

30
Q

What two policies are assigned to an IAM Role?

A

Trust Policy

Permission Policy

31
Q

What functionality is provided by CloudTrail?

A

account-wide Auditing and API-logging

32
Q

What is Role Switching?

A

Assuming a Role in another AWS account to access that account via the console UI, without having to leave from the Account (like the Master Account) that you’re currently in.

33
Q

Policy Summary:

A

You manage access in AWS by creating policies and attaching them to IAM identities (users, groups of users, or roles) or AWS resources. A policy is an object in AWS that, when associated with an identity or resource, defines their permissions. AWS evaluates these policies when an IAM principal (user or role) makes a request. Permissions in the policies determine whether the request is allowed or denied. Most policies are stored in AWS as JSON documents. AWS supports six types of policies: identity-based policies, resource-based policies, permissions boundaries, AWS Organizations SCPs, ACLs, and session policies.