WEBVTT
Kind: captions
Language: en

1
00:00:00.000 --> 00:00:05.968
Welcome back to Domain 2, Security and Compliance, and task 2.3: access management.

2
00:00:05.968 --> 00:00:12.798
Last time, IAM users had long-term passwords and access keys. Today we cover two ideas that let

3
00:00:12.798 --> 00:00:17.903
you avoid them. First, IAM roles, which hand out temporary credentials.

4
00:00:17.903 --> 00:00:25.021
Second, federation and IAM Identity Center, which let our store's staff sign in once with a company

5
00:00:25.021 --> 00:00:28.400
identity and reach every AWS account they need.

6
00:00:28.800 --> 00:00:35.220
The store's web app runs on a server and needs to read product images from S3.

7
00:00:35.220 --> 00:00:42.957
The quick fix is to paste an access key into the code. But keys in code or on disk get copied,

8
00:00:42.957 --> 00:00:50.858
and a leaked key keeps working until someone revokes it. Rotating it means editing every server.

9
00:00:50.858 --> 00:00:57.608
A role avoids all of that: nothing is stored, the credentials expire on their own,

10
00:00:57.608 --> 00:01:00.900
and you change permissions in one place.

11
00:01:01.300 --> 00:01:08.142
An IAM role is an identity with permissions, but no password and no access keys.

12
00:01:08.142 --> 00:01:15.241
It isn't tied to one person; anyone trusted can assume it. A role has two policies.

13
00:01:15.241 --> 00:01:23.024
The trust policy says who may assume it: an IAM user, an AWS service such as EC2 or Lambda,

14
00:01:23.024 --> 00:01:30.208
a federated user, or another role. The permissions policy says what the role can do.

15
00:01:30.208 --> 00:01:33.800
Think of it as a hat you wear for a while.

16
00:01:34.200 --> 00:01:39.556
Assuming a role is a request to the AWS Security Token Service, or STS.

17
00:01:39.556 --> 00:01:45.591
STS checks the role's trust policy, then returns temporary security credentials:

18
00:01:45.591 --> 00:01:52.532
an access key ID, a secret access key, and a session token. They last from minutes to hours,

19
00:01:52.532 --> 00:01:59.019
and when they expire, AWS no longer accepts them. There's nothing to rotate or revoke,

20
00:01:59.019 --> 00:02:04.300
and the caller can ask for fresh credentials while it's still allowed.

21
00:02:04.700 --> 00:02:12.068
Back to the web app. The store creates a role that can read the images bucket and attaches it

22
00:02:12.068 --> 00:02:19.595
to the EC2 instance through an instance profile, at launch or later. The app now gets temporary

23
00:02:19.595 --> 00:02:25.617
credentials from the instance automatically, and they refresh by themselves.

24
00:02:25.617 --> 00:02:33.144
An instance has one role at a time, shared by its apps. On the exam: never store access keys on

25
00:02:33.144 --> 00:02:35.600
an EC2 instance. Attach a role.

26
00:02:36.000 --> 00:02:41.320
Roles also work across accounts. The store keeps production in one account,

27
00:02:41.320 --> 00:02:47.916
and its auditor, Dana, works in another. Production creates a role called AuditReadOnly whose

28
00:02:47.916 --> 00:02:53.591
trust policy names the audit account. Dana assumes it and gets read-only access,

29
00:02:53.591 --> 00:02:58.840
with no shared passwords or keys. Roles also let AWS services act for you:

30
00:02:58.840 --> 00:03:05.578
a service role lets Lambda write to DynamoDB, and service-linked roles are predefined and owned

31
00:03:05.578 --> 00:03:06.500
by a service.

32
00:03:06.900 --> 00:03:12.080
As the store grows, creating an IAM user for every employee gets messy.

33
00:03:12.080 --> 00:03:18.938
Federation fixes that. AWS trusts an outside identity provider, such as the company directory.

34
00:03:18.938 --> 00:03:26.234
An employee signs in there as usual, the provider vouches for them using SAML 2.0 or OpenID Connect,

35
00:03:26.234 --> 00:03:32.874
and AWS lets them assume a role with temporary credentials. There's no IAM user per person,

36
00:03:32.874 --> 00:03:38.200
and when someone leaves, the directory removes their access in one place.

37
00:03:38.600 --> 00:03:44.882
AWS recommends IAM Identity Center for workforce access. You enable it in your AWS Organizations

38
00:03:44.882 --> 00:03:50.509
management account and choose an identity source: its own directory, Active Directory,

39
00:03:50.509 --> 00:03:56.987
or an external identity provider. Staff sign in once to the AWS access portal and see every account

40
00:03:56.987 --> 00:04:03.203
and business app they're assigned. Admins assign permission sets, templates of permissions that

41
00:04:03.203 --> 00:04:08.700
Identity Center turns into roles in each account. Credentials are always short-term.

42
00:04:09.100 --> 00:04:14.411
Three services are easy to mix up. IAM Identity Center is for your workforce:

43
00:04:14.411 --> 00:04:21.446
employees reaching AWS accounts and business apps. Amazon Cognito is for your application's customers:

44
00:04:21.446 --> 00:04:27.033
sign-up and sign-in for web and mobile apps, including social logins like Google.

45
00:04:27.033 --> 00:04:33.310
AWS Directory Service runs Microsoft Active Directory for you, as AWS Managed Microsoft AD.

46
00:04:33.310 --> 00:04:38.276
And IAM users? Keep them for the rare cases where federation can't work,

47
00:04:38.276 --> 00:04:40.000
such as emergency access.

48
00:04:40.400 --> 00:04:45.379
Here's how the exam asks about this. An app on EC2 must reach S3 securely:

49
00:04:45.379 --> 00:04:50.627
attach an IAM role. Temporary security credentials: a role, issued by AWS STS.

50
00:04:50.627 --> 00:04:57.086
Access resources in another account: a cross-account role. Use the existing corporate directory:

51
00:04:57.086 --> 00:05:02.401
federation with SAML 2.0. Single sign-on to many accounts: IAM Identity Center.

52
00:05:02.401 --> 00:05:08.120
Sign-in for a mobile app's users: Amazon Cognito. Managed Microsoft Active Directory:

53
00:05:08.120 --> 00:05:09.600
AWS Directory Service.

54
00:05:10.000 --> 00:05:16.689
To recap: a role carries permissions but no long-term credentials. Its trust policy says who can

55
00:05:16.689 --> 00:05:22.542
assume it, and AWS STS hands out credentials that expire. Use roles for apps on EC2,

56
00:05:22.542 --> 00:05:29.022
for cross-account access, and for services acting for you. Federation lets AWS trust your own

57
00:05:29.022 --> 00:05:35.641
identity provider, and IAM Identity Center gives your workforce single sign-on across accounts.

58
00:05:35.641 --> 00:05:40.100
Next, we'll protect the data itself with encryption and secrets.
