Skip to main content

Terraform pre-apply risk and blast radius analyzer

Project description

IACGuard

Terraform pre-apply risk and blast radius analyzer

Know the blast radius of every Terraform change before you apply it.

IACGuard reads your Terraform plan, runs deterministic safety rules against every planned change, and tells you what is dangerous — before anything is touched. Full CI/CD support via JSON output and exit codes.


Install

pip install iacguard

Quick start

# Generate a plan file
terraform plan -out=tfplan
terraform show -json tfplan > plan.json

# Analyze it
iacguard plan --plan plan.json

# CI mode (JSON output + exit codes)
iacguard plan --plan plan.json --ci

What it checks (v0.1.0)

Rule Severity What it detects
RDS001 CRITICAL RDS instance being replaced (data loss risk)
SG001 CRITICAL SSH port 22 open to 0.0.0.0/0 or ::/0
S3001 MEDIUM S3 bucket with no explicit public access block

Exit codes

Code Meaning
0 No critical findings — safe to proceed
1 Critical findings found — review before applying
2 Tool error (bad file, parse failure)

Flags

--plan PATH      Path to terraform plan JSON file
--dir  PATH      Terraform directory (auto-generates plan)
--ci             JSON output + exit codes (for pipelines)
--severity LEVEL Show only: critical, high, medium, low
--no-aws         Skip AWS API calls
--explain        AI explanation (requires ANTHROPIC_API_KEY)

GitHub Actions example

- name: IACGuard risk check
  run: |
    pip install iacguard
    terraform show -json tfplan > plan.json
    iacguard plan --plan plan.json --ci

Architecture

IACGuard is 100% deterministic. Rules are pure Python functions — they fire the same way every time. AI (optional --explain flag) only explains findings after the rule engine has already decided. AI never decides risk level and never runs in CI mode.

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

iacguard-0.1.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

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

iacguard-0.1.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iacguard-0.1.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for iacguard-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0db23ed11f9dfe9a7a482ff72a45450241897605712dc9148cc36a9e43dc371d
MD5 b58f0027950673d58683e44facd8b58a
BLAKE2b-256 88c44fe9d078581a8f40363cef2cca51f0f0b9cd4414b8d7f49048bdb3c30fad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iacguard-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for iacguard-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10b5204316759ece0d2607f7e76043da4d2ae3be9fa691c072634fac857c5311
MD5 e263d5330c98e4efabc0b262bbe1f796
BLAKE2b-256 b30225465f0773cae7ba29d23a1892a94b7efc1d1001a5e087b68bd746e0511d

See more details on using hashes here.

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