Skip to content
Back to skills

Aws Iam Least Privilege

ASecurity

Narrows AWS IAM policies to the actions and resources a workload really uses, based on code and access logs, with every change explained.

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added November 15, 2026
ai-agentsrustawsterraform

Works with

  • cli

Security analysis

A100/100

Scanned November 15, 2026

npx -y skills add workspace-templates/ai-agent-templates --skill aws-iam-least-privilege --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Aws Iam Least Privilege?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Aws Iam Least Privilege
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/workspace-templates-aws-iam-least-privilege/badge)](https://www.skillsdirectory.com/skills/workspace-templates-aws-iam-least-privilege)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: aws-iam-least-privilege
description: Narrows AWS IAM policies to the actions and resources a workload really uses, based on code and access logs, with every change explained.
---

# AWS IAM least privilege

Reduce permissions to what is used, and prove it before removing anything.

## Steps

1. List the policies in scope: inline, managed and trust policies in IaC files (Terraform, CloudFormation, CDK) or exported JSON.
2. Establish usage from three sources: the AWS SDK calls in the code (`grep` for client and command names), CloudTrail or `aws iam generate-service-last-accessed-details`, and IAM Access Analyzer findings if present.
3. Rewrite each statement:
   - replace `Action: "*"` and `service:*` with the named actions in use
   - replace `Resource: "*"` with specific ARNs, using prefixes like `arn:aws:s3:::my-bucket/uploads/*` where names are dynamic
   - add `Condition` keys that pin region, `aws:PrincipalOrgID`, VPC endpoint, or tag where they fit
   - split read and write into separate statements
4. Check trust policies: a specific principal, an `ExternalId` for cross-account roles, no `Principal: "*"` without conditions.
5. Validate with `aws accessanalyzer validate-policy` and, where possible, `aws iam simulate-principal-policy` for the calls the code makes.

## Rules

- Never remove a permission you cannot show is unused. Put it under "unconfirmed".
- Never apply policy changes to a live account; edit the files and let the user deploy.
- Keep `iam:PassRole` and `sts:AssumeRole` scoped to exact role ARNs.

## Report

Per policy: before and after actions, resources narrowed, evidence used, and the unconfirmed list.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.