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.
Flashcards
Nada para revisar aqui agora. Escolha outros tópicos ou outro filtro.
·
Todos os 40 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.