AWS issues more than a dozen kinds of credential, and responders who cannot tell them apart waste the first hour of an incident deciding whether a key can even be switched off. An access key ID starting AKIA, a role session starting ASIA, a bearer token starting ABIA, a CodeCommit Git password and a Bedrock API key all behave differently: they last for different periods, are revoked in different ways and leave different traces in CloudTrail. This reference lists every credential type described in the AWS documentation, with its identifier prefix, lifetime, main risk and the preferred alternative. It is for AWS platform teams, NHI and IAM engineers, and incident responders. How to detect and rotate IAM user keys is covered in depth in the AWS Access Keys Security Guide; this page is the map around it.
This is an independent guide from NHI Mgmt Group, based on AWS's public documentation as of November 2026. It is not sponsored or reviewed by AWS. Product features change, so confirm settings against AWS's current documentation.
Key takeaways
- Long-term or temporary is the first question. Passwords, access keys, service-specific credentials, SSH keys and signing certificates persist until someone acts; STS credentials expire on their own, from 15 minutes up to 36 hours depending on the API.
- The prefix tells you the type. AWS documents AKIA for access keys, ASIA for temporary STS keys, ABIA for service bearer tokens and ACCA for context-specific credentials, and notes that prefixes may vary with creation date.
- Temporary does not mean revocable. An ASIA key cannot be deactivated; you deny sessions issued before a time on the role instead, so short durations are themselves a control.
- Service-specific credentials are easy to forget. Git credentials, Keyspaces passwords and long-term API keys for Bedrock and CloudWatch sit on IAM users, can be set never to expire and rarely appear in key inventories.
- The default answer is a role. People should sign in through IAM Identity Center, workloads should use roles, OIDC federation or IAM Roles Anywhere, and root tasks should use short AssumeRoot sessions.
Credential types at a glance
The table lists each type with the identifier AWS documents for it. Lifetimes are the documented limits; "until removed" means the credential stays valid until it is deactivated, deleted or reset.
| Credential type | Identifier or prefix | Lifetime | Main risk | Preferred alternative |
|---|---|---|---|---|
| Root user password | Account email address | Until changed | Full, unrestricted account access; IAM policies cannot deny the root user | Centralised root access management with AssumeRoot |
| Root user access key | AKIA | Until deleted | Programmatic root access from anywhere | None: delete it |
| IAM user console password | User name (user ID prefix AIDA) | Does not expire unless a password policy sets expiry | Phishing and reuse | IAM Identity Center sign-in |
| IAM user access key | AKIA | Until deactivated or deleted | Leaked keys work from any network | Roles, OIDC federation, Roles Anywhere |
| Role session (AssumeRole, SAML, web identity) | ASIA plus session token; role ID prefix AROA | 15 minutes to the role's maximum (1 to 12 hours); default 1 hour | Theft from metadata, CI logs or developer caches | Shorter durations, session tags, source identity |
| GetSessionToken and GetFederationToken sessions | ASIA plus session token | IAM user: 15 minutes to 36 hours, default 12 hours; root: up to 1 hour | Long sessions derived from a long-term key | Identity Center or role sessions |
| Instance profile and execution role credentials | ASIA plus session token; instance profile ID prefix AIPA | Short-lived, refreshed automatically; not bound by the role's maximum session duration | Server-side request forgery against instance metadata | IMDSv2, least privilege role policy |
| Identity Center permission set session | ASIA plus session token | 1 to 12 hours, default 1 hour | Cached CLI credentials on laptops | Short permission set sessions |
| AssumeRoot session | ASIA plus session token | Up to 900 seconds (15 minutes) | Misuse of delegated root tasks | Restrict who can call sts:AssumeRoot |
| STS service bearer token | ABIA | Short-lived, one service, one Region | Token copied from package manager config | Fetch per build; limit sts:GetServiceBearerToken |
| Context-specific credential | ACCA | Set by the issuing context | Unrecognised by older scanners | Include the prefix in secret scanning |
| Service-specific credentials (Git, Keyspaces) | Generated user name and password | Until deactivated, deleted or reset | Forgotten second set, no expiry | Role-based SigV4 access where the service supports it |
| Long-term service API key (Bedrock, CloudWatch, CloudWatch Logs) | Service-specific credential on an IAM user | 1 to 36,600 days, or never expires | Bearer key for a single service | Short-term API keys or temporary credentials |
| Short-term service API key | Pre-signed SigV4 value | Up to 12 hours or the remaining session, whichever is shorter | Inherits the creator's permissions | Generate per session |
| SSH public key for CodeCommit | Public key ID prefix APKA | Until deactivated or deleted | Private key on a developer laptop | HTTPS with role credentials |
| X.509 signing or server certificate | Certificate ID prefix ASCA | Certificate validity period | Unmanaged legacy certificates | ACM for TLS; Roles Anywhere for workload identity |
Scanners and detection rules depend on these prefixes, so make sure your secret scanning patterns include AKIA, ASIA, ABIA and ACCA. See the Git Secret Scanning Guide.
Long-term access keys
An access key pair is an access key ID and a secret access key that signs requests with Signature Version 4. AWS's IAM documentation states that access keys do not expire. Each IAM user can hold two, which allows zero-downtime rotation and also gives an attacker a second slot for persistence (ATT&CK T1098.001 Additional Cloud Credentials).
- Root access keys: AWS advises against creating them at all. With centralised root access management enabled in AWS Organizations, the management account or a delegated administrator can remove root credentials from member accounts and use AssumeRoot for the few tasks that need root.
- IAM user keys: the permissions are those of the user, filtered by permissions boundaries, service control policies and resource policies. Admin users with keys are the worst case in any leak.
- Where they leak: source code and Git history, the plaintext
~/.aws/credentialsfile, CI variables and container layers (T1552.001 Credentials In Files). - Revocation: set the key to Inactive first (reversible, keeps the key ID for investigation), then delete after a waiting period.
Why keys persist in practice, and how to replace them programme-wide, is covered in the Workload Identity Federation vs Static Cloud Keys guide.
Role sessions
Every temporary credential set from AWS STS has three parts: an ASIA access key ID, a secret access key and a session token. The access key ID is unique only together with the other two. The STS API that issued it decides how long it lasts and what it can do.
| STS API | Caller | MFA | Lifetime (min, max, default) | Notable restriction |
|---|---|---|---|---|
| AssumeRole | IAM user or role with existing credentials | Yes | 15 min, role maximum (up to 12 h), 1 h | Role chaining caps the session at 1 hour |
| AssumeRoleWithSAML | Holder of a SAML response from a trusted IdP | No (handled by the IdP) | 15 min, role maximum, 1 h | Unsigned call; trust relies on the IdP |
| AssumeRoleWithWebIdentity | Holder of an OIDC JWT from a trusted IdP | No (handled by the IdP) | 15 min, role maximum, 1 h | Unsigned call; trust policy conditions on audience and subject are essential |
| GetSessionToken | IAM user or root user | Yes | IAM user 15 min, 36 h, 12 h; root up to 1 h | No IAM API calls unless MFA was included; no console sign-in |
| GetFederationToken | IAM user or root user | No | IAM user 15 min, 36 h, 12 h; root up to 1 h | No IAM API calls through CLI or API; console sign-in allowed |
| AssumeRoot | Management account or delegated administrator | Not applicable | Up to 900 seconds, default 900 | Scoped to one of five AWS managed task policies; Regional STS endpoint only |
- Maximum session duration: a role setting from 1 to 12 hours. AssumeRole requests above it fail. Keep it at 1 hour for automation unless a long job genuinely needs more.
- Instance profiles and execution roles: EC2 delivers role credentials through the instance metadata service and SDKs refresh them automatically. AWS notes that EC2 role credentials are not subject to the role's maximum session duration. Require IMDSv2 to reduce theft through server-side request forgery (T1552.005 Cloud Instance Metadata API).
- Revoking sessions: a temporary key cannot be deactivated. Use the role's revoke active sessions action, which adds a deny for tokens issued before a time (
aws:TokenIssueTime), then fix whatever leaked the session. - Newer STS operations: the STS comparison page now also lists GetScopedCredentials, which narrows an existing session with a scope-down policy for no longer than the remaining lifetime of the calling session. Check service support before relying on it.
Trust policies, external IDs and chaining are covered in the AWS STS and AssumeRole Guide.
Federation and Identity Center
Federation replaces stored credentials with an assertion or token from an identity provider, exchanged for an STS role session. There are three common routes.
- IAM Identity Center: users sign in to the AWS access portal, whose interactive session defaults to 8 hours and can be set from 15 minutes to 90 days. Each permission set has its own session duration, default 1 hour, range 1 to 12 hours, and Identity Center creates the matching roles in each account. The CLI (
aws sso login) caches a token under~/.aws/sso/cacheand uses it to request role credentials, so laptop compromise exposes the portal session as well as the role session. See the AWS IAM Identity Center Guide. - SAML or OIDC federation to IAM roles: AssumeRoleWithSAML or AssumeRoleWithWebIdentity, typically for a workforce IdP or CI/CD systems. For pipelines, pin the trust policy to the repository, branch or environment claim. See the GitHub Actions OIDC Federation Hardening Guide.
- IAM Roles Anywhere: a workload outside AWS signs a CreateSession request with the private key of an X.509 v3 certificate that chains to a trust anchor in your account, and receives a standard SigV4 session. The role's trust policy must allow
rolesanywhere.amazonaws.com, and can add conditions on certificate attributes such as subject or issuer. See the AWS IAM Roles Anywhere Security Guide.
The general pattern, across clouds, is described in the Workload Identity Federation Guide.
Service-specific credentials
Some AWS services accept credentials that are not SigV4 access keys. They are created on an IAM user, so they inherit that user's permissions and survive key rotation programmes that only look at access keys.
| Credential | Used by | Limits and lifecycle | Management actions |
|---|---|---|---|
| HTTPS Git credentials | AWS CodeCommit | IAM generates a static user name and password; download once; usable only in the same account | Reset, set Inactive, delete |
| Service-specific password | Amazon Keyspaces (for Apache Cassandra) | Up to two sets per supported service per IAM user; active on creation | Set Inactive, delete, rotate with the second set |
| Long-term API key | Amazon Bedrock, Amazon CloudWatch, Amazon CloudWatch Logs | Console expiry of 1, 5, 30, 90 or 365 days, custom date or never; CLI --credential-age-days 1 to 36,600; omitting it means no expiry | Create, list (--all-users), update status, reset, delete |
| Short-term API key | Amazon Bedrock | Pre-signed value valid for up to 12 hours or the remaining console session | Expires with the generating credentials |
| Service bearer token | AWS CodeArtifact (for example aws codeartifact login) | Valid only for the issuing service and Region; requires sts:GetServiceBearerToken | Expires on its own |
| SSH public key | AWS CodeCommit | ssh-rsa or PEM, 2,048 to 16,384 bits; private key stays with the user | Set Inactive, delete |
- Long-term API keys: AWS attaches a managed policy to the new key's user (for Bedrock,
AmazonBedrockLimitedAccess) and recommends short-term keys or temporary credentials where possible. Always set an expiry. See the Amazon Bedrock Security Guide. - Inventory gap: the IAM credential report covers passwords and access keys. Use
aws iam list-service-specific-credentials --all-usersandlist-ssh-public-keysas well, per account. - Creation rights: the
iam:CreateServiceSpecificCredentialfamily of actions mints new standing credentials. Treat it likeiam:CreateAccessKeyand consider an SCP that restricts it.
Choosing the right type
The decision follows who or what needs access and where it runs.
| Need | Use | Avoid |
|---|---|---|
| Engineer at the console or CLI | Identity Center permission set, 1 hour session | IAM users with passwords or keys |
| Code running on EC2, Lambda, ECS or EKS | Instance profile, execution role, task role or pod identity | Access keys in environment variables |
| CI/CD pipeline | OIDC federation with AssumeRoleWithWebIdentity | Keys stored as pipeline secrets |
| On-premises or other-cloud workload | IAM Roles Anywhere with certificates from a managed CA | Shared IAM user keys |
| Third party reading your account | Cross-account role with an external ID | Handing over a key |
| Bedrock or CloudWatch client that needs an API key | Short-term API key, or long-term key with an expiry | Never-expiring keys |
| Root-only task in a member account | AssumeRoot with the specific task policy | Standing root passwords and keys |
| Tool that only accepts static keys | Dedicated IAM user, scoped policy, source IP or VPC endpoint condition, scheduled rotation | Reusing one key across tools |
Small and large organisations: a single-account team can usually reach zero IAM users within weeks by moving people to Identity Center and pipelines to OIDC. A large estate needs an organisation-wide inventory of every type in the first table, an exceptions register with owners and expiry dates, and SCPs that deny iam:CreateAccessKey and service-specific credential creation outside approved roles, rolled out per organisational unit after an audit period.
What to monitor
- CloudTrail by prefix:
userIdentity.accessKeyIdstarting AKIA from an unexpected network or Region; new ABIA tokens from unusual principals. - Credential creation events: CreateAccessKey, CreateServiceSpecificCredential, UploadSSHPublicKey, CreateLoginProfile.
- Session anomalies: AssumeRole with long DurationSeconds, AssumeRoot calls, and GuardDuty instance credential exfiltration findings.
Metrics
- Standing credentials: count of active access keys, service-specific credentials and SSH keys, trending to zero outside the exceptions register.
- Never-expiring API keys: long-term service API keys without an expiry (target zero).
- Session length: share of roles and permission sets with a maximum session above 1 hour.
- Federation coverage: share of human and CI access through Identity Center or OIDC.
- Root posture: member accounts with root credentials removed under centralised root access management.
Framework mapping
| Control area | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 | ATT&CK technique addressed |
|---|---|---|---|
| Credential inventory and ownership | AC-2, IA-5 | PR.AA-01 | T1078.004 Cloud Accounts |
| Short-lived credentials and session limits | IA-5, AC-12 | PR.AA-01 | T1552.005 Cloud Instance Metadata API |
| Federation and MFA for people | IA-2 | PR.AA-01 | T1078.004 Cloud Accounts |
| Restricting credential creation | AC-2, AC-6 | PR.AA-05 | T1098.001 Additional Cloud Credentials |
Practitioner checklist
- Inventory every credential type in the first table in every account, including service-specific credentials and SSH keys.
- Delete root access keys and enable centralised root access management for member accounts.
- Move people to Identity Center with 1 hour permission set sessions and a deliberate access portal session length.
- Replace pipeline keys with OIDC federation and pin trust policies to repository and branch claims.
- Replace on-premises keys with IAM Roles Anywhere where a managed CA is available.
- Set an expiry on every long-term Bedrock and CloudWatch API key, and prefer short-term keys.
- Require IMDSv2 on EC2 and keep role maximum session durations at 1 hour unless justified.
- Add AKIA, ASIA, ABIA and ACCA patterns to secret scanning and push protection.
- Apply SCPs that restrict access key and service-specific credential creation to approved roles.
- Rehearse revoking role sessions by token issue time alongside deactivating access keys.
Standards and references
- AWS: IAM identifiers
- AWS: Compare AWS STS credentials
- AWS: STS AssumeRole API reference
- AWS: STS AssumeRoot API reference
- AWS: API keys for AWS services
- AWS: Service-specific credentials for IAM users
- AWS: Service bearer tokens
- AWS: IAM Identity Center permission set session duration
Related NHI Mgmt Group resources: AWS Access Keys Security Guide · AWS STS and AssumeRole Guide · AWS IAM Roles vs IAM Users · Cloud Access Key Leak Playbook