WEBVTT
Kind: captions
Language: en

1
00:00:00.000 --> 00:00:05.665
Welcome back to Domain 2, Security and Compliance. This lesson starts task 2.3:

2
00:00:05.665 --> 00:00:12.622
access management. We'll cover two ideas. First, the root user: the all-powerful identity created

3
00:00:12.622 --> 00:00:18.933
with every AWS account, and how to lock it away. Second, IAM users, groups and policies:

4
00:00:18.933 --> 00:00:25.100
how our online store gives each person exactly the access they need, and nothing more.

5
00:00:25.500 --> 00:00:30.666
When the store opened its AWS account, it got one identity automatically:

6
00:00:30.666 --> 00:00:35.831
the root user. It signs in with the account's email address and password,

7
00:00:35.831 --> 00:00:40.926
and it has complete access to every service and resource in the account,

8
00:00:40.926 --> 00:00:47.365
including billing. If someone steals it, they control everything, even closing the account.

9
00:00:47.365 --> 00:00:54.300
So the root user is locked away, and everyday work happens through an administrative user instead.

10
00:00:54.700 --> 00:01:01.410
A few tasks still need the root user. For a standalone account: changing the root email address,

11
00:01:01.410 --> 00:01:06.442
root password or root access keys, and closing or reopening the account.

12
00:01:06.442 --> 00:01:11.754
Restoring permissions when the only IAM administrator locked themselves out.

13
00:01:11.754 --> 00:01:17.904
Activating IAM access to billing. Registering as a Reserved Instance Marketplace seller.

14
00:01:17.904 --> 00:01:24.963
Turning on MFA delete for an S3 bucket. Fixing an S3 bucket or SQS queue policy that denies everyone.

15
00:01:24.963 --> 00:01:27.200
And signing up for AWS GovCloud.

16
00:01:27.600 --> 00:01:33.503
So how does the store protect its root user? Turn on multi-factor authentication.

17
00:01:33.503 --> 00:01:40.426
Don't create access keys for the root user, and delete any that exist. Sign in as root only for

18
00:01:40.426 --> 00:01:45.674
those root-only tasks, and create an administrative user for daily work.

19
00:01:45.674 --> 00:01:52.597
And if the company runs many accounts with AWS Organizations, it can centrally remove root user

20
00:01:52.597 --> 00:01:58.500
credentials from member accounts altogether, so nobody can sign in as root there.

21
00:01:58.900 --> 00:02:05.784
Now the store's staff. AWS Identity and Access Management, or IAM, controls who can sign in and

22
00:02:05.784 --> 00:02:11.870
what they can do. Each person gets an IAM user with their own long-term credentials.

23
00:02:11.870 --> 00:02:17.305
Instead of granting permissions one by one, the store puts users in groups:

24
00:02:17.305 --> 00:02:24.261
Developers, Billing and Admins, and attaches policies to each group. Ana inherits the Developers

25
00:02:24.261 --> 00:02:29.623
permissions. Chloe is in two groups and gets both. Groups hold only users,

26
00:02:29.623 --> 00:02:31.000
never other groups.

27
00:02:31.400 --> 00:02:38.142
Permissions are written as policies, which are JSON documents. Each statement has an Effect,

28
00:02:38.142 --> 00:02:43.418
Allow or Deny. An Action, the API calls it covers, such as s3 GetObject.

29
00:02:43.418 --> 00:02:48.768
A Resource, the specific items, identified by their Amazon Resource Name.

30
00:02:48.768 --> 00:02:54.704
And an optional Condition, for when the statement applies, such as only with MFA.

31
00:02:54.704 --> 00:03:00.200
This one lets a user read product images from one bucket, and nothing else.

32
00:03:00.600 --> 00:03:06.724
Policies come in three kinds. AWS managed policies are written and maintained by AWS,

33
00:03:06.724 --> 00:03:13.640
like ReadOnlyAccess: quick to use, but often broader than a job needs. Customer managed policies

34
00:03:13.640 --> 00:03:19.548
are written by you, so you can make them precise and reuse them across many users,

35
00:03:19.548 --> 00:03:26.320
groups and roles. Inline policies are embedded in a single identity and deleted along with it.

36
00:03:26.320 --> 00:03:32.300
Whichever you use, follow least privilege: grant only the permissions a task needs.

37
00:03:32.700 --> 00:03:38.915
How does AWS decide? Every request starts denied. This is called an implicit deny.

38
00:03:38.915 --> 00:03:45.129
First, AWS looks for an explicit Deny in any policy that applies. If it finds one,

39
00:03:45.129 --> 00:03:50.586
the answer is deny, no matter how many Allows exist. If there's no Deny,

40
00:03:50.586 --> 00:03:56.497
AWS looks for an Allow. If one matches, access is granted. If nothing matches,

41
00:03:56.497 --> 00:04:04.000
the request stays implicitly denied. Remember the rule: an explicit deny always overrides an allow.

42
00:04:04.400 --> 00:04:10.322
Console users have a password, and an account password policy sets its length,

43
00:04:10.322 --> 00:04:16.851
complexity, expiry and reuse rules. MFA adds something you have to something you know:

44
00:04:16.851 --> 00:04:23.760
a passkey or security key, an authenticator app, or a hardware token. For the CLI and SDKs,

45
00:04:23.760 --> 00:04:30.972
users get access keys: an access key ID and a secret key. Never share them or put them in code,

46
00:04:30.972 --> 00:04:35.300
rotate them, and prefer temporary credentials from roles.

47
00:04:35.700 --> 00:04:42.611
Two IAM tools help the store audit. The IAM credential report lists every user in the account

48
00:04:42.611 --> 00:04:49.374
with the status of their credentials: passwords, access keys, and whether MFA is turned on.

49
00:04:49.374 --> 00:04:54.874
IAM Access Advisor shows last accessed information: which services a user,

50
00:04:54.874 --> 00:05:01.785
group, role or policy can reach, and when each was last used. Permissions that are never used

51
00:05:01.785 --> 00:05:02.900
can be removed.

52
00:05:03.300 --> 00:05:10.002
Here's how the exam asks about this. Only the root user can: think account-level tasks such as

53
00:05:10.002 --> 00:05:15.635
changing the root email or closing a standalone account. Protect the root user:

54
00:05:15.635 --> 00:05:21.624
MFA and no access keys. Same permissions for many users: an IAM group with a policy.

55
00:05:21.624 --> 00:05:27.969
Grant only what's needed: least privilege. Deny and Allow both apply: explicit deny wins.

56
00:05:27.969 --> 00:05:33.245
Audit credentials and MFA: the credential report. Find unused permissions:

57
00:05:33.245 --> 00:05:34.600
IAM Access Advisor.

58
00:05:35.000 --> 00:05:40.611
To recap: the root user has complete access, so turn on MFA, skip access keys,

59
00:05:40.611 --> 00:05:47.588
and use it only for root-only tasks. Everyday access goes through IAM. Users get permissions from

60
00:05:47.588 --> 00:05:52.840
groups and policies, written in JSON with an Effect, Action and Resource.

61
00:05:52.840 --> 00:05:59.314
Policies can be AWS managed, customer managed or inline, and an explicit deny always wins.

62
00:05:59.314 --> 00:06:05.500
Next, we'll replace long-term keys with IAM roles, federation and IAM Identity Center.
