scope-drift-detection-spn

Detect scope drift in Entra ID service principals using 90-day behavioral baselines.

2|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/msandbu/sentinelday --skill scope-drift-detection-spn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scope-drift-detection-spn
Source: https://github.com/msandbu/sentinelday/tree/main/.github/skills/scope-drift-detection/spn
Command: npx skills add https://github.com/msandbu/sentinelday --skill scope-drift-detection-spn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill detects subtle, gradual expansions of access or behavior in Entra ID service principals that can evade traditional alerts, helping to identify potential misuse or credential compromise before it escalates.

Core Features & Use Cases

  • Behavioral Baseline: Establishes a 90-day baseline of SPN activity (sign-ins, resources accessed, locations, etc.).
  • Drift Scoring: Compares recent activity to the baseline across multiple dimensions, calculating a weighted Drift Score.
  • Corroboration: Correlates drift signals with Audit Logs (permission changes) and Security Alerts for comprehensive investigation.
  • Use Case: An automation account used for backups suddenly starts accessing financial reporting APIs. This skill would flag the SPN due to a significant increase in accessed resources and potentially new IP addresses, prompting an investigation.

Quick Start

Use the scope-drift-detection-spn skill to investigate potential scope drift for the service principal named 'backup-automation-spn'.

Frequently Asked Questions about scope-drift-detection-spn

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect service principal scope creep in Entra ID?

To detect service principal scope creep in Entra ID, you can build a 90-day behavioral baseline of SPN activity and compare it against recent actions to calculate a weighted drift score. This identifies gradual privilege or access expansions.

What Entra ID logs are required to investigate SPN behavioral drift?

Investigating SPN behavioral drift requires AADServicePrincipalSignInLogs, AuditLogs, and SecurityAlerts data sources. These logs provide the necessary sign-in patterns, permission change records, and threat alerts to corroborate scope drift.

How does behavioral baseline drift scoring work for service principals?

Behavioral baseline drift scoring compares recent SPN activity against a 90-day baseline across multiple dimensions, such as resources accessed and locations. It calculates a weighted score to flag significant deviations indicating potential access creep.

Can I use scope drift detection to investigate a compromised service principal credential?

Yes, you can use scope drift detection to investigate a compromised service principal credential. It correlates sudden changes in accessed resources or IP addresses with AuditLogs and SecurityAlerts to identify potential misuse before it escalates.

What is the best way to identify access expansion in Entra ID automation accounts?

The best way to identify access expansion in Entra ID automation accounts is to monitor deviations from their established behavioral baseline. Correlating unexpected resource access with AuditLogs confirms if scope drift indicates potential compromise.

Do I need SecurityAlerts to monitor service principal access creep?

You need SecurityAlerts data to comprehensively monitor service principal access creep. While drift scoring detects behavioral deviations, correlating these signals with SecurityAlerts and AuditLogs provides full context for security investigations.