Join our Newsletter — 33% off our NHI Course
Home› Guides› AWS Credential Types Reference: Keys, Roles, Sessions and…
Guide Cloud & Workload Identity

AWS Credential Types Reference: Keys, Roles, Sessions and Tokens

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 14 min read
On this page

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 typeIdentifier or prefixLifetimeMain riskPreferred alternative
Root user passwordAccount email addressUntil changedFull, unrestricted account access; IAM policies cannot deny the root userCentralised root access management with AssumeRoot
Root user access keyAKIAUntil deletedProgrammatic root access from anywhereNone: delete it
IAM user console passwordUser name (user ID prefix AIDA)Does not expire unless a password policy sets expiryPhishing and reuseIAM Identity Center sign-in
IAM user access keyAKIAUntil deactivated or deletedLeaked keys work from any networkRoles, OIDC federation, Roles Anywhere
Role session (AssumeRole, SAML, web identity)ASIA plus session token; role ID prefix AROA15 minutes to the role's maximum (1 to 12 hours); default 1 hourTheft from metadata, CI logs or developer cachesShorter durations, session tags, source identity
GetSessionToken and GetFederationToken sessionsASIA plus session tokenIAM user: 15 minutes to 36 hours, default 12 hours; root: up to 1 hourLong sessions derived from a long-term keyIdentity Center or role sessions
Instance profile and execution role credentialsASIA plus session token; instance profile ID prefix AIPAShort-lived, refreshed automatically; not bound by the role's maximum session durationServer-side request forgery against instance metadataIMDSv2, least privilege role policy
Identity Center permission set sessionASIA plus session token1 to 12 hours, default 1 hourCached CLI credentials on laptopsShort permission set sessions
AssumeRoot sessionASIA plus session tokenUp to 900 seconds (15 minutes)Misuse of delegated root tasksRestrict who can call sts:AssumeRoot
STS service bearer tokenABIAShort-lived, one service, one RegionToken copied from package manager configFetch per build; limit sts:GetServiceBearerToken
Context-specific credentialACCASet by the issuing contextUnrecognised by older scannersInclude the prefix in secret scanning
Service-specific credentials (Git, Keyspaces)Generated user name and passwordUntil deactivated, deleted or resetForgotten second set, no expiryRole-based SigV4 access where the service supports it
Long-term service API key (Bedrock, CloudWatch, CloudWatch Logs)Service-specific credential on an IAM user1 to 36,600 days, or never expiresBearer key for a single serviceShort-term API keys or temporary credentials
Short-term service API keyPre-signed SigV4 valueUp to 12 hours or the remaining session, whichever is shorterInherits the creator's permissionsGenerate per session
SSH public key for CodeCommitPublic key ID prefix APKAUntil deactivated or deletedPrivate key on a developer laptopHTTPS with role credentials
X.509 signing or server certificateCertificate ID prefix ASCACertificate validity periodUnmanaged legacy certificatesACM 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/credentials file, 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 APICallerMFALifetime (min, max, default)Notable restriction
AssumeRoleIAM user or role with existing credentialsYes15 min, role maximum (up to 12 h), 1 hRole chaining caps the session at 1 hour
AssumeRoleWithSAMLHolder of a SAML response from a trusted IdPNo (handled by the IdP)15 min, role maximum, 1 hUnsigned call; trust relies on the IdP
AssumeRoleWithWebIdentityHolder of an OIDC JWT from a trusted IdPNo (handled by the IdP)15 min, role maximum, 1 hUnsigned call; trust policy conditions on audience and subject are essential
GetSessionTokenIAM user or root userYesIAM user 15 min, 36 h, 12 h; root up to 1 hNo IAM API calls unless MFA was included; no console sign-in
GetFederationTokenIAM user or root userNoIAM user 15 min, 36 h, 12 h; root up to 1 hNo IAM API calls through CLI or API; console sign-in allowed
AssumeRootManagement account or delegated administratorNot applicableUp to 900 seconds, default 900Scoped 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/cache and 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.

CredentialUsed byLimits and lifecycleManagement actions
HTTPS Git credentialsAWS CodeCommitIAM generates a static user name and password; download once; usable only in the same accountReset, set Inactive, delete
Service-specific passwordAmazon Keyspaces (for Apache Cassandra)Up to two sets per supported service per IAM user; active on creationSet Inactive, delete, rotate with the second set
Long-term API keyAmazon Bedrock, Amazon CloudWatch, Amazon CloudWatch LogsConsole 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 expiryCreate, list (--all-users), update status, reset, delete
Short-term API keyAmazon BedrockPre-signed value valid for up to 12 hours or the remaining console sessionExpires with the generating credentials
Service bearer tokenAWS CodeArtifact (for example aws codeartifact login)Valid only for the issuing service and Region; requires sts:GetServiceBearerTokenExpires on its own
SSH public keyAWS CodeCommitssh-rsa or PEM, 2,048 to 16,384 bits; private key stays with the userSet 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-users and list-ssh-public-keys as well, per account.
  • Creation rights: the iam:CreateServiceSpecificCredential family of actions mints new standing credentials. Treat it like iam:CreateAccessKey and consider an SCP that restricts it.

Choosing the right type

The decision follows who or what needs access and where it runs.

NeedUseAvoid
Engineer at the console or CLIIdentity Center permission set, 1 hour sessionIAM users with passwords or keys
Code running on EC2, Lambda, ECS or EKSInstance profile, execution role, task role or pod identityAccess keys in environment variables
CI/CD pipelineOIDC federation with AssumeRoleWithWebIdentityKeys stored as pipeline secrets
On-premises or other-cloud workloadIAM Roles Anywhere with certificates from a managed CAShared IAM user keys
Third party reading your accountCross-account role with an external IDHanding over a key
Bedrock or CloudWatch client that needs an API keyShort-term API key, or long-term key with an expiryNever-expiring keys
Root-only task in a member accountAssumeRoot with the specific task policyStanding root passwords and keys
Tool that only accepts static keysDedicated IAM user, scoped policy, source IP or VPC endpoint condition, scheduled rotationReusing 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.accessKeyId starting 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 areaNIST SP 800-53 Rev. 5NIST CSF 2.0ATT&CK technique addressed
Credential inventory and ownershipAC-2, IA-5PR.AA-01T1078.004 Cloud Accounts
Short-lived credentials and session limitsIA-5, AC-12PR.AA-01T1552.005 Cloud Instance Metadata API
Federation and MFA for peopleIA-2PR.AA-01T1078.004 Cloud Accounts
Restricting credential creationAC-2, AC-6PR.AA-05T1098.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

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

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.