IAM policies decide which identities may perform actions on AWS resources. Roles provide temporary access, while trust policies, resource policies and permission limits determine how that access is granted.
The root user
Every AWS account starts with a root user: the email address and password used to create it, with complete access to everything in the account. That power makes it the most valuable credential to protect, and AWS recommends keeping it locked away for the few tasks only it can do.
How it works
- Sign up: the root user exists, and MFAAuthentication that uses an additional independent factor beyond the initial sign-in credential. is enforced for it.
- Create an administrative user for daily work, for example in IAM Identity Center.
- Lock the root user away: a strong password, MFA, no access keys, and safe recovery details.
- Sign in as root only for root-only tasks.
- In AWS Organizations, the management account can remove member accounts’ root credentials altogether.
Tasks that require the root user:
| Area | Root-only task |
|---|---|
| Account | Change a standalone account’s email, root password or root access keys; close or reopen a standalone account |
| IAM | Restore permissions when the only administrator removed their own |
| Billing | Activate IAM access to the Billing and Cost Management console |
| Amazon EC2 | Register as a seller in the Reserved Instance Marketplace |
| Amazon S3 | Enable MFA delete; edit a bucket policyA document that defines permissions or permission limits for requests. that denies all principalsThe identity making a request or receiving a permission grant. |
| AWS GovCloud (US) | Sign up |
Exam cues
- If the question says first steps after creating an account, think enable MFA on root and create an administrative user.
- If the question says close the account or change the root email, think root user.
- If the question says daily administration, think an administrative user, never root.
Remember
- Root has complete access; it can’t be limited by IAM policies in its own account.
- MFA is enforced for root users.
- Never create root access keys.
Trap: Most account settings, such as the account name, contact details and Regions, don’t need the root user. Only the listed tasks do.
Da documentação da AWS (12)
- The AWS account root user is the single sign-in identity created with the account, with complete access to all AWS services and resources; it signs in with the email address and password used to create the account.
- AWS strongly recommends not using the root user for everyday tasks, and using it only for tasks that require root user credentials.
- Instead of the root user, create an administrative user for everyday tasks, such as an administrative user in IAM Identity Center.
- MFA is enforced for the root user of all account types; the customer adds the MFA device at account creation or when prompted at sign-in.
- Root user best practices include a strong password, MFA on sign-in, not creating access keys for the root user, and securing the account recovery mechanisms.
- With AWS Organizations, centralized root access lets the management account remove root user credentials from member accounts; new member accounts then have no root user credentials by default.
- Root-only account tasks include changing a standalone account's email address, root password and root access keys, closing a standalone account, reopening a closed account, and restoring permissions when the only IAM administrator revoked their own.
- Root-only tasks also include activating IAM access to the Billing and Cost Management console, registering as a seller in the Reserved Instance Marketplace, enabling MFA delete on an S3 bucket, editing an S3 bucket policy that denies all principals, and signing up for AWS GovCloud (US).
- AWS recommends alerting on root user sign-in and use, for example with an Amazon EventBridge rule that detects root user activity and notifies administrators through Amazon SNS.
- The root user best practices describe the sign-in alert both as an Amazon CloudWatch Events rule that notifies the security administrator and as an Amazon EventBridge rule with Amazon SNS.
- AWS recommends a business-managed group email address for the root user, so messages from AWS reach several people even when someone is away.
- Each account can have up to three alternate contacts, for billing, operations and security, which can be distribution lists; the root email still receives all messages.
Users, groups, and policies
IAM controls who can do what in an AWS account. Users are identities for people, groups collect users, and policies hold the permissions. The principle of least privilegeGranting only the permissions needed for the task. decides how much those policies allow.
How it works
- Create identities. AWS prefers roles and IAM Identity Center users with temporary credentials; an IAM user has long-term credentials.
- Collect users with the same job into a group.
- Attach policies to the group, user or role. A policyA document that defines permissions or permission limits for requests. lists allowed or denied actions on resources.
- Start from AWS managed policies, then narrow them into customer managed policies that give only what each job needs.
Exam cues
- If the question says many users need the same permissions, think IAM group, because a group policy gives its permissions to each user in the group.
- If the question says only the permissions needed for a task, think least privilege, because it limits actions on specific resources under specific conditions.
- If the question says a friendly IAM user sign-in URL, think account alias, because it replaces the numeric account ID in the URL.
- If the question says store a server certificate, think AWS Certificate Manager (ACM), because it is preferred; use IAM in Regions ACM does not support.
Remember
- Prefer temporary credentials (roles) over long-term IAM user keys.
- For IAM users with long-term credentials, require MFAAuthentication that uses an additional independent factor beyond the initial sign-in credential., update access keys and remove unused users and credentials.
- An IAM user belongs to one account. Credentials: console password, access keys, both, or none yet when created through the CLI or API.
Trap: AWS managed policies do not always grant least privilege. They cover common use cases and can grant more than a specific task needs.
Da documentação da AWS (9)
- An IAM user group is a collection of IAM users; policies attached to the group give its permissions to every user in it.
- Least-privilege permissions grant only the permissions required for a task, by defining the actions allowed on specific resources under specific conditions.
- AWS recommends starting with AWS managed policies for common use cases and moving toward least privilege with customer managed policies, because AWS managed policies may grant more than a specific use case needs.
- AWS recommends that human users and workloads use temporary credentials, such as IAM roles, instead of IAM users with long-term passwords and access keys.
- IAM best practices include requiring MFA for IAM users and the root user, updating access keys when long-term credentials are needed, and regularly removing unused users, roles, permissions and credentials.
- An account alias replaces the numeric account ID in the IAM user sign-in URL with an easier name.
- ACM is the preferred place for SSL/TLS server certificates; IAM can also store server certificates, and must be used in Regions that ACM does not support.
- An IAM user is an identity in one AWS account with a name and credentials; you choose a console password, access keys or both, and a user created through the CLI or API starts with no credentials.
- An IAM Action value combines a service namespace and an operation name, such as s3:GetObject; wildcards can match several operations.
Credentials and MFA
Credentials prove who is calling AWS. People sign in to the console with passwords and MFAAuthentication that uses an additional independent factor beyond the initial sign-in credential.; programs use access keys or, better, temporary credentials from roles. Fewer long-term credentials mean less to leak.
How it works
- Passwords sign people in to the console. An account password policyA document that defines permissions or permission limits for requests. sets complexity and rotation for IAM users.
- MFA adds a device check to sign-in. Passkeys and security keys resist phishing best; authenticator apps generate time-based codes.
- Access keys sign CLI, SDKA programming library that helps an application call AWS service APIs. and API calls. They are long-term, so AWS prefers roles, which hand out temporary credentials.
- Application secrets, such as database passwords, belong in AWS Secrets Manager or Systems Manager Parameter Store, not in code.
- Single sign-on: IAM Identity Center signs a person in once, with MFA, to every account they are assigned.
| Credential | Used for | Protect it with |
|---|---|---|
| Password | Console sign-in | Password policy, MFA |
| Access keys | CLI, SDK, API calls | Prefer roles; at most two per user; never share |
| Temporary credentials (roles) | People and workloads | Expire automatically |
| Application secrets | Database passwords, API keys | Secrets Manager, Parameter Store |
Exam cues
- If the question says require a second factor at sign-in, think MFA.
- If the question says password length and rotation rules, think account password policy.
- If the question says store and rotate database credentials, think AWS Secrets Manager.
- If the question says one sign-in for many accounts, think IAM Identity Center.
Remember
- Up to eight MFA devices per user; one is enough to sign in.
- Up to two access keys per user; the secret shows only once.
- The password policy skips the root user and access keys.
- MFA types: passkeys and security keys, virtual MFA app, hardware TOTP token.
Trap: Rotating a password does not rotate access keys. They are separate credentials; disable or rotate keys on their own.
Da documentação da AWS (13)
- Multi-factor authentication (MFA) requires a user to provide unique authentication from a device in addition to their sign-in credentials; it can protect the root user and IAM users.
- AWS recommends phishing-resistant MFA such as passkeys and security keys, FIDO-based authenticators that resist phishing, man-in-the-middle and replay attacks better than TOTP options.
- The root user and each IAM user can register up to eight MFA devices of any type, and need only one to sign in.
- An account password policy sets complexity requirements and mandatory rotation periods for IAM user passwords; without one, the default AWS password policy applies.
- The IAM password policy does not apply to the root user password or to IAM user access keys.
- Access keys are long-term credentials, an access key ID plus a secret access key, used to sign programmatic requests to the AWS CLI or API.
- The secret access key can be retrieved only when the key is created; if it is lost, delete the key and create a new one. A user can have at most two access keys.
- AWS recommends temporary security credentials, such as IAM roles, instead of long-term access keys.
- IAM Identity Center gives users MFA-protected single sign-on access to their assigned AWS accounts, with identities managed in Identity Center or a SAML 2.0 identity provider.
- AWS Secrets Manager manages, retrieves and rotates database credentials, API keys and other secrets, replacing hard-coded credentials with a runtime call.
- AWS Systems Manager Parameter Store securely stores, organizes and retrieves configuration data as named parameters, so applications don't hardcode values.
- IAM supports three MFA types: passkeys and security keys (FIDO), virtual MFA apps on a phone or computer, and hardware TOTP tokens.
- A FIDO security key is a physical device, such as a YubiKey, plugged into the computer; a hardware TOTP token is a separate device that displays a six-digit code; a virtual MFA device is an app on a phone or computer.
IAM roles basics
An IAM role gives temporary permissions to whoever is allowed to assume it, such as an AWS service, an application or a federated user.
How it works
- Create a role with permission policies.
- Say who may assume it, such as EC2 or a federated user.
- The identity assumes the role and gets temporary credentials.
Exam cues
- If the question says give an AWS service or app permissions without stored keys, think an IAM role.
- If the question says employees sign in with a corporate directory, think federationUsing authentication from an external identity system to obtain AWS access..
Remember
- Roles use temporary credentials.
- Federation is preferred over IAM users for people.
Trap: A role is not tied to one person and has no long-term password or keys.
Da documentação da AWS (5)
- An IAM role is an identity with permissions that anyone or anything allowed can assume, such as a service or application, and it provides temporary credentials instead of long-term keys.
- AWS recommends identity federation with temporary credentials for people, and IAM users with long-term keys only for use cases federation does not support.
- An instance profile is the container that passes an IAM role to an EC2 instance.
- Applications retrieve temporary role credentials from EC2 instance metadata.
- EC2 updates temporary credentials before expiration; SDK instance profile credential providers can retrieve and refresh them.
IAM policy types and review tools
IAM offers different policyA document that defines permissions or permission limits for requests. types and tools to manage and review permissions. User groups help administrators organize users as their jobs change.
How it works
- Choose a policy type for the identity.
- Place users in groups. When someone changes jobs, remove the user from the old groups and add them to the new ones.
- Review credential status with the credential report, and use last accessed information to identify unused permissions.
- Test a simulated request with the IAM policy simulator, without sending a real request to a service.
| Policy type | Managed by | Attachment |
|---|---|---|
| AWS managed | AWS; customers cannot modify it | Many identities |
| Customer managed | You create and edit it | Many identities |
| Inline | You create it | One user, group or role |
Exam cues
- If the question says a reusable policy you can edit, think customer managed policyA standalone identity policy reusable across several identities., because it can be attached to many identities.
- If the question says a person changes jobs, think changing their group memberships, because an administrator can move the user from the old groups to the new ones.
- If the question says audit users’ passwords, access keys and MFAAuthentication that uses an additional independent factor beyond the initial sign-in credential., think credential report, because it lists their status for all account users.
- If the question says remove unused service permissions, think last accessed information, because it shows service usage for an identity or policy.
- If the question says test whether a request would be allowed, think policy simulator, because it evaluates a simulated request.
Remember
- A user can belong to multiple groups; groups contain only users and cannot be nested.
- There is no default group containing all users.
- The policy simulator can test identity-based policies, permissions boundaries, service control policies and resource-based policies.
Trap: An AWS managed policy cannot be edited by customers. For an editable policy shared by multiple identities, use a customer managed policy.
Da documentação da AWS (11)
- AWS managed policies are standalone policies created and administered by AWS; customers can't modify them, and they can be attached to many identities.
- Customer managed policies are standalone policies that you create for specific use cases, change as often as you like, and attach to many identities.
- An inline policy is created for a single user, group or role and keeps a strict one-to-one relationship with that identity.
- A user group can contain many users and a user can belong to multiple groups; groups can't be nested, and no default group includes all users.
- When a person changes jobs, an administrator can remove the user from the old groups and add them to the new ones instead of editing the user's permissions.
- The IAM credential report lists all users in the account and the status of their passwords, access keys and MFA devices.
- IAM last accessed information shows which services an identity or policy has actually used, to remove unused permissions and keep least privilege.
- IAM user groups cannot be nested: a group contains only users, and one user can belong to several groups, up to an account quota.
- The IAM policy simulator tests identity-based policies, permissions boundaries, SCPs and resource-based policies against a simulated request, without sending a real request to any service.
- An external analyzer uses an account or organization as its zone of trust and reports supported resources shared outside it.
- External access analysis covers resources in the analyzer Region; create analyzers in each Region with supported resources.
Identities, roles, and instance profiles
IAM identities determine who makes a request. A role supplies permissions through a temporary sessionA period of temporary access represented by credentials with an expiration time., a period during which temporary credentials are valid. An instance profileA container that passes an IAM role to an EC2 instance. connects a role to an EC2 instance so its applications can use those credentials.
How it works
- Set the role trust policyThe resource policy on a role that controls who may assume it. to identify who can assume it. Attach a permissions policyA policy defining the actions and resources an identity can use. for the actions and resources the application needs.
- Put the role in an instance profile and attach the profile to EC2. The console creates the profile for an EC2 role; CLI and API workflows create it separately.
- The application retrieves temporary credentials from instance metadataInformation available to applications on an EC2 instance, including its temporary role credentials., information available to software on the instance. An AWS software development kitA programming library that helps an application call AWS service APIs. (SDK) instance profile credential provider can refresh them as EC2 rotates them. The AWS CLI can also retrieve the attached role’s temporary credentials from metadata.
- For human access, IAM groups distribute policies to their user members. Multi-factor authenticationAuthentication that uses an additional independent factor beyond the initial sign-in credential. (MFA) adds an independent factor: a password is something known, a security key is something held, and a biometric is something inherent to the person.
- If an application still uses a user access key, create its replacement while the old key is active. Update every consumer, inspect usage, deactivate the old key, test, then delete it after confirming the transition.
Exam cues
- If the question says EC2 needs AWS access without embedded keys, think role plus instance profile, because the application can retrieve refreshed temporary credentials.
- If the question says role assumption succeeds but a read fails, think role permissions policy, because trust only authorizes assumption.
Remember
- An instance profile contains one role. A role can be in multiple profiles.
- A user can have at most two access keys, allowing old and replacement keys to overlap.
- Group policies contribute to user permissions. Groups cannot be nested or named as principalsThe identity making a request or receiving a permission grant., the authenticated identities in requests.
- Root and IAM users have separate MFA configurations.
- A CodeArtifact token needs
sts:GetServiceBearerTokenandcodeartifact:GetAuthorizationToken. An EC2 CloudWatch agent can use an instance role withCloudWatchAgentServerPolicy. - AssumeRole: one hour by default, 15 minutes up to the role maximum. Role chainingUsing one role session to assume another role.: one hour at most.
Trap: Enabling root MFA does not configure MFA for the account’s IAM users.
The instance profile exposes the role credentials through EC2 metadata.
The application uses the credentials for actions permitted by the role.
Detalhes das caixas (3)
- Role in profile
Trust controls assumption; permissions control resource access.
- EC2 application
An SDK provider retrieves and refreshes credentials from instance metadata.
- S3 bucket
Requests use temporary role credentials.
Da documentação da AWS (20)
- A role trust policy controls who may assume the role.
- A role permissions policy defines the actions and resources available through the role.
- An instance profile can contain only one role; a role can appear in multiple profiles.
- The console creates an instance profile with the same name for an EC2 role; CLI and API users create the profile separately.
- IAM groups contain users, and users receive permissions from policies attached to their groups.
- An IAM group cannot be a Principal in a resource policy.
- IAM groups cannot contain other groups.
- An IAM user can have at most two access keys.
- To rotate without interrupting applications, create a second key while the first is active, update applications, inspect old-key usage, deactivate the old key, test, and then delete it.
- MFA requires an additional authentication mechanism alongside sign-in credentials.
- A password is something you know; a security key is something you have; a biometric is something you are.
- Root and IAM users have separate credentials and MFA configurations.
- CodeArtifact authorization-token retrieval requires both sts:GetServiceBearerToken and codeartifact:GetAuthorizationToken.
- The CloudWatch agent on EC2 can use an instance role with CloudWatchAgentServerPolicy to publish data.
- Instance metadata supplies information to applications on an EC2 instance, including temporary role credentials.
- A VPC is a logically isolated virtual network.
- An AWS account can have at most 5,000 IAM users, a quota that cannot be raised.
- An IAM role can be attached to a running or stopped EC2 instance; an instance with a role must have it replaced to use a different one.
- The AWS CLI running on an EC2 instance can retrieve temporary credentials from instance metadata for the IAM role attached to that instance.
- An AssumeRole session lasts one hour by default and can be set from 15 minutes up to the role's maximum session duration; role chaining, using one role's credentials to assume another, limits the session to one hour.
Policy evaluation
IAM policyA document that defines permissions or permission limits for requests. evaluation decides whether a request has permission to perform an action on a resource. A principalThe identity making a request or receiving a permission grant. is the identity making the request. Start with the request’s action, resource and context, then find every policy that applies.
How it works
- Read each matching statement in the JSON policy document.
EffectchoosesAlloworDeny;Actionnames operations with a service prefixThe beginning of an S3 object key used to select a set of objects., such ass3:GetObject;Resourceidentifies their targets. Resource policies also name aPrincipal; identity policies imply their attached identity. - Evaluate
Condition, which compares request details with policy values. For example,DateGreaterThanandDateLessThanonaws:CurrentTimebound a permission window. - Reject the request if any applicable policy explicitly denies it. Otherwise find an allow, subjectThe identity represented by a token. to permissions boundaries, sessionA period of temporary access represented by credentials with an expiration time. limits and organization policies. Missing permission is an implicit denyThe absence of an applicable policy Allow for a request..
- For ordinary same-account access, an identity or resource policyA policy attached to a resource that specifies which principals can access it. can grant permission. Check which principal the resource policy names. Role trust and KMS key policies have their own explicit-allow requirements.
| Policy | Purpose |
|---|---|
| Identity policyA policy attached to an identity to define its allowed actions. | Grants actions to a user, group member or role |
| Resource policy | Grants access to named principals |
| Permissions boundaryA managed policy that limits what identity policies can grant a user or role. | Limits identity-policy permissions |
| Session policyA policy passed with a temporary session request to limit its identity-policy permissions. | Limits permissions for one temporary session |
| Service control policyAn organization policy that limits permissions of principals in affected accounts. (SCP) | Limits principals in affected accounts |
| Resource control policyAn organization policy that limits permissions available for resources in affected accounts. (RCP) | Limits resources in affected accounts |
An Amazon Resource NameAn identifier that uniquely names an AWS resource. (ARN) identifies a resource with arn:partition:service:region:account-id:resource. Some resources leave Region or account fields empty.
For resource matching, use the service’s ARN format:
| Resource | ARN pattern in the standard AWS partitionA separate AWS environment containing a group of Regions. |
|---|---|
| S3 bucket | arn:aws:s3:::bucket-name |
Billing console access also has an account setting. For pages governed by Activate IAM Access, the root user enables IAM access when needed, and the caller still needs an appropriate IAM policy. Organizations-created member accounts enable the setting by default.
Exam cues
- If the question says several identities need the same policy, think customer managed policyA standalone identity policy reusable across several identities., because it is reusable and an edit applies to every attached identity. Inline policies belong to one identity and are deleted with it.
- If the question says
s3:GetObjectis allowed but objects remain inaccessible, think resource ARN matching, because a bucket ARN differs from an object ARN.s3:ListBuckettargets the bucket; object actions target object paths. - If the question says a Region restriction breaks a global service, think
NotActionexceptions in theaws:RequestedRegiondeny, because global endpoints can be outside the approved Regions. - If the question says developers may launch only approved machine images (AMIs), think image ARN restrictions on
ec2:RunInstances, because that action supports image resource permissions and conditions such asec2:Owner.
Remember
- An explicit denyA matching Deny statement that overrides an Allow. wins. Root’s initial access is the exception to implicit deny, not a reason to ignore applicable controls.
- Boundaries, session policies, SCPs and RCPs grant no permissions themselves.
- Excluding an action from a
NotActiondeny does not allow it. - S3 bucket ARNs leave the Region and account fields empty.
- Activating IAM billing access does not grant billing permissions by itself.
Trap: A boundary Allow cannot substitute for a policy that grants access.
Da documentação da AWS (25)
- IAM identity-based policies are JSON documents containing one or more permission statements; AWS evaluates applicable policies when a principal makes a request.
- Requests start implicitly denied, except for the account root user.
- An applicable explicit Deny overrides Allow statements.
- For ordinary same-account access, identity and resource policy allows combine; principal-specific limits and service-specific rules still apply.
- Role trust policies and KMS key policies must explicitly allow access under their respective authorization rules.
- Identity-policy permissions must also be allowed by an attached permissions boundary.
- Applicable SCPs limit account principals and RCPs limit account resources; neither grants access.
- A customer managed identity policy is a standalone policy reusable across users, groups and roles; changing its permissions changes the policy applied to every attached identity.
- An inline identity policy belongs to one identity and is deleted with that identity.
- Effect selects Allow or Deny for a policy statement.
- Resource identifies the resources to which the operations apply, normally using ARNs.
- Resource policies identify a Principal; identity policies imply the identity to which they are attached.
- Condition tests request context against specified values.
- s3:ListBucket uses the bucket ARN; object permissions use an ARN with an object key or object wildcard.
- An Amazon Resource Name (ARN) identifies a resource using the format arn:partition:service:region:account-id:resource; the resource component is service-specific, and some resources leave the Region or account fields empty.
- DateGreaterThan and DateLessThan with aws:CurrentTime can bound access to a time window.
- A Deny using aws:RequestedRegion can restrict endpoint Regions; NotAction exempts listed global-service actions from that deny.
- A Deny statement with NotAction does not grant the excluded actions.
- ec2:RunInstances supports resource permissions on image ARNs and conditions such as ec2:Owner to restrict AMI selection.
- An AMI supplies the software required to set up and boot an EC2 instance.
- An IAM policy statement uses Effect, Action and Resource (or their Not forms); Condition is optional, and Principal is used in resource-based policies.
- The aws:SourceIp condition key compares the IP address of the caller making the API request, not the IP of the resource, and works only for public IP ranges.
- The only resource-based policy that IAM itself supports is the role trust policy, which says which principals can assume the role.
- For Billing console pages governed by Activate IAM Access, the root user enables that account setting when needed and the caller must have suitable IAM permissions; accounts created as AWS Organizations members have the setting enabled by default.
- S3 bucket ARNs leave the Region and owning-account fields empty, as in arn:aws:s3:::example-bucket.
Permissions boundaries and session policies
Permissions boundaries let an administrator delegate IAM management while limiting what identity policies may grant. A session policyA policy passed with a temporary session request to limit its identity-policy permissions. applies a further limit to a temporary sessionA period of temporary access represented by credentials with an expiration time.. Think of each as a filter on a grant.
How it works
- Attach a managed policyA standalone identity policy reusable across several identities. as the boundary of an IAM user or role. An identity-policy Allow must also be allowed by that boundary.
- When requesting a role or federated-user session, pass a session policy to narrow its identity-policy permissions. For
AssumeRole, it intersects with the role’s permissions; forGetFederationToken, it intersects with the calling user’s policies. - When delegating role creation, require
iam:PermissionsBoundaryto equal the approved policyA document that defines permissions or permission limits for requests. ARNAn identifier that uniquely names an AWS resource.. Prevent the delegate from removing the boundary or editing its policy to escape the restriction. - Inspect resource grants separately. A policy naming a user or session directly has different implicit-deny rules from one naming a role ARN.
Exam cues
- If the question says developers need to create roles within a central permission ceiling, think required boundary plus protection against removal and modification, because an editable ceiling can be escaped.
- If the question says one role session should have fewer permissions, think session policy, because it narrows that session’s identity-policy grants.
Remember
- A boundary can apply to a user or role, but not a service-linked roleA role linked to an AWS service whose trust and permissions that service defines.. It does not grant access.
- Session policies cannot add permissions to the role’s identity policies.
- Explicit denies still apply to direct resource-policy grants.
Trap: A boundary does not grant permissions. An identity policyA policy attached to an identity to define its allowed actions. must also allow the action.
Da documentação da AWS (10)
- A permissions boundary is a managed policy that limits what identity policies can grant to an IAM user or role.
- A permissions boundary grants nothing by itself.
- An identity grant must overlap the boundary Allow; an explicit Deny in either blocks access.
- Session policies passed to role or federated-user sessions limit identity-policy grants for that session.
- AssumeRole session policies cannot add to the role identity-policy permissions.
- GetFederationToken session permissions are limited by both the calling user policies and supplied session policies.
- Direct same-account grants to user or session principals have different implicit-deny rules from grants to role ARNs.
- Delegated role creation can require iam:PermissionsBoundary to equal an approved policy ARN.
- Delegates must be prevented from removing the required boundary or changing its policy to escape its limits.
- A permissions boundary cannot be set on a service-linked role.
Cross-account roles and resource policies
Cross-account access lets an identity in one AWS account use resources in another. A role changes the credentials used for the work. A resource policyA policy attached to a resource that specifies which principals can access it. shares a resource with the original principalThe identity making a request or receiving a permission grant..
How it works
- For direct resource access, give the caller an identity Allow and add a resource Allow in the owning account. AWS evaluates both sides with their applicable limits.
- For role access, allow
sts:AssumeRoleon the target role ARNAn identifier that uniquely names an AWS resource. in the caller’s identity policyA policy attached to an identity to define its allowed actions.. In the target account, create a trust policyThe resource policy on a role that controls who may assume it. that trusts the caller or its account. - STS checks the assumption request and returns temporary role credentials. Subsequent requests use the role sessionA period of temporary access represented by credentials with an expiration time. permissions, without combining the original caller permissions.
- Use the original credentials with a resource policy when retaining those permissions matters. If the service lacks resource-policy support, use a role with the permissions required for the work.
Exam cues
- If the question says cross-account role assumption fails, think caller permission and target trust, because both must authorize the assumption request.
- If the question says copy across S3 accounts while retaining original access, think bucket policyA document that defines permissions or permission limits for requests. for the original principal, because a resource grant does not switch identities.
- If the question says the service has no resource policy, think cross-account role, because its permissions can authorize the work in the target account.
Remember
- Trusting an account delegates to its administrators; they must authorize callers.
- Both sides of cross-account resource access must allow the request.
- Delegation works within one AWS partitionA separate AWS environment containing a group of Regions., the separate AWS environment containing a set of Regions.
- A
PrincipalARN cannot match part of a name with a wildcard.
Trap: Assuming a role does not inherently make copying impossible. The selected principal must have the permissions for all required source and destination operations. Its original grants are not automatically added.
Account A authorizes the caller to invoke AssumeRole on the target role.
The target trust policy in B allows assumption and STS issues credentials.
The caller accesses the bucket with the temporary role credentials.
Detalhes das caixas (4)
- Caller
The caller needs sts:AssumeRole on the target role.
- AWS STS
STS evaluates caller permission and target trust before issuing temporary credentials.
- Target role
Trust controls assumption; permissions define resource access.
- S3 bucket
The request uses the assumed role session permissions.
Da documentação da AWS (11)
- Cross-account resource access requires an Allow in the caller identity policy and the resource policy.
- AWS evaluates each side of a cross-account request separately with its applicable policy limits; both evaluations must allow access.
- A cross-account AssumeRole caller needs sts:AssumeRole permission on the target role ARN.
- The target role trust policy must trust the caller or its account for cross-account AssumeRole.
- Naming an AWS account principal delegates authority to that account; it does not directly authorize every identity in the account.
- STS returns temporary credentials for the assumed role session.
- Using an assumed role means using its permissions rather than adding the original caller permissions.
- A resource-based cross-account grant lets the original principal retain its permissions while accessing the shared resource.
- Direct sharing needs resource-policy support; a role can provide access to services that lack it.
- Cross-account roles and resource policies delegate access only within the same AWS partition.
- A Principal ARN cannot use a wildcard to match only part of a principal name or ARN.
STS sessions and role chaining
AWS Security Token Service (STS) issues temporary credentials for a sessionA period of temporary access represented by credentials with an expiration time.. Role chainingUsing one role session to assume another role. is the use of an existing role session to assume another role. Each session acts with its selected role permissions.
How it works
- Call
AssumeRolewith the target role and optionalDurationSeconds. STS returns an access key ID, secret access key, session tokenThe security token used with the access key pair in temporary AWS credentials. and expiration time. - Use that credential set for requests during the session. Retrieve replacement credentials before they expire to keep working.
- If those role credentials call
AssumeRoleagain, the new session is chained and has a one-hour maximum. - Mark session tagsA temporary key-value attribute passed into a session for access-control decisions., temporary key-value labels, as transitive if they must survive the chain. A source identityAn origin identifier attached to a role session that persists through role chaining., an origin identifier recorded in CloudTrail, also persists and cannot be changed after it is set.
Exam cues
- If the question says a chained role requests four hours, think failed assumption, because a chained API session cannot exceed one hour.
- If the question says a role has a twelve-hour maximum but no duration was requested, think one-hour session, because the default is separate from the ceiling.
- If the question says project attributes disappear on the next role, think transitive session tagsA session tag configured to persist into later role sessions., because ordinary tagsA key-value label used to describe an identity or resource. do not pass automatically.
Remember
AssumeRoledefaults to 3,600 seconds; its minimum request is 900 seconds.- The role maximum setting can range from one to twelve hours.
- A chained request above 3,600 seconds fails.
- STS offers Regional endpoints; clients can choose an alternative if the original cannot be reached.
Trap: Raising the target role maximum does not raise the role-chaining limit.
Da documentação da AWS (10)
- STS temporary credentials contain an access key ID, secret access key and session token.
- STS temporary credentials have an expiration time and must be replaced for continued access.
- AssumeRole defaults DurationSeconds to 3600 seconds, or one hour.
- AssumeRole accepts at least 900 seconds and at most the role configured maximum; the maximum setting ranges from one to twelve hours.
- Role chaining means using credentials from one role to assume another.
- A chained CLI or API role session is limited to one hour; requesting DurationSeconds greater than 3600 fails.
- An assumed session uses the role permissions rather than a combination with the caller original permissions.
- STS has Regional endpoints; a client can choose another Regional endpoint if it cannot reach the original.
- Session tags marked transitive persist through role chaining; ordinary session tags do not pass automatically.
- A source identity set on a role session persists through chaining and appears in CloudTrail activity; it cannot be changed after it is set.
SAML and OIDC federation
FederationUsing authentication from an external identity system to obtain AWS access. lets an identity providerA system that authenticates identities and supplies evidence of that authentication., the system that authenticates a person or workload, supply evidence that AWS exchanges for temporary credentials. SAMLA standard for exchanging identity authentication assertions between systems. uses an assertionA signed identity-provider statement used as evidence of authentication., a signed statement about authentication. OpenID ConnectAn identity standard whose provider tokens can be exchanged for AWS role credentials. (OIDC) uses a token describing the authenticated subjectThe identity represented by a token..
How it works
- Configure the provider and a role trust policyThe resource policy on a role that controls who may assume it.. For direct IAM SAML federation, upload the provider metadata into IAM and create the trusted role with its permissions.
- Authenticate with the provider. Exchange the SAML assertion through
AssumeRoleWithSAML, or an OIDC token throughAssumeRoleWithWebIdentity. These calls do not require AWS access keys for authentication. - For SAML console access, post the assertion to the AWS sign-in endpoint. It requests temporary credentials on the user’s behalf and redirects the browser to the console.
- Restrict OIDC trust to the provider and appropriate claimsA named field in an identity token that describes its subject or authentication context., the fields in the token.
audis its intended audienceThe intended recipient identified by an identity token.;subis its subject. For GitHub Actions, restrictaudtosts.amazonaws.comandsubto approved repositories or branches. - Use the returned temporary role credentials for AWS requests. For application users, including guests, a Cognito identity pool can provide credentials controlled by IAM roles.
| Input or need | STS operation |
|---|---|
| SAML assertion | AssumeRoleWithSAML |
| OIDC token | AssumeRoleWithWebIdentity |
| Custom broker holding IAM user credentials | GetFederationToken |
| IAM user needs MFAAuthentication that uses an additional independent factor beyond the initial sign-in credential. temporary credentials | GetSessionToken |
Exam cues
- If the question says external CI needs access without stored AWS keys, think OIDC role federation, because its token can be exchanged for temporary credentials.
- If the question says workforce authentication already produces SAML assertions, think SAML role federation, because AWS can use that identity evidence without a separate IAM user for each person.
- If the question says mobile or web users include guests who need limited AWS access, think Cognito identity pool, because it supplies role-controlled temporary AWS credentials.
Remember
- For centrally managed workforce access to multiple accounts, consider IAM Identity Center.
- SAML console federation uses the AWS sign-in endpoint.
- IAM rejects GitHub trust policies whose
token.actions.githubusercontent.com:subis absent, null or solely a wildcard.
Trap: A shared OIDC provider alone does not restrict access to your repository. Scope the audience and subject.
Exchange provider evidence through the matching STS operation.
The application uses the returned role credentials to access permitted AWS resources.
Detalhes das caixas (3)
- Identity provider
The provider authenticates the identity and issues a SAML assertion or OIDC token.
- AWS STS
AssumeRoleWithSAML or AssumeRoleWithWebIdentity checks the role trust.
- S3 bucket
Requests use temporary role credentials and are subject to role permissions.
The browser posts the identity provider's SAML assertion to AWS sign-in.
AWS sign-in obtains temporary role credentials and redirects the browser to the console.
Da documentação da AWS (16)
- Federation lets externally authenticated identities access AWS through roles without creating an IAM user for each identity.
- A SAML identity provider authenticates a user and issues an assertion; AssumeRoleWithSAML exchanges it for temporary role credentials.
- AssumeRoleWithSAML does not require AWS credentials to authenticate the call.
- OIDC federation exchanges an identity-provider token for temporary role credentials using AssumeRoleWithWebIdentity.
- AssumeRoleWithWebIdentity does not require the caller to possess AWS security credentials.
- A GitHub OIDC role trust policy names the IAM provider and restricts aud to sts.amazonaws.com and sub to approved repositories or branches.
- IAM rejects creation or update of a GitHub trust policy if token.actions.githubusercontent.com:sub is absent, null, or solely a wildcard.
- GetFederationToken supports a custom broker using an IAM user long-term credentials.
- GetSessionToken returns credentials based on the calling user permissions and can include MFA authentication information.
- Cognito identity pools issue temporary AWS credentials for authenticated or guest application users with access defined by IAM roles.
- For direct IAM SAML federation, upload provider metadata into IAM and create a role that trusts that provider with suitable permissions.
- In OIDC trust, aud identifies the intended audience and sub identifies the subject represented by the token.
- AWS recommends IAM Identity Center for centrally managing human access to multiple accounts.
- If an identity store is not compatible with SAML 2.0, a custom identity broker application can authenticate users, request temporary credentials from AWS STS and hand them to the users.
- AssumeRoleWithSAML defaults to a one-hour session; a requested duration starts at 15 minutes and is bounded by the role maximum and the assertion session limit.
- For SAML console federation, the browser posts the identity provider assertion to the AWS sign-in endpoint, which obtains temporary role credentials and redirects the browser through a console sign-in URL.
External ID and MFA conditions
External IDsA customer-specific value checked when a vendor assumes a customer role. distinguish a vendor’s customers during role assumption. They address the confused deputyA trusted service tricked into using its authority for someone other than the intended customer. problem, where someone tricks a service with legitimate authority into using it for the wrong customer. MFAAuthentication that uses an additional independent factor beyond the initial sign-in credential. conditions require extra authentication before sensitive access.
How it works
- A vendor that serves several customers assigns each a unique external ID. The customer role trusts the vendor principalThe identity making a request or receiving a permission grant. and requires a matching
sts:ExternalId. - The vendor calls
AssumeRolewith that customer’sExternalId. The condition ties the request to the customer context; the value is not an AWS secret. - For an IAM user requiring MFA, the role trust policyThe resource policy on a role that controls who may assume it. can require
aws:MultiFactorAuthPresentto be true. The caller suppliesSerialNumberandTokenCodetoAssumeRole.
Exam cues
- If the question says a vendor can be confused between its customers, think unique customer external ID in role trust, because trusting the vendor account alone does not identify its customer context.
- If the question says an IAM user must use MFA before assumption, think trust-policy MFA condition, because the assumption must satisfy that condition.
- If the question says deny non-MFA access including long-term keys, think Deny with
BoolIfExistsandaws:MultiFactorAuthPresent: false, because long-term key requests omit the key.
Remember
- External IDs are not passwords or secrets.
aws:MultiFactorAuthPresentis absent for long-term keys and federated identities. Do not assume an external provider’s MFA populates this IAM key.
Trap: A condition that only matches an existing false MFA value does not catch a request where the key is absent.
Da documentação da AWS (8)
- An external ID helps prevent a vendor serving multiple customers from being tricked into using its authority for the wrong customer, the confused deputy problem.
- The vendor assigns a unique external ID per customer and includes the correct value in AssumeRole requests.
- The customer trust policy requires the vendor principal and checks sts:ExternalId.
- AWS does not treat an external ID as a secret.
- A role trust policy can require Bool aws:MultiFactorAuthPresent true for MFA-authenticated AssumeRole.
- For MFA with AssumeRole, the caller supplies SerialNumber for the device and TokenCode for its one-time code.
- aws:MultiFactorAuthPresent is absent for long-term access-key requests and is not provided for federated identities.
- A Deny with BoolIfExists aws:MultiFactorAuthPresent false rejects non-MFA temporary requests and long-term access-key requests.
PassRole and service-linked roles
The iam:PassRole permission controls which roles a caller may supply when configuring an AWS service. The service then assumes the role to act for the customer. A service roleA role an AWS service assumes to perform work for a customer. is administrator-managed; a service-linked roleA role linked to an AWS service whose trust and permissions that service defines. has permissions defined by its linked service.
How it works
- Create a role whose permissions cover the service’s work and whose trust policyThe resource policy on a role that controls who may assume it. allows that service to assume it.
- Give the configuring caller
iam:PassRolefor the approved role ARNs. Useiam:PassedToServiceto restrict the receiving service principalThe identity of an AWS service used in a role trust policy., the service identity named in trust. - Supply the role during the service create or update operation. The service checks the caller’s permission to pass it and later uses the role.
- For a service-linked role, follow the service’s lifecycle rules. Its trust and permissions are predefined; remove related resources before deleting it.
Exam cues
- If the question says service creation works until a role is supplied, think
iam:PassRole, because configuring the service and delegating a role are separate permissions. - If the question says the role is owned by an AWS service and its permissions cannot be edited, think service-linked role, because the service defines those permissions.
- If the question says a low-privilege developer can pass an administrator role, think privilege escalationGaining authority beyond intended permissions, for example through a service using an overly powerful passed role., because the service can use that role’s permissions for the developer.
Remember
- PassRole requires the role and service to share an account. A local role can assume a separately trusted role in another account.
- PassRole has no separate API or CloudTrail event. Inspect the operation that received the role.
- AWS warns against relying on
ResourceTagto control PassRole. - SCPs do not restrict service-linked roles.
Trap: Permission to pass a role does not replace its trust policy. The receiving service still needs permission to assume it.
Da documentação da AWS (13)
- iam:PassRole authorizes a caller to supply an IAM role to an AWS service so that service can later assume it.
- PassRole can pass only a role in the same account as the service.
- The passed role trust policy must allow the receiving service to assume it.
- Limit iam:PassRole using role ARNs in Resource and iam:PassedToService for the receiving service principal.
- Passing a role with powerful permissions lets the service exercise those permissions on the caller behalf, so broad PassRole can allow privilege escalation.
- PassRole is a permission, not an API call; inspect the service create or update event that received the role instead of looking for a PassRole CloudTrail event.
- AWS warns that controlling PassRole with ResourceTag conditions does not give reliable results.
- To use a role in A from a service in B, pass a local role in B that can assume the role in A.
- A service role is an IAM role an AWS service assumes on the customer behalf; an administrator can manage it.
- A service-linked role is a service-owned role with trust and permissions predefined by that service.
- Administrators can view service-linked role permissions but cannot edit them.
- Delete resources related to a service-linked role before deleting the role.
- SCPs do not restrict service-linked role permissions.
RBAC and ABAC
Role-based access controlAuthorization based on a person's job function. (RBAC) assigns permissions by job function. Attribute-based access controlAuthorization based on attributes such as matching principal and resource tags. (ABAC) uses attributes, represented as key-value tagsA key-value label used to describe an identity or resource. in AWS. A tag such as project=payments can connect an identity’s access to the resources it should use.
How it works
- With RBAC, attach the policies for each job function to the relevant identities. With ABAC, define a comparison between principalThe identity making a request or receiving a permission grant. attributes and resource attributes.
- For supported operations, compare
aws:PrincipalTag/projectwithaws:ResourceTag/project, or the service’s supported resource-tag key. Check support for the selected service and action. - A SAMLA standard for exchanging identity authentication assertions between systems. or OIDCAn identity standard whose provider tokens can be exchanged for AWS role credentials. provider can pass identity attributes as session tagsA temporary key-value attribute passed into a session for access-control decisions..
Exam cues
- If the question says project resources grow frequently, think ABAC tag matching, because matching resources can be covered without listing each new ARNAn identifier that uniquely names an AWS resource..
- If the question says each IAM user gets an S3 home path, think a policy variableA placeholder resolved from request context when a policy is evaluated. such as
${aws:username}in the object ARN pluss3:prefixons3:ListBucket, because listing and object access use different resource scopes. - If the question says federated role access fails with that home-path policyA document that defines permissions or permission limits for requests., think unavailable
aws:username, because a role request does not have that IAM user attribute.
Remember
- A job function in RBAC is not the same thing as an IAM role.
- Provider attributes can become temporary session tags.
Trap: ABAC works only where the service and action support the tag conditions you use.
Da documentação da AWS (8)
- Role-based access control defines permissions by job function and attaches the corresponding policies to identities.
- Attribute-based access control can authorize supported operations when principal and resource tags match.
- Use aws:PrincipalTag/tag-key and the supported resource-tag condition key to compare principal and resource attributes.
- ABAC requires the selected service and action to support the relevant tag conditions.
- SAML and OIDC providers can pass identity attributes as STS session tags.
- An IAM user home-directory policy can use ${aws:username} in S3 object ARNs and s3:prefix conditions on s3:ListBucket.
- The aws:username variable is unavailable for IAM role requests, so that user home-directory example does not work unchanged for roles.
- A permission set is a collection of IAM policies used to assign account access in IAM Identity Center.
Access Analyzer
IAM Access Analyzer helps identify who can access resources, which access is unused, and how a policyA document that defines permissions or permission limits for requests. changes permissions. Its findingsA report of access identified by an analyzer for review. guide a permission review; external findings describe what policy permits, not proof that anyone used that permission.
How it works
- Choose the analysis scope. A zone of trustThe account or organization treated as trusted by an external access analyzer. is the account or organization considered trusted for external analysis. Findings describe supported resources shared outside that zone.
- Choose external, internal or unused analysis based on the question below.
- During policy authoring, run validation for grammar and AWS best practices.
- To reduce an existing user or role policy, select a CloudTrail trail and an analysis window. Provide a service roleA role an AWS service assumes to perform work for a customer. for log access, generate a template, then review its resources, conditions and missing permissions before attaching it.
| Analysis | Question answered |
|---|---|
| External | Which supported resources are shared outside the trusted account or organization? |
| Internal | Which internal principalsThe identity making a request or receiving a permission grant. can access selected supported resources? |
| Unused | Which roles, credentials, services or actions have unused access? |
Exam cues
- If the question says find resources shared outside an organization, think external analyzer with an organization zone of trust, because its findings describe external policy grants.
- If the question says build a narrower policy from application activity, think policy generation from CloudTrail, because the template uses observed services and actions.
Remember
- Policy generation can review up to ninety days of events.
- Generation needs a trail and a service role with log access.
Trap: A generated policy is a template to review. Missing actions can reflect generation limits or an unobserved operation.
Da documentação da AWS (11)
- IAM Access Analyzer evaluates access policies and provides external, internal and unused access analysis.
- Internal access analysis identifies principals inside the account or organization that can access selected supported resources.
- Unused access findings identify unused roles, user access keys, passwords, services and actions.
- Policy validation checks grammar and AWS best practices and returns errors, security warnings, warnings and suggestions.
- Custom policy checks can compare with a reference policy for new access, check specified actions or resources, or check for public access.
- Policy generation creates a policy template from a user or role CloudTrail activity, which the author reviews and customizes.
- Policy generation can analyze a specified period of up to ninety days of CloudTrail events.
- Policy generation requires a CloudTrail trail and a service role that permits access to its logs and required access information.
- Policy generation does not identify action-level activity for data events such as S3 object data events.
- Generated policies omit iam:PassRole because it is not a CloudTrail API action.
- External findings describe policy-granted access; they do not prove a principal actually exercised that access.
Resource policy principal edge cases
A resource policyA policy attached to a resource that specifies which principals can access it. grants access to the principalThe identity making a request or receiving a permission grant. it names. In one account, naming a role differs from naming a particular temporary sessionA period of temporary access represented by credentials with an expiration time.. An implicit denyThe absence of an applicable policy Allow for a request. means a policyA document that defines permissions or permission limits for requests. has no matching Allow; an explicit denyA matching Deny statement that overrides an Allow. is a matching Deny statement.
How it works
- Identify the grant recipient. A role ARNAn identifier that uniquely names an AWS resource. has the form
arn:aws:iam::account-id:role/role-name. A role session ARN has the formarn:aws:sts::account-id:assumed-role/role-name/session-name. - Apply the matching row below for a same-account resource Allow. Check applicable organization controls and explicit denies separately.
- Inspect conditions as well as
Principal. A wildcardPrincipalcombined withaws:PrincipalArndiffers from naming the role directly. With role credentials, that condition key contains the role ARN. - For cross-account access, check both the caller’s identity evaluation and the resource policy. Both accounts must allow the request.
| Resource grant recipient | Effect of an implicit deny |
|---|---|
| IAM role ARN in Principal | Boundary and session policyA policy passed with a temporary session request to limit its identity-policy permissions. can limit the grant |
| Role session ARN | Identity policyA policy attached to an identity to define its allowed actions., boundary and session policy do not limit the direct grant |
| IAM user ARN, used by that user | Identity policy and boundary do not limit the direct grant |
| Federated-user session ARN | Identity policy, boundary and session policy do not limit the direct grant |
| IAM user ARN, used by its federated session | Boundary and session policy can limit the grant |
Exam cues
- If the question says a bucket names a role session and its boundary merely omits S3, think direct session grant, because that implicit deny does not block the grant.
- If the question says the bucket names the role ARN and its boundary omits S3, think denied, because that form of grant remains subjectThe identity represented by a token. to the boundary.
- If the question says a recreated role lost a resource grant, think unique principal ID, because recreating the same name creates a new identity. A condition-key ARN is not converted to that ID and can match the recreated role.
- If an S3 policy uses
NotPrincipalwithDeny, think boundary side effect: it denies principals with boundaries even when they are listed as exceptions. UseArnNotEqualswithaws:PrincipalArnas AWS recommends. - If an IAM role trust or KMS key policy is involved, check its authorization as well as identity permissions. A KMS key policy can enable the account to delegate access through IAM rather than naming every principal.
Remember
- These implicit-deny exceptions describe same-account resource grants.
- A wildcard
Principalwith anaws:PrincipalArncondition is not limited by boundary or session-policy implicit denies. - Applicable explicit denies still win.
- An account root ARN in
Principaldelegates to the account; inaws:PrincipalArnit matches only the root user. - Partial wildcards and IAM groups cannot be used as principals.
Trap: The rule that a session ARN bypasses an implicit deny does not mean it bypasses an explicit deny.
Da documentação da AWS (19)
- Same-account resource-policy evaluation depends on the type of principal receiving the permission.
- A resource Allow naming an IAM role ARN is limited by implicit denies in its permissions boundary or session policy.
- A same-account resource Allow naming a role session ARN grants directly to the session and is not limited by implicit denies in identity policies, boundaries or session policies.
- A same-account resource Allow naming an IAM user ARN is not limited by implicit denies in that user identity policy or boundary.
- A same-account resource Allow naming a GetFederationToken federated-user ARN grants directly to the session, bypassing implicit denies in identity, boundary and session policies.
- If a resource grant names the IAM user who created a federated-user session, requests by that session remain limited by boundary and session policy implicit denies.
- An applicable explicit deny still blocks a direct resource-policy grant.
- A resource Allow using Principal wildcard and an aws:PrincipalArn condition is not limited by boundary or session-policy implicit denies; explicit denies still apply.
- For requests with role credentials, aws:PrincipalArn contains the role ARN, not the role session ARN.
- IAM converts a role ARN in Principal into its unique principal ID; deleting and recreating that role breaks the old relationship.
- IAM does not convert condition-key ARNs to principal IDs; an aws:PrincipalArn condition can therefore match a recreated role with the same ARN.
- IAM role ARNs use arn:aws:iam::account-id:role/role-name; assumed-role session ARNs use arn:aws:sts::account-id:assumed-role/role-name/session-name.
- An implicit deny is the absence of a matching Allow; an explicit deny is a matching Deny statement.
- An account root ARN in Principal delegates to the account, but the same ARN in aws:PrincipalArn matches only the root user.
- Cross-account resource access requires an Allow in both the principal account's identity evaluation and the resource account's resource-policy evaluation.
- A resource-policy Deny with NotPrincipal denies IAM principals with permissions boundaries regardless of the NotPrincipal values; AWS recommends ArnNotEquals with aws:PrincipalArn instead.
- Principal cannot use a wildcard for part of a name or ARN, and IAM groups cannot be principals.
- IAM role trust policies and KMS key policies require an explicit policy authorization, unlike the usual same-account rule that an identity or resource Allow can suffice.
- A KMS key policy can authorize the account to delegate key access through IAM policies without naming each IAM principal.
IAM operational safeguards
IAM operational safeguards help teams review policies and control how temporary credentials are used. The right check depends on the policyA document that defines permissions or permission limits for requests., the request context and the source of the sessionA period of temporary access represented by credentials with an expiration time..
How it works
- Use policy validation for grammar and AWS best practices. To detect added access, use a custom policy check against a reference policy. Custom checks can also examine specified actions or resources, or public access.
- Create external access analyzers in each Region with supported resources. Unused access findingsA report of access identified by an analyzer for review. do not depend on Region. Review and customize a policy template generated from CloudTrail activity.
- Use
GetSessionTokenwith MFAAuthentication that uses an additional independent factor beyond the initial sign-in credential. for IAM user temporary credentials carrying MFA information.aws:MultiFactorAuthAgemeasures seconds since authentication and is available only for temporary credentials created with MFA. - To restrict EC2 role credentials to their original network, compare
aws:SourceVpcwithaws:Ec2InstanceSourceVpc, andaws:VpcSourceIpwithaws:Ec2InstanceSourcePrivateIPv4. AWS’s example checks forec2:SourceInstanceARNand exempts forwarded service calls withaws:ViaAWSService. - For IAM Identity Center attribute-based access controlAuthorization based on attributes such as matching principal and resource tags. (ABAC), select and map access-control attributes. For example, map
Departmentto${path:enterprise.department}. Identity Center passes selected attributes as session tagsA temporary key-value attribute passed into a session for access-control decisions.; policies can compareaws:PrincipalTag/Departmentwith a supported resource tagA key-value label used to describe an identity or resource.. - A role receiving provider session tags needs
sts:TagSessionin its trust policyThe resource policy on a role that controls who may assume it.. Restrict the permitted tag keys and values.
Exam cues
- If the question says a pipeline must reject access beyond a baseline, think custom policy check against a reference policy, because grammar validation does not compare access.
- If the question says generated permissions omit
iam:PassRoleor S3 data-event actions, think generation limits, becauseiam:PassRoleis not a CloudTrail API action and data-event activity is not identified at action level. - If the question says EC2 credentials must stay at their original private address, think both VPCA logically isolated virtual network for AWS resources. and IP comparisons, because private addresses alone are not globally unique.
- If the question says an IAM user request lacks
aws:SourceAccount, think request context, because the key applies to qualifying direct service principalThe identity of an AWS service used in a role trust policy. calls and not every service integration uses it. - If the question says a resource Deny with
NotPrincipalblocks a role with a boundary, thinkArnNotEqualswithaws:PrincipalArn, because the Deny applies to principalsThe identity making a request or receiving a permission grant. with boundaries regardless of its exceptions.
Remember
- IAM user sessions from
GetFederationTokenandGetSessionTokendefault to twelve hours and support fifteen minutes to thirty-six hours. - Root sessions from either operation are capped at one hour.
GetSessionTokenalso defaults to one hour for root.
Trap: A generated policy omitting an action does not prove the application does not need it. Review the template and its generation limits.
Da documentação da AWS (22)
- Custom policy checks can compare with a reference policy for new access, check specified actions or resources, or check for public access.
- Policy validation checks grammar and AWS best practices and returns errors, security warnings, warnings and suggestions.
- Unused access findings do not depend on Region, so an analyzer is not needed in every Region.
- External access analysis covers resources in the analyzer Region; create analyzers in each Region with supported resources.
- Generated policies omit iam:PassRole because it is not a CloudTrail API action.
- Policy generation does not identify action-level activity for data events such as S3 object data events.
- Policy generation creates a policy template from a user or role CloudTrail activity, which the author reviews and customizes.
- GetSessionToken with MFA returns user temporary credentials with MFA authentication information.
- aws:MultiFactorAuthAge measures seconds since MFA authentication and is available only for temporary credentials created with MFA.
- Compare aws:SourceVpc with aws:Ec2InstanceSourceVpc to require EC2 role credentials to be used through an endpoint in their original VPC.
- Compare aws:VpcSourceIp with aws:Ec2InstanceSourcePrivateIPv4 along with the VPC comparison; private addresses alone are not globally unique.
- The EC2 credential restriction example checks ec2:SourceInstanceARN for presence and exempts forwarded service calls using aws:ViaAWSService.
- A resource Deny with NotPrincipal denies IAM principals with boundaries regardless of the NotPrincipal exceptions; AWS recommends ArnNotEquals on aws:PrincipalArn.
- aws:SourceAccount is included only when an AWS service principal directly calls a resource on behalf of a resource that triggered the service request; not all service integrations use the key.
- An Identity Center attribute named Department can map to the supported external-identity source value ${path:enterprise.department}.
- IAM Identity Center passes selected access-control attributes to accounts as session tags referenced through aws:PrincipalTag.
- Select attributes for access control, map source values to keys, and add ABAC rules to permission set policies or resource policies.
- Use aws:PrincipalTag/tag-key and the supported resource-tag condition key to compare principal and resource attributes.
- Roles receiving session tags from an identity provider need sts:TagSession permission in their trust policy.
- sts:TagSession permissions can restrict allowed session tag keys and values.
- GetFederationToken for IAM users defaults to twelve hours and supports fifteen minutes to thirty-six hours; root-based sessions are capped at one hour.
- GetSessionToken for IAM users defaults to twelve hours and supports fifteen minutes to thirty-six hours; root sessions default to and are capped at one hour.
Flashcards
Nada para revisar aqui agora. Escolha outros tópicos ou outro filtro.
·
Todos os 122 flashcards em lista
What is the AWS account root user, and when should it be used?
The identity created with the account, with complete access to everything in it. Use it only for the few tasks that require root credentials, never for daily work.
Name four ways to protect the AWS account root user.
- A strong password
- MFA on sign-in
- No access keys for the root user
- Daily work done by an administrative user instead
The only IAM administrator in a standalone AWS account removed their own permissions by mistake. Who can restore them?
The root user. Restoring IAM user permissions in that case is a root-only task.
Which identity must close a standalone AWS account that is not in AWS Organizations?
The root user.
Which of these tasks requires the AWS account root user: creating an IAM user, enabling MFA delete on an S3 bucket, or launching an EC2 instance?
Enabling MFA delete on an S3 bucket. The others work with IAM permissions.
What kind of email address does AWS recommend for a business account's root user?
A business-managed group email address so AWS messages reach multiple people.
Should a team create access keys for the AWS account root user so scripts can run with full access?
No. AWS recommends never creating root access keys; scripts should use roles with least-privilege permissions.
A security team wants a notification whenever someone signs in as the AWS account root user. What can it set up?
An Amazon EventBridge rule on root user activity recorded by CloudTrail, sending the alert through Amazon SNS.
Which AWS services can notify a security team when the AWS account root user signs in?
A CloudWatch Events (EventBridge) rule that matches root user sign-in, with an Amazon SNS notification.
How can an AWS account owner protect the root user credentials?
Use a strong password and multi-factor authentication, avoid root access keys and secure account recovery mechanisms.
Ten developers need the same permissions in AWS. What is the simplest way to manage them in IAM?
Put the developers in an IAM user group and attach the policy to the group. Every user in it gets the permissions.
What does the principle of least privilege mean for IAM permissions?
Grant only the permissions a task needs, on specific resources and under specific conditions.
Do AWS managed policies always give least-privilege permissions?
No. They cover common use cases and may grant more than a specific task needs. Move to customer managed policies for least privilege.
Which IAM best practices apply when a company still needs IAM users with long-term credentials?
Require MFA, update (rotate) their access keys, and regularly remove unused users and credentials.
How can an administrator give the same IAM permissions to several users?
Attach a policy to an IAM user group. Its permissions apply to every user in the group.
What does least privilege mean when granting IAM permissions?
Give only the permissions needed for the task, scoped to the relevant actions, resources and conditions.
Does every IAM user need a console password?
No. An IAM user can have a console password, access keys or both.
A user created through the CLI or API starts with no credentials.
An IAM author needs to recognize an operation such as s3:GetObject and the scope of s3:*. What do these Action values mean?
s3:GetObjectnames a service and an operation.s3:*matches the actions in that service namespace.What does multi-factor authentication (MFA) add to an AWS sign-in?
A second proof from a device the user has, such as a passkey, security key or authenticator app, on top of the password.
Which type of MFA does AWS recommend as the most secure?
Phishing-resistant MFA such as passkeys and security keys (FIDO), which resist phishing, man-in-the-middle and replay attacks.
A company wants IAM user passwords to have at least 14 characters and expire every 90 days. What does it configure?
An account password policy in IAM.
Does the IAM account password policy also apply to the root user's password?
No. It applies to IAM user passwords only, not the root user password or access keys.
What are AWS access keys used for, and what are their two parts?
They sign programmatic requests from the AWS CLI, SDKs or API. They have an access key ID and a secret access key.
What does AWS recommend using for AWS access instead of long-term access keys?
Temporary security credentials, such as IAM roles.
A company wants employees to sign in once and reach several AWS accounts with MFA. Which AWS service provides this?
AWS IAM Identity Center, which gives MFA-protected single sign-on to assigned accounts.
Where should an application store database passwords and API keys instead of hardcoding them?
In AWS Secrets Manager, which can also rotate them, or in AWS Systems Manager Parameter Store. The application reads them at run time.
Which MFA types does IAM support, and which one needs no extra hardware?
Passkeys and security keys, virtual MFA apps, and hardware TOTP tokens. A virtual MFA app runs on an existing phone or computer.
How does multi-factor authentication (MFA) help protect an AWS root or IAM user?
MFA requires authentication from a device in addition to sign-in credentials.
An application on EC2 needs to read from S3. What is the recommended way to give it permissions?
Attach an IAM role to the instance, so the app gets temporary credentials instead of stored access keys.
Employees already sign in to a corporate identity provider. How should they get access to AWS?
Through identity federation, which gives them temporary credentials by assuming roles, instead of creating IAM users.
An EC2 application needs AWS credentials without storing access keys in its machine image. What should the team attach?
An IAM role through an instance profile. Use an SDK instance profile credential provider to retrieve and refresh temporary credentials.
What are the three kinds of identity-based policies in IAM?
- AWS managed: created and maintained by AWS, can't be edited
- Customer managed: you create and edit them, reusable
- Inline: embedded in one user, group or role
A company needs a reusable policy it can edit, attached to several roles. Which IAM policy type fits?
A customer managed policy.
Can one IAM user group contain another group?
No. Groups can't be nested; they contain only users.
An employee moves from the support team to the finance team. How should an administrator change the employee's IAM permissions?
Remove the user from the support group and add them to the finance group, instead of editing the user's own permissions.
An auditor needs a list of all IAM users with the status of their passwords, access keys and MFA. Which IAM feature provides it?
The IAM credential report.
An administrator wants to see which permitted services an IAM role never uses, to trim its permissions. Which IAM feature helps?
IAM last accessed information, which shows when each service was last used.
Which is true of IAM user groups: they can be nested, a user can be in several groups, or every account has a default group with all users?
A user can belong to several groups. Groups cannot be nested, and there is no default group that holds every user.
Which IAM feature tests whether policies would allow an action without making the real request?
The IAM policy simulator. It evaluates identity-based policies, permissions boundaries, SCPs and resource-based policies against a simulated request.
A security team wants to find supported AWS resources shared outside its account or organization. What should it configure?
IAM Access Analyzer external access analyzers, using that account or organization as the zone of trust, in each Region with supported resources.
Does an IAM role trust policy grant the resulting session permission to read application data?
No. It controls who can assume the role. The role permissions policy defines its resource permissions.
A vendor can assume an IAM role but cannot read the required data. Which role policy defines resource access?
The role permissions policy. Successful role assumption only establishes that its trust policy allowed the caller.
An application still uses an IAM user access key. How can the team rotate the key without interrupting access?
Create the second key, update applications, inspect old-key usage, deactivate the old key, test the new key, and delete the old key after confirming the migration.
Can an IAM group contain another group or be named as Principal in an S3 bucket policy?
No. Groups contain users and distribute identity-policy permissions; they are not authenticated principals.
Why does enabling MFA on the AWS root user not enable MFA for every IAM user?
Root and IAM users have separate MFA configurations. Each identity needs its own additional authentication factor.
In AWS MFA, what distinguishes a password from a security key or biometric?
A password is a knowledge factor; a security key is a possession factor; a biometric is an inherence factor. MFA combines factors.
An app has 2 million customers who need AWS access. Should each get an IAM user?
No. An account allows at most 5,000 IAM users; use federation or Amazon Cognito for customer identities.
An application on a running EC2 instance now needs S3 access, and the instance has no IAM role. Must it be relaunched?
No. Attach an IAM role (through an instance profile) to the running instance. An existing role would be replaced, not stacked.
A script uses the AWS CLI on Amazon EC2 and needs AWS permissions without storing long-term access keys. How can it obtain credentials?
Use the instance's attached IAM role. The AWS CLI can retrieve its temporary credentials from instance metadata.
An application assumes IAM role A, then uses those credentials to assume role B with a four-hour session request. How long can the role B session last?
One hour. Role chaining limits the session to one hour, whatever the role's maximum session duration.
What wins when IAM finds both an Allow and an applicable explicit Deny for a request?
The explicit Deny wins. Otherwise the applicable policy types must grant access within their limits; an absent allow is an implicit deny.
An IAM user has an identity policy allowing S3 reads in its account, and the bucket policy also allows that user. No applicable policy denies or limits the read. What is the result?
Allowed. Same-account identity and resource allows combine, subject to the relevant limits and service rules.
An IAM role has an identity Allow for an action, but its permissions boundary omits that action. Can an identity-policy grant authorize it?
No. Identity-policy permissions are limited to the intersection with the boundary and applicable organization policies.
A team wants one IAM policy reused by several roles. Should it create managed or inline policies?
A managed policy. An inline policy belongs to only one identity and is deleted with it.
An IAM policy allows s3:GetObject only on a bucket ARN without an object path. Does that resource match objects?
No. Object actions need object ARNs, such as arn:aws:s3:::example-bucket/*; s3:ListBucket uses the bucket ARN.
An IAM permission should work only within an approved time window. Which conditions express the window?
DateGreaterThan and DateLessThan on aws:CurrentTime.
A Region deny policy blocks IAM administration through its global endpoint. What should the author review?
Use NotAction exceptions for the required global-service actions in the aws:RequestedRegion deny. Separate policies must still allow those actions.
A team permits EC2 launches but wants to restrict the machine images developers use. What IAM mechanism applies?
Scope ec2:RunInstances permissions to approved image ARNs, or use supported conditions such as ec2:Owner. An AMI is the image used to launch an instance.
Which element of an IAM identity-based policy statement is optional: Effect, Action, Resource or Condition?
Condition. Effect, Action and Resource define the statement; Principal appears in resource-based policies.
A policy allows ec2:RunInstances with the condition aws:SourceIp 34.50.31.0/24. What does that limit?
Where the API call comes from. The caller must send the request from an address in that range; it says nothing about the IP addresses of the launched instances.
Which resource-based policy does the IAM service support?
Only the role trust policy, which names the principals that may assume the role.
When an IAM policy scopes access to an AWS resource, which components does its ARN identify?
The partition, service, Region, owning account and resource. The format is
arn:partition:service:region:account-id:resource; some resource types leave Region or account fields empty.An IAM role has billing permissions but cannot open Billing console pages governed by Activate IAM Access. What account setting should the administrator check?
Activate IAM Access. The root user enables the setting when needed; the role also needs appropriate IAM permissions. Organizations-created member accounts enable the setting by default.
A team edits a customer managed IAM policy shared by several roles. Which roles receive the revised policy permissions?
Every role to which that customer managed policy is attached. They share the same standalone policy.
What document structure defines the permissions in an IAM identity-based policy?
A JSON document with one or more permission statements. AWS evaluates applicable policies for each request.
An IAM author writes an Amazon S3 bucket ARN. Should its Region and account ID appear between the service and bucket name?
No. Those fields are empty:
arn:aws:s3:::bucket-name.A team wants to cap the permissions identity policies can grant to an IAM role. Which IAM feature should it use?
A permissions boundary. The boundary limits identity grants to a user or role and grants nothing by itself. A service-linked role cannot have a boundary.
What does an AWS STS session policy passed to AssumeRole do?
It limits identity-policy grants for that session to the overlap with the role permissions. It cannot add permissions to the role identity policy.
A team lead must create IAM roles without escaping an approved privilege ceiling. How should an administrator delegate that work?
Require the approved iam:PermissionsBoundary policy ARN during role creation, and prevent removal or modification of that boundary.
An IAM user boundary allows S3 access, but no identity or resource policy grants it. Can the user read S3 objects?
No. A boundary limits grants and does not create one.
An IAM role in account A reads an S3 object in account B using its original credentials. Which policies must allow the action?
The role identity policy in A and the bucket resource policy in B. Applicable policy limits and explicit denies can still block the request.
A team copies S3 objects across accounts and wants to keep using its original principal permissions. Which access pattern fits?
A resource-based bucket policy that grants the original principal access, together with its identity policy. Assuming a role uses the role permissions; it does not merge the original permissions into that session.
An IAM principal cannot assume a role in another AWS account. Which two permissions should the team inspect first?
The caller identity policy must allow sts:AssumeRole on the target role ARN, and the target role trust policy must trust the caller or its account.
Does trusting an AWS account in an IAM role trust policy automatically authorize every identity in that account?
No. It delegates authority to that account, which must grant its caller sts:AssumeRole permission.
A service has no resource-based policy support. How can a principal in another AWS account access it?
Assume a role in the resource account whose permissions cover the required actions.
A pipeline uses role A credentials to assume role B and requests a four-hour STS session. What happens?
AssumeRole fails. Role chaining limits that API session to one hour, regardless of the target role maximum.
An IAM user calls AssumeRole for a role with a twelve-hour maximum but omits DurationSeconds. How long is the requested session?
One hour. The configured maximum is a ceiling; the default DurationSeconds is 3600.
Which three values must an application use from an AWS STS temporary credential set?
The access key ID, secret access key and session token. Retrieve replacement credentials before expiration for continued access.
A pipeline needs project session tags to survive when role A assumes role B. What should it configure?
Mark the session tags as transitive. Ordinary session tags do not automatically pass to the next role session.
An audit team needs the originating identity recorded across a chain of IAM role sessions. Which STS feature helps?
Source identity. Once set, it persists through role chaining, cannot be changed, and appears in CloudTrail activity.
Which STS operation fits a SAML assertion, an OIDC token, a custom IAM-user broker, or an IAM user needing MFA credentials?
SAML: AssumeRoleWithSAML. OIDC: AssumeRoleWithWebIdentity. Custom IAM-user broker: GetFederationToken. User MFA credentials: GetSessionToken. The SAML and OIDC calls authenticate with provider evidence without AWS access keys.
A GitHub Actions job needs AWS access without stored access keys and only from an approved repository branch. What should the team configure?
An IAM OIDC provider and role trust restricted by audience and subject, then AssumeRoleWithWebIdentity. For GitHub, use aud sts.amazonaws.com and sub for the approved repository and branch.
An external build system has an OIDC identity token and needs temporary AWS permissions for a particular repository. What access pattern fits?
Federate to an IAM role with provider, audience and subject restrictions, and exchange the token through AssumeRoleWithWebIdentity.
An application needs limited AWS access for both signed-in users and guests. Which federation component supplies the credentials?
A Cognito identity pool. It issues temporary AWS credentials governed by IAM roles for authenticated and guest identities.
An on-premises LDAP directory does not support SAML, and users must still get access to AWS without IAM users. What pattern fits?
A custom identity broker that authenticates users against LDAP and requests short-lived credentials from AWS STS for them.
Employees authenticate through a SAML identity provider and need the AWS Management Console. Which endpoint receives the assertion and opens their role session?
The AWS sign-in endpoint. It requests temporary role credentials for the user and redirects the browser to the console using a sign-in URL.
A vendor serves several customers and assumes an IAM role in each account. How can a customer reduce the confused deputy risk?
Require the vendor principal and its unique customer external ID in the role trust policy. The vendor must pass the matching ExternalId to AssumeRole.
An IAM user must authenticate with MFA before assuming a sensitive role. How should the role enforce this?
Require aws:MultiFactorAuthPresent true in its trust policy. The AssumeRole caller supplies SerialNumber and TokenCode.
Is an external ID in an IAM trust policy a password that must be kept secret?
No. It distinguishes the vendor customer context. AWS does not treat it as a secret.
An IAM policy must deny requests without MFA, including calls signed with long-term access keys. Which condition handles a missing MFA key?
Deny with BoolIfExists on aws:MultiFactorAuthPresent set to false. The key is absent on long-term key requests.
What does iam:PassRole authorize, and does it generate its own CloudTrail API event?
It authorizes supplying a role to an AWS service. It is not an API call; inspect the service create or update event that received the role. Scope it by role ARN and iam:PassedToService.
Can an administrator use iam:PassRole to attach a role from account A directly to a service in account B?
No. Pass a role in B that can assume the role in A, with the required trust and permissions. PassRole itself is limited to the same account.
Who controls the permissions of an IAM service-linked role?
The linked AWS service. Administrators can view but cannot edit its permissions; related resources must be removed before deletion. SCPs do not restrict the role.
A developer can create an AWS service resource but is denied when supplying its IAM role. Which permission and trust should the team inspect?
Check the developer iam:PassRole permission for that role and the role trust for the receiving service.
A developer has few direct data permissions but can pass an administrator role to an AWS service. What is the IAM risk?
Privilege escalation through the service. Restrict the passed role ARNs and receiving services so the developer cannot delegate excessive authority.
How do RBAC and ABAC differ when designing IAM permissions?
RBAC assigns permissions by job function. ABAC compares attributes such as principal and resource tags for supported operations. Provider attributes can become session tags.
An IAM team wants project members to access new resources without adding each resource ARN to a job policy. What pattern fits?
ABAC with matching principal and resource project tags, where the service and action support those conditions.
An S3 home-directory IAM policy uses ${aws:username}. Can a federated IAM role use that policy unchanged?
No. aws:username is unavailable for role requests. Use suitable role or session attributes in a policy designed for that principal.
Which IAM Access Analyzer capabilities help review and reduce permissions?
External, internal and unused access analysis; policy validation; custom policy checks; and policy generation from CloudTrail activity.
A team wants a narrower IAM policy based on observed application activity. How should it use Access Analyzer?
Generate a template from a CloudTrail trail over up to ninety days, then review and customize it. Add required permissions that the activity or generation support does not capture.
In one AWS account, an S3 bucket policy allows a specific role session ARN to read objects. The role boundary omits S3 and there is no applicable explicit deny or organization restriction. Can that session read?
Yes. The resource grant goes directly to the session; a boundary implicit deny does not limit that grant.
In one AWS account, an S3 bucket policy allows a role ARN to read objects, but the role boundary omits S3. Can a session of that role use that grant?
No. A grant naming the role ARN remains limited by the boundary implicit deny.
An S3 bucket policy allows an IAM role using Principal wildcard plus an aws:PrincipalArn condition. Does omitting S3 from the boundary block that grant by itself?
No. This form of grant has different implicit-deny behavior from naming a role in Principal. Applicable explicit denies still win.
A role was deleted and recreated with the same name, and an existing resource Principal grant stopped working. Why?
The original role ARN was stored as a unique principal ID. The new role has a different ID; update the resource policy to trust it.
For an IAM role request, does aws:PrincipalArn identify the role or its assumed-role session?
The IAM role ARN. The calling principal is a role session, but this condition key holds the role ARN.
An S3 bucket policy names an account root ARN in Principal. Does that restrict access to the account root user?
No. It delegates to the account. In an
aws:PrincipalArncondition, the root ARN matches only the root user.An S3 bucket policy allows a role session from another account, but the role has no identity policy Allow. Is cross-account access granted?
No. Both the requesting account's identity evaluation and the bucket account's resource evaluation must allow the request.
An S3 bucket policy uses Deny with NotPrincipal to exempt a role, but the role has a permissions boundary. Why is it denied?
A
NotPrincipalwithDenydenies principals with boundaries regardless of its values. AWS recommends anArnNotEqualscondition onaws:PrincipalArn.Can an S3 bucket policy use a partial wildcard in Principal to match several IAM roles?
No. A partial wildcard is not allowed in a principal name or ARN. IAM groups cannot be principals either.
An IAM identity has a KMS Allow, but the KMS key policy neither authorizes it nor enables IAM delegation. Is access granted by that identity policy?
No. The key policy must authorize access, though it can enable account delegation through IAM policies rather than name every principal.
A CI pipeline must reject an IAM policy that adds access beyond an approved baseline. Which Access Analyzer capability fits?
A custom policy check against a reference policy. Grammar validation alone does not compare permission scope with your baseline.
Should an IAM unused access analyzer be created in every AWS Region like an external access analyzer?
No. Unused access findings do not vary by Region; external analysis is Regional.
An IAM policy generated from CloudTrail omits iam:PassRole and S3 data-event actions. Does that prove the application does not need them?
No. Policy generation does not include PassRole or identify action-level data-event activity. Review and customize the template.
An IAM user needs temporary credentials carrying MFA information while retaining user permissions. Which STS operation fits?
GetSessionToken with MFA information.
What does the IAM condition key aws:MultiFactorAuthAge measure?
Seconds since MFA authentication for temporary credentials created with MFA.
A security team wants stolen EC2 role credentials rejected outside their original VPC and private address. Which IAM context keys should it compare?
Compare aws:SourceVpc with aws:Ec2InstanceSourceVpc and aws:VpcSourceIp with aws:Ec2InstanceSourcePrivateIPv4. Scope the restriction to EC2 credentials and account for forwarded service calls.
A resource Deny with NotPrincipal lists an exception for an IAM role, but attaching a boundary makes the role lose access. What should the policy author inspect?
The NotPrincipal Deny. For principals with boundaries it denies regardless of those exceptions. AWS recommends ArnNotEquals with aws:PrincipalArn.
An IAM policy expects aws:SourceAccount on a direct request made by an IAM user. Will that key be present?
No. The key is available only for qualifying direct AWS service principal calls on behalf of a triggering resource, and not every service integration uses it.
An Identity Center team wants access based on a populated external Department attribute. What should it configure?
Map an access-control key such as Department to ${path:enterprise.department}, then use its session tag through aws:PrincipalTag/Department in ABAC policies that compare resource attributes.
A SAML provider starts sending IAM session tags and role assumption fails. Which trust permission may be missing?
sts:TagSession. Roles receiving provider session tags need it in their trust policy. Restrict tag keys and values to the intended attributes.
An IAM-user broker calls GetFederationToken without requesting a duration. What are its default and maximum durations?
Twelve hours by default and thirty-six hours maximum for IAM user credentials. Root-based sessions are limited to one hour.
Does the IAM user GetSessionToken operation have the same one-hour default as AssumeRole?
No. GetSessionToken for IAM users defaults to twelve hours and supports fifteen minutes to thirty-six hours. Root-based sessions default to and cannot exceed one hour.