
CLI tool to audit Azure security posture, RBAC, NSGs, storage, identity, and encryption
| ID | Category | Check | Severity |
|---|
| AZ-001 | RBAC | Owner / Contributor assigned at subscription scope | CRITICAL |
| AZ-002 | RBAC | Owner / Contributor assigned at resource group scope | HIGH |
| AZ-003 | Network | NSG with 0.0.0.0/0 inbound allow rule | HIGH |
| AZ-004 | Storage | Storage account with public blob access enabled | HIGH |
| AZ-005 | Identity | Entra ID user without MFA registered | HIGH |
| AZ-006 | Identity | Service principal with Owner / Contributor permissions | HIGH |
| AZ-007 | Encryption | Managed disk without explicit encryption configuration | MEDIUM |
| AZ-008 | Encryption | Key Vault exposed to public network without firewall restrictions | HIGH |
| AZ-009 | Monitoring | Activity log retention below 90 days | MEDIUM |
| AZ-010 | Monitoring | Microsoft Defender for Cloud not enabled on key resource types | HIGH |
| AZ-011 | Monitoring | Key Vault without diagnostic logging enabled | MEDIUM |
| AZ-012 | Compute | Virtual Machine with public IP directly attached | MEDIUM |
| AZ-013 | Compute | Virtual Machine without endpoint protection extension | MEDIUM |
| AZ-014 | Compute | Virtual Machine OS disk without Azure Disk Encryption (ADE) | MEDIUM |
| AZ-015 | Network | RDP port 3389 exposed to internet via NSG | CRITICAL |
| AZ-016 | Network | SSH port 22 exposed to internet via NSG | CRITICAL |
| AZ-017 | Storage | Storage account permitting non-HTTPS traffic | HIGH |
| AZ-018 | Storage | Storage account allowing legacy TLS versions (below 1.2) | MEDIUM |
| AZ-019 | Identity | Guest user accounts present in Entra ID tenant | LOW |
| AZ-020 | Encryption | Key Vault missing soft delete or purge protection | MEDIUM |
az login (Azure CLI)AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_IDReader on the subscriptionUserAuthenticationMethod.Read.AllApplication.Read.AllIdentity checks (AZ-005, AZ-019) are skipped gracefully if Graph API permissions are unavailable — the rest of the audit runs unaffected.
pip install -e .
# Full audit — all checks, all severities
azure-auditor
# Target a specific subscription
azure-auditor --subscription <subscription-id>
# Show only HIGH and CRITICAL findings
azure-auditor --severity HIGH
# Save JSON report to a specific directory
azure-auditor --output-dir ./reports
# Terminal output only
azure-auditor --no-json
# Verbose logging
azure-auditor --verbose
Or without installing:
PYTHONPATH=src python -m azure_security_auditor.cli --subscription <id>
Terminal — Rich-formatted table, sorted by severity (CRITICAL first):
╭──────────────────────────────────────────────────────────────────╮
│ Azure Security Posture Audit │
│ Subscription: My Production Subscription │
│ ID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx │
│ Run at: 2026-07-12T10:00:00Z │
│ Findings: 12 total (2 CRITICAL 6 HIGH 4 MEDIUM 0 LOW) │
╰──────────────────────────────────────────────────────────────────╯
Severity Check ID Check Resource Detail
✖ CRITICAL AZ-015 RDP Port 3389 Exposed to Internet... /subscriptions/. ...
✖ CRITICAL AZ-001 Owner Role Assigned at Subscription... <principal-id> ...
■ HIGH AZ-010 Defender for Cloud Not Enabled — VMs /subscriptions/. ...
...
JSON — Written to reports/azure_audit_<subscription>_<timestamp>.json.
src/
azure_security_auditor/
cli.py # argparse entrypoint
engine.py # ThreadPoolExecutor orchestrator
models.py # Finding, AuditResult, Severity
checks/
rbac.py # AZ-001, AZ-002
network.py # AZ-003, AZ-015, AZ-016
storage.py # AZ-004, AZ-017, AZ-018
identity.py # AZ-005, AZ-019
service_principals.py # AZ-006
encryption.py # AZ-007, AZ-008, AZ-020
monitoring.py # AZ-009, AZ-010, AZ-011
compute.py # AZ-012, AZ-013, AZ-014
reporters/
terminal.py # Rich table output
json_reporter.py # JSON file output
Uses DefaultAzureCredential — tries in order:
AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID)az login)export AZURE_CLIENT_ID="<app-id>"
export AZURE_CLIENT_SECRET="<secret>"
export AZURE_TENANT_ID="<tenant-id>"
azure-auditor --subscription <subscription-id>