IAM Policy Explainer - Local-first IAM policy analyzer with deterministic risk detection
Project description
iamx - IAM Policy Explainer
A local-first IAM policy analyzer that scans AWS IAM JSON policies, detects risky patterns deterministically, explains them in plain English, assigns severity levels, and suggests least-privilege fixes.
🎯 Why iamx?
Copy-pasting IAM policies into ChatGPT is unsafe, inaccurate, and doesn't scale for bulk analysis. Manual policy review is time-consuming and error-prone.
iamx solves these problems:
- ✅ Accuracy first - Static parser + deterministic rules (no hallucinations)
- ✅ Human-readable explanations - Plain English descriptions of risks
- ✅ Bulk scanning - Process multiple policies efficiently
- ✅ CI/CD integration - GitHub Actions with configurable thresholds
- ✅ Privacy-first - Local by default, optional AI summaries
- ✅ Multiple outputs - Markdown, JSON, and interactive web reports
🚀 Features
Core Analysis
- Deterministic pattern detection - No AI hallucinations, consistent results
- Risk severity classification - Critical/High/Medium/Low based on impact
- Plain English explanations - Understandable descriptions of each finding
- Least-privilege suggestions - Specific recommendations for policy improvements
Supported Patterns
- Overly permissive actions (
*permissions) - Wildcard resources without restrictions
- Cross-account access patterns
- Administrative actions detection
- Data access actions analysis
- Missing resource restrictions
- Sensitive service permissions
Output Formats
- CLI - Terminal output with color-coded results
- Web UI - Interactive local web interface
- Markdown - Detailed reports for documentation
- JSON - Machine-readable output for CI/CD
- GitHub Actions - Automated policy reviews in PRs
🛠️ Installation
# Clone the repository
git clone https://github.com/yourusername/iamx.git
cd iamx
# Install dependencies
pip install -e .
# Or install directly from PyPI (when published)
pip install iamx
📖 Quick Start
CLI Usage
# Analyze a single policy file
iamx analyze policy.json
# Analyze multiple policies
iamx analyze policies/*.json
# Generate detailed report
iamx analyze policy.json --output report.md --format markdown
# Set severity threshold for CI
iamx analyze policy.json --fail-on high
Web UI
# Start the local web interface
iamx web
# Open http://localhost:8080 in your browser
GitHub Actions Integration
name: IAM Policy Review
on: [pull_request]
jobs:
iamx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run iamx
uses: yourusername/iamx-action@v1
with:
path: 'policies/'
fail-on: 'high'
output: 'iamx-report.md'
📊 Example Output
🔍 Analyzing IAM Policy: admin-policy.json
❌ CRITICAL: Overly Permissive Actions
The policy grants '*' permissions on all resources for ec2:* actions.
This allows full EC2 control including instance termination and data access.
Recommendation: Replace with specific actions like:
- ec2:DescribeInstances
- ec2:StartInstances
- ec2:StopInstances
⚠️ HIGH: Missing Resource Restrictions
The policy allows s3:GetObject on any S3 bucket without restrictions.
This could expose sensitive data across all buckets.
Recommendation: Add resource ARN restrictions:
"Resource": "arn:aws:s3:::my-bucket/*"
✅ LOW: Consider Adding Conditions
The policy doesn't require MFA for administrative actions.
Recommendation: Add MFA condition for sensitive operations.
🏗️ Architecture
iamx/
├── core/ # Core analysis engine
├── cli/ # Command-line interface
├── web/ # Web UI components
├── rules/ # Policy analysis rules
├── reports/ # Report generators
├── github/ # GitHub Actions integration
└── tests/ # Test suite
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
# Clone and setup development environment
git clone https://github.com/yourusername/iamx.git
cd iamx
pip install -e ".[dev]"
# Run tests
pytest
# Run linting
black .
flake8 .
📄 License
MIT License - see LICENSE for details.
🙏 Acknowledgments
- Built with modern Python tooling and best practices
- Designed for the security and DevOps community
- Inspired by the need for better IAM policy analysis tools
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iamx-0.1.0.tar.gz.
File metadata
- Download URL: iamx-0.1.0.tar.gz
- Upload date:
- Size: 31.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cdc5b83f9002d116dda8926bb9c047c839dfba5b108426174709249412ef7a62
|
|
| MD5 |
55af376f8e2c9425cf8225bbb973e8a6
|
|
| BLAKE2b-256 |
c5debd1427804627c6b1545a0cafbd427cf6d60024a884f67e6804abd58cd8ef
|
File details
Details for the file iamx-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iamx-0.1.0-py3-none-any.whl
- Upload date:
- Size: 31.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0af787d0c30e511099268aeef36e1a8f248dec7180a7649cb0f470487615db5b
|
|
| MD5 |
10433815f68fff44a6e024bccb605155
|
|
| BLAKE2b-256 |
a4fd7ba670bbdfde42caf8ea443da941d085239848ebb2a6b7433baa388e06de
|