Skip to Content
Asterrr's Handbook
4 · Identity and access management

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.

FactValue
Refresh rateGenerated at most once every 4 hours. A request inside that window returns the existing report
Stored copiesOne report per account. A new one overwrites the old one
Permissionsiam:GenerateCredentialReport then iam:GetCredentialReport
Key columnspassword_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 coveredService-specific credentials (for example CodeCommit, Bedrock long-term API keys), access keys beyond the first two
Last-used granularityOnly the first use in a 15-minute window is recorded for keys, 5 minutes for passwords
N/AThe 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

TypeNotes
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 tokenMust be an AWS-compatible token with shared seed
SMSSupport 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 GetSessionToken or AssumeRole. Use aws login for CLI sessions.
  • Enforce MFA in policy with "Bool": {"aws:MultiFactorAuthPresent": "true"}. Missing keys make a plain Bool false, so use BoolIfExists with false in 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

RuleDetail
UseOnly for tasks that need root, such as registering for the Enterprise support plan
ProtectMFA and no access keys
PoliciesCannot attach identity policies or boundaries. Can be a resource policy principal. SCPs and RCPs still apply in member accounts
Temporary tokensGetSessionToken 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::*:root in 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.

Management or delegated adminMember accountAssumeRootshort-liveddelete policyIAM principalwithsts:AssumeRootRegional STSendpointRoot sessionwith task policyLocked bucketpolicy
A privileged session is scoped by a task policy and cannot be used for anything else.
Task policyAllows
IAMAuditRootUserCredentialsCheck status of root password, keys, certificates, MFA
IAMDeleteRootUserCredentialsDelete root password, access keys, signing certificates and MFA
IAMCreateRootUserPasswordAllow password recovery for the root user
S3UnlockBucketPolicyDelete a bucket policy that denies everyone
SQSUnlockQueuePolicyDelete a queue policy that denies everyone
  • The caller must be an IAM user or role with sts:AssumeRoot explicitly 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_enabled is FALSE for 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

Scenario
A bank's platform team removed the root passwords from 200 member accounts after enabling centralized root access. A developer then applied a bucket policy that denies s3:* to all principals, and now nobody can edit it. What should the security team do?

Further reading

On this page