Topic lessonTopic: IAM: roles and permission limits
IAM users vs roles: people, workloads and temporary credentials
An IAM user is a persistent identity in an account; an IAM role is an identity that authorized principals can assume. Assuming a role provides a session with expiring credentials. Rather than mapping every person to an IAM user and every app to an access key, compare how a staff member and a document app read reports.
Separate identities from credentials and explain suitable temporary-access paths and prerequisites for people and workloads.
Authentication establishes who is requesting; authorization decides whether an operation is permitted. A workload is an application or collection of processing resources. Federation connects authentication by an external identity provider to AWS access. No real account is needed.
Separate identity, credentials and permissions
| Dimension | IAM user | IAM role |
|---|---|---|
| Identity | A persistent identity within an account | An identity assumable by authorized principals |
| Credentials | Can have long-term access keys or a console password when configured | No standard long-term password or access keys on the role itself |
| When used | Requests use credentials associated with that user or an applicable session | Requests use temporary credentials for a role session |
| Permissions | Attached policies and applicable controls | Role, session, resource policies and other applicable controls |
An IAM user does not necessarily represent one human, and a role is not exclusively for apps. People can use roles through federation, while services and applications also use roles. Naming an identity does not grant it access.
Choose an option to see the result and explanation.
One report, two kinds of caller
- Staff member → Workforce roleHuman authentication leads to authorized account/role access.
- Document app → App roleThe workload uses its runtime role through a separate access path.
- Staff member
- Authenticates through the organization’s identity provider.
- Workforce role
- Access follows the Identity Center or federation configuration.
- Document app
- An EC2 workload in this example; no employee key is distributed.
- App role
- Uses temporary credentials through supported runtime and SDK mechanisms.
A staff member authenticates with an organizational identity; the document app uses its workload role. Even if both read the same monthly report, they do not need to share one access key. Their principals, actions and resource permissions can be designed separately.
Choose a path for people and workloads inside or outside AWS
| Caller | First approach to consider | Prerequisites to check |
|---|---|---|
| Staff | Federation and temporary credentials; Identity Center for centralized access | Identity provider, MFA, access assignments and tool support |
| App on EC2 or Lambda | A role supported by the execution service | Role attachment, trust, SDK credential discovery and refresh |
| External CI or workload | Federation such as OIDC, or IAM Roles Anywhere | Identity provider or certificates, trust conditions and tool support |
| An unsupported temporary-access use case | Assess whether an IAM user is justified | Restricted purpose, storage, rotation, retirement and applicable MFA controls |
OIDC means OpenID Connect, an identity-federation protocol. IAM Identity Center centrally manages workforce access to AWS accounts and applications. One method is not automatically supported by every tool; review the existing platform and product capabilities.
Choose an option to see the result and explanation.
Temporary access still requires permission and credential controls
Role sessions expire; expired credentials cannot simply continue authorizing operations. Use supported credential discovery and refresh mechanisms rather than putting credential values in source code or lesson forms. Short-lived access and least privilege are separate properties.
A role’s trust policy governs who can assume it; its permissions policies describe operations available through the role. Being trusted does not automatically grant reading or deleting every report. The AssumeRole lesson separates these requests in detail.
Choose an option to see the result and explanation.
Checks before creating identities
- Separate human and workload callers.
- Check identity providers, execution environment and tool support.
- Choose a supported temporary-access path and identify its principal.
- Limit actions/resources/conditions; check expiration and refresh.
- Record the justification and ownership of any long-term credential exception.
Check, then explain in your own words
- Explain identities, credentials and permissions separately.
- Choose supported temporary-access paths for people and apps.
- Check prerequisites and exceptions instead of defaulting to long-term keys.
Check your understanding: Is “users for people, keys for apps” a sound rule?
Start with suitable temporary-access methods and their prerequisites.
Both people and workloads can use roles and federation. An identity type alone does not determine permissions or credential-management requirements.
Sources and conditions checked
The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.
- IAM rolesChecked:
Scope and conditionsIAM role identity, trust, temporary credentials; role versus session.
Used in this lessonSeparate identity, credentials and permissions One report, two kinds of caller Choose a path for people and workloads inside or outside AWS Temporary access still requires permission and credential controls
- Security best practices in IAMChecked:
Scope and conditionsFederated human access/Identity Center; workload temporary role credentials; least privilege, long-term credentials only for justified use cases.
Used in this lessonSeparate identity, credentials and permissions One report, two kinds of caller Choose a path for people and workloads inside or outside AWS Temporary access still requires permission and credential controls
- AssumeRole API referenceChecked:
Scope and conditionsPermissions; same/cross-account trust; temporary credentials; session policies; DurationSeconds/role chaining. No API executed.
Used in this lessonTemporary access still requires permission and credential controls