Discovers, risk-assesses, and remediates non-human identities across AWS, Azure, and GCP using offline rule-based analysis, privilege-escalation detection, and permissions-boundary containment.
An enterprise-grade, offline-first security automation platform that discovers, inventories, analyzes, risk-assesses, and safely remediates Non-Human Identities (NHIs) — service principals, service accounts, machine roles, access keys, and credentials — across AWS, Azure, and Google Cloud Platform (GCP).
⭐️ If you find this tool helpful for auditing and securing Non-Human Identities across clouds, please consider starring the repository!
| Cloud Provider | Identity Types Covered | Discovery Engine | Secret / Credential Inspection | Rules Active | Status |
|---|---|---|---|---|---|
| 🟧 AWS | IAM Roles, Machine Users, Groups, Policies | Boto3 + Session Caching | Access Keys (CreateDate, LastUsed) | 13 Rules (AWS_01–16, TAG_01) | ✅ Supported |
| 🟦 Azure | Entra ID Service Principals, App Registrations, Managed Identities | Pure REST (Graph & ARM) | Client Secrets (passwordCredentials), Certs (keyCredentials) | 5 Rules (AZURE_01–05) | ✅ Supported |
| 🟥 GCP | Service Accounts, Workload Identity, IAM Roles | Pure REST (IAM & Resource Mgr) | Service Account Keys (validAfterTime, user-managed) | 6 Rules (GCP_01–06) | ✅ Supported |
🧪 Test Suite Status: 102 passed, 4 subtests passed (100% GREEN) across all providers and engines.
NHI Risk Analyzer addresses a critical multi-cloud security challenge: modern enterprise cloud environments accumulate hundreds of machine and non-human identities (service accounts, automation roles, CI/CD credentials, cross-cloud trust roles) with minimal visibility into which identities are over-privileged, dormant, or introduce privilege-escalation risk.
The platform enforces strict architectural decoupling across three distinct phases:
inventory.json snapshot via lightweight, cloud-native mechanisms (Boto3 session-cached for AWS; zero-dependency pure REST for Azure and GCP).Enterprise multi-cloud environments routinely contain non-human identities that are:
NHI Risk Analyzer automates discovery, security analysis, and targeted remediation across cloud providers using cloud APIs and offline rule processing.
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ AWS IAM │ │ Azure Entra │ │ GCP IAM │
│ (Boto3) │ │ (Pure REST) │ │ (Pure REST) │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘
│ │ │
└────────────────┐ │ ┌────────────────┘
▼ ▼ ▼
┌───────────────────────────┐
│ inventory.py │
│ (Multi-Cloud Collector) │
└─────────────┬─────────────┘
▼
┌───────────────────────────┐
│ inventory.json │
│ (Unified State Snapshot) │
└─────────────┬─────────────┘
│
▼
┌───────────────────────────┐
│ risk.py │
│ (--cloud Orchestrator) │
└─────────────┬─────────────┘
│
┌────────────────────────┼────────────────────────┐
▼ ▼ ▼
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ aws.py sub- │ │ azure.py sub-│ │ gcp.py sub- │
│ runner │ │ runner │ │ runner │
│ (13 Rules) │ │ (5 Rules) │ │ (6 Rules) │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘
└────────────────────────┼────────────────────────┘
▼
┌───────────────────────────┐
│ dispatch.py │
│ (Containment Dispatcher) │
└─────────────┬─────────────┘
│
┌────────────────────────┴────────────────────────┐
▼ ▼
┌─────────────────────────┐ ┌─────────────────────┐
│ policy_surgery.py & │ │ credential.py │
│ policy.py (Boundaries) │ │ (Deactivate Key) │
└─────────────────────────┘ └─────────────────────┘
nhi/services/inventory.py): Queries cloud APIs across AWS, Azure, and GCP, enriches credential metadata (access key last-used, secret expiration), and serializes a clean state snapshot to inventory.json.nhi/risk/risk.py): Accepts --cloud {aws,azure,gcp,all} to selectively target cloud providers, saving unnecessary API calls and avoiding cross-tenant rate limits.nhi/risk/runners/): Decoupled execution engines (aws.py, azure.py, gcp.py) process provider inventories against modular security rules with defensive guards against partial or missing cloud payloads.nhi/services/export.py, nhi/remediation/diff.py): Calculates security drift against historical baseline scans, uploads execution artifacts to cloud storage, and exports findings to CSV and OASIS SARIF v2.1.0 for audit pipelines.nhi/remediation/): AST-level policy statement partitioning (policy_surgery.py) and non-destructive containment boundaries/key deactivation with dry-run simulation mode and nhi-ignore.yaml exemptions.To eliminate redundant AWS STS authentication calls during inventory collection, authenticated boto3.Session objects are cached for the lifetime of the Python process in nhi/aws/session.py.
AssumeRole calls reduced: 35 → 179.58s → 45.67s (~43% runtime improvement)session.py, requiring zero logic changes to discovery or rule modules.