I built a tool that reviews sample cloud accounts for access risks and produces a report with suggested actions.
I built four PowerShell commands to connect, collect account information, check selected risks, and export a report. The demo uses 28 sample records. The tool can also connect to a real Microsoft Entra tenant when configured. NHI means non-human identity: an account used by software.
I explored how to turn account-risk checks into a report people can review.
The sample report starts with counts, then lists accounts by risk. Each finding has a suggested action. The HTML report can be shared as one file.
I chose specific risk checks. Each finding has a severity, a short explanation, and a suggested action.
| Code | Factor | Severity |
|---|---|---|
| NHI001 | No owner assigned | High |
| NHI002 | Created >14 days ago, never signed in | High |
| NHI003 | No sign-in for >90 days (180+ → High; 90–180 → Medium) | High / Med |
| NHI004 | Credential expired but identity still enabled | Critical |
| NHI005 | Credential expires within 30 days | Medium |
| NHI006 | Oldest credential >365 days (rotation policy breach) | Medium |
| NHI007 | Account disabled but credentials still present | Medium |
| NHI008 | Tagged 'legacy' and still enabled | High |
Adding a factor is a function in Test-NhiRisk.ps1. The scoring is linear (per-factor weights add to 0–100) so individual contributions stay readable in a report — no opaque ML model.
PowerShell 7+ on macOS, Linux, or Windows. No Microsoft Graph SDK needed for the mock demo — only for live-tenant mode.
The cmdlets pipe naturally. Get-EntraNhiInventory | Test-NhiRisk | Where-Object RiskLevel -eq 'Critical' gives you just the critical findings; | Export-NhiAuditReport writes the report.
The HTML report is for humans. The JSON output is for everything else.
RiskLevel: Critical — auto-page the on-call IAM engineer with the remediation already attached.Remediation field becomes the ticket description; the owner team gets assigned automatically.