概念
IAM policies
JSON documents that allow or deny actions on AWS resources, and how AWS decides between them.
このレッスンはまだ翻訳されていないため、英語で表示しています。
AWS managed policy
- Who writes it
- AWS, which also updates it
- Attached to
- Many users, groups and roles
- Best for
- Common jobs, as a starting point
Customer managed policy
- Who writes it
- You. It is a custom policy.
- Attached to
- Many users, groups and roles in your account
- Best for
- Exactly the permissions a task needs
Inline policy
- Who writes it
- You
- Attached to
- One user, group or role only
- Best for
- Permissions that belong to one identity only. They are deleted with it.
Resource-based policy
- Who writes it
- You
- Attached to
- A resource, such as an S3 bucket
- Best for
- Saying who may use the resource, even from another account
| Policy type | Who writes it | Attached to | Best for |
|---|---|---|---|
| AWS managed policy | AWS, which also updates it | Many users, groups and roles | Common jobs, as a starting point |
| Customer managed policy | You. It is a custom policy. | Many users, groups and roles in your account | Exactly the permissions a task needs |
| Inline policy | You | One user, group or role only | Permissions that belong to one identity only. They are deleted with it. |
| Resource-based policy | You | A resource, such as an S3 bucket | Saying who may use the resource, even from another account |
1 / 2
AWS managed policy
- Who writes it
- AWS, which also updates it
- Attached to
- Many users, groups and roles
- Best for
- Common jobs, as a starting point
Customer managed policy
- Who writes it
- You. It is a custom policy.
- Attached to
- Many users, groups and roles in your account
- Best for
- Exactly the permissions a task needs
| Policy type | Who writes it | Attached to | Best for |
|---|---|---|---|
| AWS managed policy | AWS, which also updates it | Many users, groups and roles | Common jobs, as a starting point |
| Customer managed policy | You. It is a custom policy. | Many users, groups and roles in your account | Exactly the permissions a task needs |
2 / 2
Inline policy
- Who writes it
- You
- Attached to
- One user, group or role only
- Best for
- Permissions that belong to one identity only. They are deleted with it.
Resource-based policy
- Who writes it
- You
- Attached to
- A resource, such as an S3 bucket
- Best for
- Saying who may use the resource, even from another account
| Policy type | Who writes it | Attached to | Best for |
|---|---|---|---|
| Inline policy | You | One user, group or role only | Permissions that belong to one identity only. They are deleted with it. |
| Resource-based policy | You | A resource, such as an S3 bucket | Saying who may use the resource, even from another account |
概要
A policy is a document, written in the JSON text format, that sets permissions. Each statement in it has an effect (Allow or Deny), the actions it covers, the resources they apply to and, if needed, conditions, such as “only when the user signed in with MFA”. AWS denies every request from a user or role unless a policy allows it, and an explicit deny always wins.
概要
Most policies are identity-based: you attach them to a user, a group or a role. AWS managed policies are written and kept up to date by AWS for common jobs. Customer managed policies are custom policies that you write yourself and can attach to many identities. An inline policy belongs to exactly one identity and is deleted with it.
A resource-based policy is attached to a resource instead, such as a bucket policy on an Amazon S3 bucket. It names who may use the resource, and that can include identities in other AWS accounts.
覚えること
- Statement = effect + action + resource, plus an optional condition.
- Everything starts denied. An explicit Deny overrides any Allow.
- AWS managed policies are a quick start, but often broader than a task needs.
- Customer managed policies let you grant exactly what a task needs.
覚えること
- Attach policies to groups and roles rather than to single users.
- Service control policies (SCPs) in AWS Organizations set the most that users and roles in an account can do. They never grant permissions.
試験では
- “A policy created and maintained by AWS” is an AWS managed policy. “A reusable policy that you write for your own needs” is a customer managed policy.
- “One policy allows the action and another policy denies it” means the request is denied.
混同しやすいもの
- Principle of least privilegeGive every user, role and application only the permissions it needs for its task, and nothing more.
AWS OrganizationsManages many AWS accounts as one organization, with central policies and a single bill.
- IAM users, groups and rolesThe identities in an AWS account, the credentials each one has, and when to use which.