INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

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.

What you will learn

Translate a business requirement into a permission brief, distinguish grants from permission limits, and identify what to test and review.

Prerequisite

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.

A permission brief for reading reports
QuestionRequired in this exampleOutside the requirement
Who?A report readerSharing credentials with the writing application
Which action?Read the required reportDelete, overwrite or change permissions
Which resource?The objects needed for the taskExtend to every resource without a reason
Under which conditions?Establish the conditions required by the workflowRemove conditions without checking their purpose

Scope actions, resources and conditions separately

Derive a permission scope from the business task
Derive a permission scope from the business task1: Read a report — Translate only the required actions into permissions. — Scope the grant. 2: Read a report — Define the conditions of use and the events that trigger a review. — Conditions and review12Read a reportScope the grantConditions andreviewDerive a permission scope from the business task1: Read a report — Translate only the required actions into permissions. — Scope the grant. 2: Read a report — Define the conditions of use and the events that trigger a review. — Conditions and review12Read a reportScope the grantConditions andreview
  1. Read a report → Scope the grantTranslate only the required actions into permissions.
  2. 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.

For the same report-reading task, check human authentication separately from the proposed action scope
Given human MFA statusActions in the permission proposalSeparate conclusion or check
Use verifiedOnly the required report readThe proposed actions match the task. Check target resources and conditions too.
Use verifiedRead and unnecessary deletionThe MFA premise is unchanged, but the proposal still includes an unnecessary delete action.
Use not verifiedOnly the required report readRestricting 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.

This reader only needs to open specified reports. MFA is in use, but the permission proposal includes GetObject for reading and an unnecessary DeleteObject action. What should be reviewed?
Read the answer and reason

Answer: Preserve the required read and review unnecessary deletion and the permission scope · Check MFA use separately from whether an action is needed. Exclude unnecessary deletion and scope access to the required resources and conditions. This reviews a permission proposal; it does not determine effective access.

A report application on EC2 must read the required reports through AWS APIs. Which access design should be considered first?
Read the answer and reason

Answer: Use temporary credentials through a supported runtime role, checking trust and required permissions · Consider a supported runtime role and temporary credentials for the application, with trust and least-privilege checks. Temporary credentials alone do not remove excessive permissions.

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.

There is no read grant, but the permissions boundary includes GetObject. Does that boundary alone grant a read?
Read the answer and reason

Answer: No, the boundary does not grant permission · The boundary sets a limit; it does not supply the missing grant. Check required grants separately from applicable limits.

Test required actions and relevant denied actions

  1. Write the task and identify its required actions and resources.
  2. Check policy syntax, applicability and conditions.
  3. Verify the required read and confirm that unnecessary deletion or permission changes are not allowed.
  4. 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

  1. Separate the read actions required by the task from unnecessary actions.
  2. Distinguish permission grants from permission limits.
  3. 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.