DevTools Logo

AWS IAM Least-Privilege Generator

AWS IAM Least-Privilege Generator

Build a scoped IAM policy from a curated service and action catalog in your browser.

Service actions

Only actions from the built-in catalog can be selected. Use one resource ARN per line.

Amazon S3
Amazon DynamoDB
Amazon SQS
Amazon SNS
AWS Lambda
Amazon CloudWatch Logs
Amazon EC2
AWS STS

About

Select common AWS service actions, provide resource ARN templates, and add optional SourceIp or S3 prefix conditions. Everything runs locally in your browser.

Examples

S3 read-only policy

Input
buildAwsIamPolicy({ selections: [{ service: "s3", actions: ["s3:GetObject", "s3:ListBucket"] }], resources: { s3: ["arn:aws:s3:::reports", "arn:aws:s3:::reports/*"] } })
Output
Action: ["s3:GetObject", "s3:ListBucket"], Resource: both report ARNs

Read-only actions serialize sorted with explicit bucket ARNs and validate cleanly as JSON.

Unknown action filtered with placeholder

Input
buildAwsIamPolicy({ selections: [{ service: "sqs", actions: ["sqs:SendMessage", "sqs:DeleteQueue"] }] })
Output
Action: ["sqs:SendMessage"], Resource: ["arn:aws:sqs:${region}:${account}:${queue}"]

DeleteQueue is not in the catalog so it is dropped, and the SQS template placeholder fills the Resource.

About this tool

AWS IAM Least-Privilege Generator builds a least-privilege policy with buildAwsIamPolicy(config): selections are intersected against the embedded AWS_IAM_CATALOG (s3, dynamodb, sqs, sns, lambda, logs, ec2, sts), unknown actions like sqs:DeleteQueue are silently dropped, and the surviving Action list sorts deterministically before serialization.

Resources resolve per selected service: explicit resources win (trimmed, blanks dropped), otherwise the catalog's resourceTemplates supply placeholders such as arn:aws:s3:::${bucket} or arn:aws:sqs:${region}:${account}:${queue}, deduplicated across services and defaulting to ["*"] when nothing resolves. An optional conditions map attaches as a key-sorted Condition block.

The output is canonical JSON ({Version: 2012-10-17, Statement: [{Effect, Action, Resource, Condition?}]}) that validateAwsIamPolicy can re-check for version, Effect, Action, and Resource presence. All catalog data is local, so account IDs and queue names never leave the browser.

How to use this tool

  1. Select services and catalog actions

    Tick only the actions each workload needs — anything outside the embedded catalog is filtered out automatically.

  2. Fill in resource ARNs or keep placeholders

    Provide concrete ARNs per service, or leave them blank to emit template placeholders like ${bucket} for later substitution.

  3. Add conditions and effect

    Attach an optional Condition map (e.g. StringEquals on aws:PrincipalTag/team) and pick Allow or Deny for the Effect.

  4. Copy and validate the JSON

    Paste the sorted policy into IAM and run it through validateAwsIamPolicy or the IAM policy simulator before attaching.

Use cases

Scoping application roles

Generate minimal S3/DynamoDB/SQS statements for a service role instead of hand-writing wildcards.

Drafting reviewable policies

Produce sorted, deterministic JSON that diffs cleanly in pull-request review.

Templating multi-account policies

Emit ${region}/${account} placeholders for pipelines that substitute per environment.

Common mistakes

Mistake:Requesting an action and assuming it appears verbatim.

Fix:Only catalog-listed actions survive — sqs:DeleteQueue is dropped silently, so check getAwsIamActions(service) for the supported set.

Mistake:Expecting an empty Resource when no ARNs are given.

Fix:Missing resources fall back to catalog templates (or "*"), never to an empty list — substitute the placeholders before deploying.

Mistake:Hand-editing the JSON and breaking its shape.

Fix:Keep Version 2012-10-17 with Statement Effect/Action/Resource, or validateAwsIamPolicy will flag the missing fields.

Frequently asked questions

What does this tool do?

It builds a least-privilege IAM policy with buildAwsIamPolicy: selections intersect the embedded catalog (s3, dynamodb, sqs, sns, lambda, logs, ec2, sts), Actions sort deterministically, Resources resolve to explicit ARNs or template placeholders, and an optional Condition block attaches sorted.

What happens to actions outside the catalog?

They are silently dropped — sqs:DeleteQueue is not a catalog action, so requesting it alongside sqs:SendMessage yields only SendMessage. Check getAwsIamActions(service) for the supported set.

Is my account data uploaded or stored?

No. The catalog is embedded and policy assembly runs locally — account IDs, ARNs, and conditions never leave your browser.

How are resources and conditions filled in?

Explicit per-service ARNs win (trimmed, blanks dropped); otherwise catalog templates like arn:aws:s3:::${bucket} apply, defaulting to ["*"] when nothing resolves. Conditions serialize as a key-sorted Condition block, and validateAwsIamPolicy re-checks Version, Effect, Action, and Resource.

References & standards

.env Secret Safety Linter

Validate .env syntax and spot likely leaked credentials or placeholder secrets.

.htaccess Generator

Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth

2D Fluid Dynamics & Particle Physics Sandbox

A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.

AI Function Calling Schema Generator

Generate function calling JSON schemas from TypeScript interfaces

Algorithm Arena & Data Structure Visualizer

Interactive arena for algorithms and data structures: eight sorting algorithms racing on one seeded input, six pathfinding algorithms walking generated mazes, and BST, AVL, Red-Black, B-tree, heap and trie operations replayed step by step with rotations highlighted. Every run shows the Big-O table and the phase-highlighted reference implementation in four languages, and compared values can be played as pitch (sonification) through the shared audio engine. Everything runs client-side; inputs never leave the browser.

Ansible Playbook Generator

Build an Ansible playbook — hosts, vars, and tasks with modules — as YAML