Skip to content

pandalyt1c/iam-lens

Repository files navigation

IAM Lens

Visualize AWS IAM policies in your browser. No backend, no account, no telemetry.

🔗 Live: iamlens.dev

IAM Lens screenshot

What it does

Paste an AWS IAM policy JSON and get three things:

  • Visual graph — principals, actions, and resources rendered as a draggable React Flow graph so you can see the shape of permissions at a glance.
  • Plain-English summary — what the policy actually grants, statement by statement.
  • Risk audit — automated flags for the patterns that go wrong in production:
    • Full administrative access (Action: * + Resource: *)
    • Wildcard actions or resources used carelessly
    • NotAction / NotResource with Allow (almost always over-grants)
    • Public principals (Principal: *)
    • Sensitive actions without Condition gating: iam:PassRole, sts:AssumeRole
    • Known privilege-escalation chains from the Rhino Security list

The parser is hand-written TypeScript — deterministic, no LLM, no AWS SDK, no network calls. Your policy never leaves the browser.

Why

Reading IAM policies as raw JSON is a pain, especially during audits or PR reviews. Existing tools either need AWS API access (Access Analyzer, Policy Simulator) or charge for it. I wanted something I could paste into and immediately see the shape of the permissions.

Learn IAM

Short, opinionated guides to the IAM patterns that actually matter in production:

Full library →

Stack

  • Next.js 16 with static export
  • TypeScript (strict)
  • React Flow (@xyflow/react) for the graph
  • Tailwind CSS + shadcn/ui
  • next-mdx-remote for the /learn content
  • Vitest for the parser tests
  • Cloudflare Pages for hosting

Run locally

git clone https://github.com/pandalyt1c/iam-lens.git
cd iam-lens
npm install
npm run dev

Then open http://localhost:3000.

Run the tests

npm test

The parser test suite covers happy paths, malformed inputs, and risk-flag detection.

Project structure

app/                  Next.js routes (/, /learn, /learn/[slug])
components/           UI components (PolicyGraph, RiskFlags, etc.)
content/learn/        MDX articles for the learn section
lib/parser/           Hand-written IAM policy parser
  ├── types.ts        Type definitions for parsed policies
  ├── parse.ts        Top-level parser
  ├── normalize.ts    Coerces single-vs-array fields to canonical form
  ├── analyze.ts      Risk detection rules
  ├── summary.ts      Plain-English summary generator
  └── __tests__/      Vitest tests

Not what this does

Important: IAM Lens is a static reader, not a policy simulator. It can't tell you "if I attach this policy to user X, can they call s3:GetObject on bucket Y" — that requires the actual identity context, attached managed policies, SCPs, and permission boundaries.

For real simulation, use:

This tool answers a different question: "what does this single policy document grant, in isolation?"

Contributing

Risk-rule suggestions, parser edge cases, and policy shapes that confuse the analyzer are all welcome. Open an issue with an example policy and I'll take a look.

License

MIT

About

Free AWS IAM policy visualizer — turn cryptic JSON into clear visual graphs.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages