Introducing Shadowman - Service Principal Auditing Made Easy!

 Long time no see! The reason for this is because while I was away, I was working on a brand-new tool for administrators to audit their environment for shadow IT apps. This idea came after I wanted to be able to audit my own environment for shadow IT and didn't have a way to do it in a comprehensive manner. Thus, my PowerShell tool was born; I introduce to you, Shadowman!


What is Shadowman?

Shadowman in a nutshell is a tool designed to get you all the information that you need on the service principals in your Azure environment. Administrators have the option to conduct a basic audit that will capture all information and flags that are available through the application, as well as a targeted mode that will give administrators the ability to filter applications based on the following flags:

Service Principal Properties

Property Description
DisplayNameName of the service principal
AppIdApplication ID
ObjectIdObject ID in Azure AD
UserConsentsCountNumber of user consents
ConsentingUsersUsers who have granted consent
DelegatedPermissionsDelegated permissions granted
UnverifiedPublisherIndicates if the publisher is unverified
HasRiskyConsentsFlags if risky consents are present
CountryOfOriginCountry information (if available)
LastSignInUTCTimestamps of last sign-in events
FullAccessAsAppIndicates if app has full access permissions
HasFullAccessAsAppConfirms full access as app
IsOrphanedTrue if app has no owners
HighValueUserTrue if consent was granted by a high-value user
HasBroadMailboxAccessIndicates broad access to mailbox resources
IsRiskyAppFlags app as risky based on permissions or behavior
RiskReasonsReasons why the app is considered risky
RiskyPermissionsFoundSpecific risky permissions detected
IsDisabledAppIndicates if the app is disabled
OldestConsentDateOldest recorded consent date
IsExternalTenantAppTrue if app belongs to an external tenant
RequiresUserAssignmentIndicates if user assignment is required
UsageStatusCurrent usage status (empty by default)

Why Shadowman Matters

Shadow IT is one of the most overlooked risks in cloud environments. When users grant consent to third-party applications without oversight, it opens the door to potential data leaks, privilege escalation, and compliance violations. Shadowman helps you shine a light on these hidden risks by surfacing critical metadata and behavioral flags tied to service principals—giving you the visibility you need to take action.

Whether you're trying to identify orphaned apps, flag risky permissions, or simply understand how external apps are interacting with your tenant, Shadowman is built to give you answers fast and in a format that's easy to work with.

How It Works

Shadowman is written in PowerShell and leverages Microsoft Graph to pull detailed service principal data. You can run it in two modes:

  • Basic Audit Mode: Captures all service principals and their associated flags.

  • Targeted Mode: Allows filtering based on specific risk indicators like HasRiskyConsents, IsExternalTenantApp, or HasBroadMailboxAccess.

The output is structured, exportable, and designed to plug into your existing reporting workflows. You can even integrate it with scheduled tasks or SIEM pipelines for continuous monitoring.

What's Next?

This is just the beginning. I'm actively working on enhancements like:

  • Consent age analysis

  • Integration with Defender for Cloud Apps

  • Automated remediation 

  • Visual dashboards for executive reporting

If you're an admin, security analyst, or just someone who wants to take control of your Azure environment, I invite you to give Shadowman a try. Feedback is welcome—this tool is built by an admin, for admins.

You can access and clone the repository here: https://github.com/pryrotech/entra-app-auditor

Thanks for sticking around, and I’m excited to share more updates soon. Stay secure, stay curious—and let Shadowman help you uncover what’s lurking in the shadows.

Comments

Popular posts from this blog

Using Power Automate to Update Contact Information

Using Custom Connectors and Microsoft Graph API's to Manage Licenses in Power Automate - Part One

Using Custom Connectors and Microsoft Graph API's to Manage Licenses in Power Automate - Part Two