Credentials, MFA and root access
Credential reports, access key hygiene, MFA types and enforcement, and centralized root access for member accounts.
Exam tasks: 4.1 (Skills 4.1.1 identity solutions and IdP integration with Identity Center and MFA, 4.1.2 mechanisms that issue temporary credentials)
The decision: which long-term credentials still exist, how do you prove a person is who they claim with MFA, and how do you do root-only work without keeping root credentials?
Long-term credentials are the weak point of IAM. Audit them, rotate or remove them, protect them with MFA, and keep root unused.
Credential report
A CSV listing every IAM user and the status of passwords, the first two access keys, MFA devices and signing certificates. Console, CLI and SDKs can produce it.
| Fact | Value |
|---|---|
| Refresh rate | Generated at most once every 4 hours. A request inside that window returns the existing report |
| Stored copies | One report per account. A new one overwrites the old one |
| Permissions | iam:GenerateCredentialReport then iam:GetCredentialReport |
| Key columns | password_last_used, password_last_changed, mfa_active, access_key_1_active, access_key_1_last_rotated, access_key_1_last_used_date, access_key_1_last_used_service |
| Not covered | Service-specific credentials (for example CodeCommit, Bedrock long-term API keys), access keys beyond the first two |
| Last-used granularity | Only the first use in a 15-minute window is recorded for keys, 5 minutes for passwords |
N/A | The user has no such credential |
Automation for "disable keys older than 90 days" is a scheduled Lambda that calls GenerateCredentialReport, GetCredentialReport, parses access_key_1_last_rotated, then calls UpdateAccessKey with Inactive. Quick audits can use the console download.
Exam signal
"Find IAM users without MFA" or "list stale keys across the account" is the credential report. "Find unused permissions and unused roles" is Access Analyzer unused access findings. "Which service did this key last call" is access key last used information.
Access key hygiene
- Access keys: at most 2 per user, so you can rotate: create, switch, deactivate, delete. Find old or unused
keys with the credential report (all users, generated at most every 4 hours, as CSV) and
GetAccessKeyLastUsed. - Prefer roles for EC2 (instance profiles), Lambda and ECS tasks. Their credentials rotate automatically.
MFA
| Type | Notes |
|---|---|
| Passkey or security key (FIDO2) | Phishing resistant. Synced passkeys and device-bound keys both work. Console enablement only. One security key can cover several users |
| Virtual authenticator app (TOTP) | Interim option |
| Hardware TOTP token | Must be an AWS-compatible token with shared seed |
| SMS | Support ended. Migrate users off it |
- Root and each IAM user can register up to 8 MFA devices of mixed types. One device is enough to sign in.
- MFA is enforced for the root user of all account types.
- Passkey and security key information cannot be passed to STS
GetSessionTokenorAssumeRole. Useaws loginfor CLI sessions. - Enforce MFA in policy with
"Bool": {"aws:MultiFactorAuthPresent": "true"}. Missing keys make a plainBoolfalse, so useBoolIfExistswithfalsein a deny statement to also catch long-term keys. - For API calls, the user gets MFA-backed credentials from
GetSessionToken, or assumes a role whose trust policy requires MFA. - IAM Identity Center has its own MFA settings. Federated sessions inherit MFA at the IdP, since SAML and web identity STS calls take no MFA parameter.
- IAM Identity Center (its own directory or AD) can prompt every sign-in or only when the sign-in context changes. It allows FIDO2 authenticators (passkeys, security keys) and authenticator apps, and lets you choose what happens for users without a device (require registration at sign-in, block, or email one-time code). With an external IdP, MFA is enforced by the IdP.
Root user
| Rule | Detail |
|---|---|
| Use | Only for tasks that need root, such as registering for the Enterprise support plan |
| Protect | MFA and no access keys |
| Policies | Cannot attach identity policies or boundaries. Can be a resource policy principal. SCPs and RCPs still apply in member accounts |
| Temporary tokens | GetSessionToken and GetFederationToken for root last at most 1 hour |
- For the management account itself (and standalone accounts), enable MFA on root, keep no root access keys, and alert on root sign-in with EventBridge.
- Add an SCP that denies actions by
arn:aws:iam::*:rootin member accounts as a second layer.
Centralized root access management
In an organization, remove root credentials from member accounts and perform the few root-only tasks from the management account or a delegated administrator for IAM.
| Task policy | Allows |
|---|---|
IAMAuditRootUserCredentials | Check status of root password, keys, certificates, MFA |
IAMDeleteRootUserCredentials | Delete root password, access keys, signing certificates and MFA |
IAMCreateRootUserPassword | Allow password recovery for the root user |
S3UnlockBucketPolicy | Delete a bucket policy that denies everyone |
SQSUnlockQueuePolicy | Delete a queue policy that denies everyone |
- The caller must be an IAM user or role with
sts:AssumeRootexplicitly granted. Root credentials cannot call it. - The global STS endpoint is not supported. Use a Regional endpoint.
- Limit which tasks are possible with the condition key
sts:TaskPolicyArn. - Member accounts created in an organization have no root credentials by default, so
password_enabledisFALSEfor them in the credential report. - Enable centralized root access in the IAM console for the organization, then delete root credentials (password, keys, MFA, certificates) in member accounts.
Legacy: use Centralized root access with sts:AssumeRoot instead
Keeping a root password and MFA device per member account in a safe, just to fix a locked bucket policy, is no longer necessary. Remove member root credentials and use privileged root tasks instead.
Exam trap
A bucket policy that denies everyone, including admins, is not fixed by an IAM admin. The old answer was "sign in as root". The current answer in an organization is AssumeRoot with S3UnlockBucketPolicy from the management or delegated administrator account.
When an IAM user is still acceptable
Workloads that cannot use roles, third-party tools without Identity Center support, CodeCommit and Keyspaces service-specific credentials where roles cannot be used, and emergency break-glass access protected by MFA.
Scenarios
A privileged root task scoped to S3UnlockBucketPolicy is designed for exactly this, with no root password needed. Restoring the root password works around the control the team chose. An SCP can't grant anything or override an explicit deny, and the OrganizationAccountAccessRole is also caught by the bucket policy's deny for all principals.
Related
- IAM identities and policy types
- STS, roles and cross-account access
- Federation with SAML, OIDC and IAM Identity Center
- Access Analyzer, policy simulator and least privilege tools
- Central security management and root access
- IAM and STS fundamentals cheat sheet
Further reading
STS, roles and cross-account access
Choosing the right STS API, cross-account role assumption, external ID, session tags, source identity, role chaining, IAM Roles Anywhere and revoking sessions.
Cognito and API Gateway authorizers
Amazon Cognito user pools and identity pools, guest access and token types, and the API Gateway authorizers that check them.