သဘောတရား
STS, role switching and cross-account access
AWS STS hands out temporary credentials when a trusted identity assumes a role.
ဒီသင်ခန်းစာကို မြန်မာဘာသာ မပြန်ရသေးလို့ အင်္ဂလိပ်လို ပြထားပါတယ်။
- 1The developer asks STS to assume the role in account B.
- 2STS checks the role’s trust policy and returns temporary credentials.
- 3The developer calls S3 with them. The role’s permissions policy decides what is allowed.
AssumeRole
- Caller
- IAM user or role
- Typical use
- Cross-account access, role switching
AssumeRoleWithSAML
- Caller
- User signed in at a SAML provider
- Typical use
- Workforce federation
AssumeRoleWithWebIdentity
- Caller
- User signed in with OIDC
- Typical use
- App users, through Cognito
| API | Caller | Typical use |
|---|---|---|
| AssumeRole | IAM user or role | Cross-account access, role switching |
| AssumeRoleWithSAML | User signed in at a SAML provider | Workforce federation |
| AssumeRoleWithWebIdentity | User signed in with OIDC | App users, through Cognito |
ဘာလဲ
AWS Security Token Service (AWS STS) issues temporary credentials: an access key, a secret key and a session token. You get them by assuming a role. The role has two policies. The trust policy says who may assume it. The permissions policy says what the session can do. A caller in another account also needs an identity policy that allows sts:AssumeRole.
ဘာလဲ
Pick the call by where the caller signed in. AssumeRole is for IAM users and roles, including cross-account access. AssumeRoleWithSAML is for users who signed in at a SAML identity provider. AssumeRoleWithWebIdentity is for users who signed in with OpenID Connect, such as a social login. For mobile apps, use Amazon Cognito instead of calling it yourself.
A session lasts one hour by default. You can set a role maximum from 1 to 12 hours. Role chaining, where one role assumes another, is capped at one hour. In the console, switching roles is the same call. When you switch, you give up your own permissions and take the role’s.
ဘာလဲ
When a third party acts in your account, add an external ID to the trust policy as a condition. It stops the confused deputy problem, where another customer of the same vendor tricks the vendor into using your role.
မှတ်ထားရန်
- Trust policy: who may assume. Permissions policy: what they can do.
- Cross-account: a role in the target account, and an AssumeRole allow in the source account.
- Default session 1 hour. Role maximum 1 to 12 hours. Role chaining: 1 hour at most.
- AssumeRoleWithSAML for SAML. AssumeRoleWithWebIdentity for OIDC.
မှတ်ထားရန်
- External ID defends against the confused deputy problem when a vendor uses your role.
- AWS Organizations creates OrganizationAccountAccessRole in each account it creates.
စာမေးပွဲမှာ
- “Developers in account A need temporary access to a bucket in account B” points to a cross-account role with sts:AssumeRole.
- “A third-party vendor assumes a role in our account” points to an external ID in the trust policy.
- “A session must last longer than one hour” points to the role maximum session duration, up to 12 hours, and not role chaining.
ဒါတွေနဲ့ မရောပါနဲ့
- Users, groups and roles: authorization modelPick the identity by who needs access, and cap what administrators can hand out.
- Federating identities into IAMMatch the sign-in source to the right federation path: staff, app users or Active Directory users.
- Resource-based policiesA policy attached to the resource that names who may use it, including other accounts and services.
ဒီ task ထဲမှာ · 1.1
- Shared responsibility model
- Root user and MFA
- Users, groups and roles: authorization model
- Policy evaluation and conditions
- Least privilege in practice
- STS, role switching and cross-account access
- Resource-based policies
- Service control policies
Organizations
Control Tower
IAM Identity Center
- Federating identities into IAM
Directory Service
RAM
- Regions and AZs as the HA building block
- Placing resources