Skip to main content

IAM Policy Analyzer & Fixer

Project description

iamarmor

IAM Policy Analyzer & Fixer

Status: Week 3 — CLI + config + PyPI publish

The iamarmor lint CLI is live. Install from PyPI, point it at a Terraform directory, and get actionable findings in seconds.

Quickstart

# Install (requires Python 3.10+)
pipx install iamarmor

# Lint the current directory
iamarmor lint .

# Lint a specific file
iamarmor lint modules/iam/main.tf

# Machine-readable output for CI pipelines
iamarmor lint . --format json

iamarmor lint exits 0 when clean, 1 when findings meet the fail_on threshold (default: medium), 2 on usage/config errors, and 3 on internal errors — making CI integration trivial.

Configuration

Place a .iamarmor.yml in the root of your Terraform repository:

version: 1
severity_threshold: low   # report findings at or above this level (default: info)
fail_on: high             # exit 1 only for high/critical (default: medium)

rules:
  ignore: [IAM004]        # skip specific rules

iamarmor auto-discovers the config by walking upward from the linted path (same pattern as .eslintrc). Use --no-config to skip loading.

See docs/config.md for the full configuration reference.

Pre-commit

Add to your .pre-commit-config.yaml:

repos:
  - repo: https://github.com/iam-armor/iamarmor
    rev: v0.1.0
    hooks:
      - id: iamarmor

See docs/pre-commit.md for details.

Default rule pack

iamarmor ships with 10 default IAM rules covering the most common misconfigurations:

ID Name Severity
IAM001 No Action: "*" High
IAM002 No Resource: "*" with sensitive actions High
IAM003 No inline policies Medium
IAM004 IAM roles must set max_session_duration Low
IAM005 No iam:PassRole with Resource: "*" High
IAM006 No wildcard Principal in resource-based policies High
IAM007 assume_role_policy must specify a concrete principal High
IAM008 No NotAction in Allow statements Medium
IAM009 No NotResource in Allow statements Medium
IAM010 Do not attach AdministratorAccess managed policy High

See STARTER_RULES.md for full documentation of each rule.

Python API

The CLI is the recommended entry point for most users. For embedding iamarmor in other tools, the Python API is also public:

from iamarmor import extract_from_directory, RuleEngine, load_default_rules

resources = extract_from_directory("path/to/terraform/")
engine = RuleEngine(rules=load_default_rules())
findings = engine.run(resources)

for finding in findings:
    print(f"[{finding.rule_id}] {finding.severity.value.upper()}{finding.message}")

Installation (development)

pip install -e ".[dev]"

Running tests

pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iamarmor-0.1.0.tar.gz (37.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iamarmor-0.1.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file iamarmor-0.1.0.tar.gz.

File metadata

  • Download URL: iamarmor-0.1.0.tar.gz
  • Upload date:
  • Size: 37.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for iamarmor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9f254d871cd50d60b4dd90135f1762e3695a04082242555f4853d7cc081f3761
MD5 239bc6907d0325df384aeae78322fe15
BLAKE2b-256 2c9df2190299066bd3eceb44180e158619da7659861a3ce12d548b15e09b87be

See more details on using hashes here.

Provenance

The following attestation bundles were made for iamarmor-0.1.0.tar.gz:

Publisher: publish.yml on iam-armor/iamarmor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file iamarmor-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iamarmor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for iamarmor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e755fe19912b8c624fd82c575f33f5f14fe1ff79e64dfaf28a0cdf0946e7ca8
MD5 addfe305bc59ed6dac3bc284fcd6e367
BLAKE2b-256 092ec7809c55e72fcade14ea29eb8cab4e31bc1008893f85088795c69b6a8d25

See more details on using hashes here.

Provenance

The following attestation bundles were made for iamarmor-0.1.0-py3-none-any.whl:

Publisher: publish.yml on iam-armor/iamarmor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page