概念
Principle of least privilege
Give every user, role and application only the permissions it needs for its task, and nothing more.
本课尚未翻译,暂以英文显示。
- 1A new identity starts with no permissions. Add only what its task needs.
- 2After some time, look at which permissions were really used.
- 3Remove the permissions, keys and identities that nobody uses.
分步说明
- 1A new identity starts with no permissions. Add only what its task needs.
- 2After some time, look at which permissions were really used.
- 3Remove the permissions, keys and identities that nobody uses.
Least privilege is a loop, not a one-time setup.
A reporting app reads sales files
- Too much access
- Full access to every S3 bucket
- Least privilege
- Read access to the sales bucket only
A finance analyst checks monthly costs
- Too much access
- Administrator access
- Least privilege
- Read-only access to billing information
A developer tests new code
- Too much access
- Administrator in every account
- Least privilege
- Permissions in the test account only
An employee leaves the company
- Too much access
- Their password and access keys still work
- Least privilege
- Their access is removed on their last day
| Task | Too much access | Least privilege |
|---|---|---|
| A reporting app reads sales files | Full access to every S3 bucket | Read access to the sales bucket only |
| A finance analyst checks monthly costs | Administrator access | Read-only access to billing information |
| A developer tests new code | Administrator in every account | Permissions in the test account only |
| An employee leaves the company | Their password and access keys still work | Their access is removed on their last day |
1 / 2
A reporting app reads sales files
- Too much access
- Full access to every S3 bucket
- Least privilege
- Read access to the sales bucket only
A finance analyst checks monthly costs
- Too much access
- Administrator access
- Least privilege
- Read-only access to billing information
| Task | Too much access | Least privilege |
|---|---|---|
| A reporting app reads sales files | Full access to every S3 bucket | Read access to the sales bucket only |
| A finance analyst checks monthly costs | Administrator access | Read-only access to billing information |
2 / 2
A developer tests new code
- Too much access
- Administrator in every account
- Least privilege
- Permissions in the test account only
An employee leaves the company
- Too much access
- Their password and access keys still work
- Least privilege
- Their access is removed on their last day
| Task | Too much access | Least privilege |
|---|---|---|
| A developer tests new code | Administrator in every account | Permissions in the test account only |
| An employee leaves the company | Their password and access keys still work | Their access is removed on their last day |
是什么
Least privilege means granting only the permissions needed to do a task. If a reporting application only reads one Amazon S3 bucket, its role should be able to read that bucket and nothing else. Then a stolen credential or a simple mistake can do much less damage.
You apply it with IAM groups, roles and policies. Start with no access, add what the task needs, and check again over time. AWS managed policies are a quick way to start, but they are written for every customer, so move to customer managed policies once you know what the task needs.
是什么
IAM helps you find what to remove. Last accessed information shows when an identity last used each service it is allowed to use. IAM Access Analyzer can generate a policy from the actions that a role has used.
要记住
- Grant the minimum first. Add more only when it is needed.
- Give permissions through groups and roles, not to each user one by one.
- Remove unused users, roles, access keys and permissions regularly.
- Use policy conditions to narrow access further, for example to require MFA.
要记住
- Least privilege is a key practice in the security pillar of the Well-Architected Framework.
考试中
- “Grant only the permissions required to perform a task” is the principle of least privilege.
- “An application must read one S3 bucket”: allow read access to that bucket only, not full access to Amazon S3.