Cloud concept · Updated

Workload Identity - Workload identity is the verifiable identity assigned to an application, service, or automated process so it can authenticate and access resources without using a person's credentials.

In short

Workload identity lets software prove who it is and receive permissions appropriate to its function and execution environment. Cloud implementations commonly combine runtime identity, federation, and short-lived credentials to reduce reliance on stored secrets while supporting least privilege and auditable access.

Cloud Concepts Hub →

6 key aspects of Workload Identity

Effective workload identity combines software-specific principals, constrained trust, renewable credentials, least-privilege permissions, runtime isolation, and traceable activity.

01
Software-specific principals

Assign identities to applications, services, and automated jobs rather than reusing employee accounts. Separate identities by workload and environment so permissions and audit records remain meaningful.

02
Short-lived credential delivery

Prefer temporary credentials obtained through the execution platform or a federation exchange. Use supported credential providers to refresh credentials automatically instead of copying keys into configuration.

03
Explicit trust boundaries

Define which runtime, identity provider, or external subject may obtain a workload identity. For federation, validate issuer, audience, and subject restrictions rather than trusting every identity from a provider.

04
Least-privilege authorization

Grant only the actions and resources the workload requires. Keep the permission to assume or attach an identity separate from the permissions exercised through that identity.

05
Runtime and credential isolation

Protect credential endpoints, token files, and private keys from unrelated workloads. Temporary credentials limit exposure duration but remain usable by an attacker who obtains them.

06
Lifecycle and auditability

Manage identity creation, renewal, permission changes, and retirement alongside the workload lifecycle. Preserve enough session and deployment context to investigate which workload performed an operation.

Cloud services for Workload Identity

IAM defines workload roles, trust relationships, and permissions, while AWS STS supplies temporary credentials for role sessions. EC2 and ECS connect these identities to compute instances and tasks; EKS provides mechanisms that associate Kubernetes workloads with IAM roles. IAM Roles Anywhere extends temporary role credentials to external workloads authenticated with trusted certificates. Together, these services separate workload execution from credential storage, but secure operation still depends on narrow trust policies, appropriate runtime isolation, reliable credential refresh, and audit records that identify the acting workload.

Amazon EC2Amazon EC2

EC2 associates an IAM role with an instance through an instance profile and makes temporary credentials available through instance metadata. Applications should use supported credential providers, and instances should require IMDSv2 where supported and restrict unnecessary metadata access.

Workload Identity exam questions

Real practice exam questions on Workload Identity, with the correct answer and its explanation. Answer them with every option in the exam simulator.

SAP-C03

A company runs processing workers in its data center and in another cloud provider. The workers use IAM Roles Anywhere to obtain credentials for a bootstrap role, and then explicitly call https://sts.amazonaws.com to assume a data-access role. The workers automatically refresh both credential sets.

The company is expanding into an opt-in AWS Region that is already enabled in the account. Credentials returned by the global endpoint work for Amazon S3 requests in a default-enabled Region but fail with an invalid-token error in the opt-in Region. The account is configured for version 1 session tokens from the global endpoint. The data-access role has the required permissions in both Regions.

The company requires each data-access credential set to work in both Regions until expiration. Credential acquisition must not depend on the global AWS STS endpoint, and the company must not change the account-wide global-endpoint token setting. The bootstrap credential mechanism must remain unchanged.

Which solution meets these requirements?

Show answerCORRECT ANSWER

Replace the explicitly configured global STS endpoint with an enabled Regional STS endpoint for AssumeRole calls. Continue automatically refreshing the returned credentials and use the same credential set for S3 requests in both Regions.

Temporary credentials issued by Regional STS endpoints are valid in all AWS Regions, including enabled opt-in Regions. Calling a Regional endpoint also removes the global STS endpoint from the data-access credential acquisition path without changing the account-wide global-endpoint token setting or the bootstrap mechanism.

DEA-C01

A data engineering team runs an AWS Lambda function in account A. The function must assume the CuratedDataReadRole role in account B to read a curated Amazon S3 dataset. The function's execution role, IngestionFunctionRole, trusts lambda.amazonaws.com and allows sts:AssumeRole on CuratedDataReadRole. The function code explicitly calls AWS STS AssumeRole and uses the returned credentials for its S3 requests.

CuratedDataReadRole has the required S3 permissions, but its trust policy allows sts:AssumeRole only for the service principal lambda.amazonaws.com. The AssumeRole call returns AccessDenied. No permissions boundaries, service control policies, or explicit denies affect the request.

Which change will allow the function to assume CuratedDataReadRole while limiting trust to the intended workload?

Show answerCORRECT ANSWER

Replace the principal in CuratedDataReadRole's trust policy with the ARN of IngestionFunctionRole in account A.

The function's code calls STS using credentials for IngestionFunctionRole. The target role must trust that IAM role, not the Lambda service principal. The source role already has the required sts:AssumeRole permission, so this change completes the cross-account authorization.

SCS-C03

A company uses AWS IAM Roles Anywhere to authenticate on-premises applications. A shared enterprise certificate authority (CA) issues certificates to applications across several departments. The CA is configured as a trust anchor, and a shared Roles Anywhere profile permits applications to request LedgerRole.

LedgerRole currently trusts the rolesanywhere.amazonaws.com service principal for the required session operations, with an aws:SourceArn condition restricted to the trust anchor. The company must ensure that temporary credentials for LedgerRole are issued only when the presented certificate has a subject organizational unit (OU) of Finance and a subject common name (CN) of ledger-agent. Other applications must continue using the same CA and profile for other roles. Certificate renewals that retain these subject values must not require IAM changes.

Certificate attribute mappings already expose the subject OU and CN as principal tags. Each certificate has exactly one value for each attribute. Which change meets these requirements?

Show answerCORRECT ANSWER

Add StringEquals conditions to LedgerRole's trust policy requiring aws:PrincipalTag/x509Subject/OU to equal Finance and aws:PrincipalTag/x509Subject/CN to equal ledger-agent. Retain the service principal, required session operations, and trust-anchor condition.

IAM Roles Anywhere exposes mapped certificate subject attributes as principal tags during role assumption. Conditions in the role's trust policy can require both subject values before credentials are issued. Keeping the trust-anchor restriction also limits authentication to the trusted CA. Renewed certificates with the same mapped subject values continue to satisfy the conditions.

Practice Workload Identity in a full exam

Questions on Workload Identity in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Workload Identity

3 min read

Workload identity addresses authentication for software rather than people. A workload might be a virtual machine application, container, serverless function, deployment pipeline, or process running outside the cloud. Its identity gives an authorization system a principal against which to evaluate access. Authentication establishes which workload is making a request; authorization determines what that workload may do. A valid identity does not automatically grant access to data or administrative operations.

A common cloud pattern is to associate a workload with a role or service account and let the execution platform provide temporary credentials. For example, an application on Amazon EC2 can use an IAM role delivered through an instance profile to read a particular Amazon S3 prefix. A supported AWS SDK retrieves and refreshes the role credentials through its credential provider chain. Developers do not need to place an IAM user's access keys in application configuration, source code, or a machine image. However, the application must use the intended provider chain: environment variables containing old credentials can override the runtime role.

Federation extends this pattern across identity boundaries. A deployment pipeline can present an OpenID Connect token from a trusted identity provider and exchange it for a short-lived AWS role session. Trust must constrain the token issuer, intended audience, and relevant subject claims, such as the permitted repository and deployment environment. Trusting an issuer without sufficiently restricting which subjects may assume the role can allow unrelated workloads to obtain credentials. For supported external workloads, certificate-based authentication is another option; AWS IAM Roles Anywhere exchanges trusted X.509-based authentication for temporary role credentials.

Identity should follow the smallest practical workload boundary. In Amazon ECS, the task role supplies permissions to application containers, while the task execution role supports operations such as pulling images and delivering logs. These roles serve different purposes. In Amazon EKS, EKS Pod Identity or IAM roles for service accounts can associate Kubernetes workloads with IAM permissions. A Kubernetes service account alone does not automatically grant AWS API access. Using a broadly privileged node role for all pods weakens isolation and makes attribution more difficult.

Human and workload authentication should remain separate. AWS IAM Identity Center supports workforce access, while Amazon Cognito commonly supports application-user authentication and, through identity pools, access to temporary AWS credentials. A user signing into an application is not the same principal as the backend service that processes the request. MFA is appropriate for interactive human access, but an unattended process should not depend on a person's password, browser session, or recurring MFA approval. If a backend acts on behalf of users, it must still enforce user-level authorization rather than assuming its own service permissions prove that every user request is allowed.

The main trade-off is replacing static-secret management with dependency on correctly configured trust, credential delivery, and renewal. Short-lived credentials reduce the useful lifetime of stolen credentials, but do not prevent theft or misuse before expiration. Protect metadata and container credential endpoints, restrict access to projected tokens and private keys, and prevent credentials from entering logs. Separate production and development identities, scope permissions to required actions and resources, and tightly control who can attach roles or pass them to services. A role trust policy controls who can assume the role; its permissions policies control what the resulting session can do.

Troubleshooting should distinguish credential acquisition from authorization failure. First confirm the effective caller identity, credential source, token expiration, and clock synchronization. Then inspect federation claims, role trust conditions, runtime role associations, and connectivity to required identity endpoints. If authentication succeeds but an API call is denied, examine identity policies, resource policies, permissions boundaries, session policies, and organization controls. Use audit records, including AWS CloudTrail events where supported, to connect activity to role sessions and workloads. Temporary credentials and managed rotation simplify operations, but neither replaces least privilege, runtime isolation, or monitoring.

Learn Workload Identity in lessons

5 short lessons on Workload Identity in 5 certification courses.

Open the lessons