Topic lessonTopic: IAM: identity and permissions
IAM least privilege: scope actions, resources and conditions
Least privilege means granting the actions needed for a task, limited to the necessary resources and conditions. Start with the job rather than a broad permission that happens to work. Use a report-reading role to separate required access from unnecessary actions. The examples are design notes, not a policy to apply directly to a real account.
Translate a business requirement into a permission brief, distinguish grants from permission limits, and identify what to test and review.
Understand Action, Resource and Effect in IAM policies. Consult the relevant primary documentation for condition keys, resource-based policies and other evaluation interactions.
Describe the task before selecting permissions
The example reader needs to open specified monthly reports each morning. Keep this identity separate from the application that writes reports. Replace “needs S3” with a concrete statement of which report must be read and why.
| Question | Required in this example | Outside the requirement |
|---|---|---|
| Who? | A report reader | Sharing credentials with the writing application |
| Which action? | Read the required report | Delete, overwrite or change permissions |
| Which resource? | The objects needed for the task | Extend to every resource without a reason |
| Under which conditions? | Establish the conditions required by the workflow | Remove conditions without checking their purpose |
Scope actions, resources and conditions separately
- Read a report → Scope the grantTranslate only the required actions into permissions.
- Read a report → Conditions and reviewDefine the conditions of use and the events that trigger a review.
- Read a report
- State the business purpose and required operation first.
- Scope the grant
- Match the read operation to its required target.
- Conditions and review
- Review usage conditions, role changes and unused access.
A wildcard (*) broadens a matching expression. Before extending access to every action or resource, identify the required actions and the resource types those actions support. A shorter policy document is not necessarily a least-privilege policy.
Multi-factor authentication (MFA) protects human authentication with an additional factor rather than relying on a password alone. Least privilege limits granted actions, resources and conditions to what a person or application needs. Using MFA does not automatically remove an unnecessary delete action from a permission proposal. Unnecessary permissions can increase the damage from compromised authentication or a legitimate user’s mistake.
| Given human MFA status | Actions in the permission proposal | Separate conclusion or check |
|---|---|---|
| Use verified | Only the required report read | The proposed actions match the task. Check target resources and conditions too. |
| Use verified | Read and unnecessary deletion | The MFA premise is unchanged, but the proposal still includes an unnecessary delete action. |
| Use not verified | Only the required report read | Restricting actions does not verify MFA use. Check the human authentication path. |
The table compares fictional designs; it is not a result from testing effective access. “Not verified” does not mean “no MFA.” Check human MFA through the identity system and sign-in or role-assumption path actually used. A design may also use MFA context in permission conditions, but the applicable identities, credentials and condition keys must be checked; unnecessary actions still need review. For an application on EC2, consider a supported runtime role and temporary credentials (credentials that expire). Do not apply human IAM-user MFA device registration indiscriminately to every application role.
Choose an option to see the result and explanation.
A permissions boundary limits grants; it does not add them
A permissions boundary limits the permissions that identity-based policies can grant. The boundary does not itself grant permission. Keep “grants access” separate from “limits the grant.” Effective access must also account for applicable resource policies and other evaluation rules.
Choose an option to see the result and explanation.
Test required actions and relevant denied actions
- Write the task and identify its required actions and resources.
- Check policy syntax, applicability and conditions.
- Verify the required read and confirm that unnecessary deletion or permission changes are not allowed.
- Review role changes, new targets and permissions that are no longer needed.
Usage evidence helps with reviews, but “not used recently” does not mean “never needed.” Check periodic jobs and incident-response requirements with the task owner. Generated policy suggestions also require inspection and testing before adoption.
Use the lab to separate a grant from a limit
The IAM lab’s boundary input represents a bounded action limit. Even with an identity-side Allow, an action outside that limit does not satisfy the model. This is not a full implementation of real permissions boundaries or a validator of least privilege in a real deployment.
Check, then explain in your own words
- Separate the read actions required by the task from unnecessary actions.
- Distinguish permission grants from permission limits.
- Change one condition in the IAM lab and explain why the result changed.
Check your understanding: Would adding DeleteObject to the report reader satisfy least privilege for this task?
No. Deleting objects is outside the stated requirement.
A convenient extra permission is different from a required one. A concrete task definition exposes excessive actions, resource scope and conditions.
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 security best practicesChecked:
Scope and conditionsFederation, temporary credentials and least privilege
Used in this lessonDescribe the task before selecting permissions Scope actions, resources and conditions separately A permissions boundary limits grants; it does not add them Test required actions and relevant denied actions
- IAM policy evaluation logicChecked:
Scope and conditionsPolicy types and context matter; identity-only lab is a subset
Used in this lessonA permissions boundary limits grants; it does not add them
- IAM JSON policy elementsChecked:
Scope and conditionsAWS policy syntax is broader than the educational input schema
Used in this lessonDescribe the task before selecting permissions Scope actions, resources and conditions separately
- 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 lessonScope actions, resources and conditions separately
- IAM rolesChecked:
Scope and conditionsIAM role identity, trust, temporary credentials; role versus session.
Used in this lessonScope actions, resources and conditions separately
Scope and conditionsMFA context conditions depend on principal and credential path. This key is not universally present, including for federated identities and long-term access keys. This supplement provides no deployable MFA condition policy.
Used in this lessonScope actions, resources and conditions separately