Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

scope-drift-detection-spn

БесплатноБез исполняемых скриптовНе проверен

Use this skill when asked to detect scope drift, behavioral expansion, or gradual privilege/access creep in service principals or automation accounts…

SCStelzот SCStelz★ 256 звёзд на GitHub

Об этом скилле

Service Principal Scope Drift Detection — Instructions

Purpose

Credit: The scope drift detection concept for service principals was inspired by Iftekhar Hussain's article The Agentic SOC Era: How Sentinel MCP Enables Autonomous Security Reasoning (Feb 2026), which demonstrated multi-source correlation across AADServicePrincipalSignInLogs, AuditLogs, and SecurityAlert to build 90-day behavioral baselines and surface drift via weighted scoring.

This skill detects scope drift — the gradual, often imperceptible expansion of access or behavior beyond an established baseline — in Entra ID service principals. Unlike sudden compromise (which triggers alerts), scope drift is a slow-burn pattern that evades threshold-based detections.

Entity Type: Service Principal

Identifier Primary Table(s) Use Case
ServicePrincipalName / ServicePrincipalId AADServicePrincipalSignInLogs App registrations, automation accounts, managed identities

What this skill detects:

  • Volume spikes in sign-in activity relative to historical baseline
  • New target resources (APIs, services) not previously accessed
  • New source IP addresses or geographic locations
  • Increased failure rates indicating probing or misconfiguration
  • Credential/permission changes correlated with behavioral shifts
  • Security alerts involving the drifting entities

Related skills:


📑 TABLE OF CONTENTS

  1. Critical Workflow Rules - Start here!
  2. Output Modes - Inline chat vs. Markdown file
  3. Quick Start - 7-step investigation pattern
  4. Drift Score Formula - Weighted composite scoring (5 dimensions)
  5. Execution Workflow - Complete 4-phase process
  6. Sample KQL Queries - Validated query patterns (Queries 1-4)
  7. Report Template - Output format specification
  8. Known Pitfalls - Edge cases and false positives
  9. Error Handling - Troubleshooting guide
  10. SVG Dashboard Generation - Visual dashboard from report

Investigation shortcuts:

  • SPN drift triage (TP Q5): Q1 (baseline vs recent — drift scores + dimension ratios) → Q4 (alert/incident correlation) → Tier 1 deep dives for flagged SPNs
  • Compromised SPN forensics (TP Q5 + incident context): Q1 (behavioral profile) → Q3 (detailed AuditLog changes — credential adds, consent grants, timestamps, actors) → Q4 (incident status/classification check)
  • Permission escalation investigation (TP Q10, standalone): Q2 (AuditLog summary — operation counts baseline vs recent) → Q3 (detailed per-operation rows with initiator/target/modified properties) → Graph API: app permission audit
  • IP infrastructure expansion (TP Q5, high IPDrift): Q1 (new IPs list from NewIPs array) → anti-join baseline IPs to identify novel sources → IP enrichment (enrich_ips.py or ioc-investigation) for non-Azure IPs

⛔ Shortcut Default Rule: When a matching shortcut exists for the investigation context, use it — don't run the full workflow. Only run the full query set when the user explicitly requests "full investigation", "comprehensive", or "deep dive". Shortcuts render only the report sections relevant to their query chain (plus Executive Summary and Recommendations, always).


⚠️ CRITICAL WORKFLOW RULES - READ FIRST ⚠️

Before starting ANY SPN scope drift analysis:

  1. ALWAYS enforce Sentinel workspace selection (see Workspace Selection section below)
  2. ALWAYS ask the user for output mode if not specified: inline chat summary or markdown file report (or both)
  3. ALWAYS build baseline FIRST before comparing recent activity
  4. ALWAYS apply the low-volume denominator floor to prevent false-positive drift scores on sparse baselines
  5. ALWAYS correlate across all required data sources (AADServicePrincipalSignInLogs, AuditLogs, SecurityAlert)
  6. ALWAYS run independent queries in parallel for performance
  7. NEVER report a drift flag without corroborating evidence from at least one secondary data source

Data Sources

Data Source Role Purpose
AADServicePrincipalSignInLogs ✅ Primary SPN sign-in behavioral baseline
AuditLogs ✅ Corroboration Permission/credential/role changes
SecurityAlert ✅ Corroboration Corroborating alert evidence
SecurityIncident ✅
Полный SKILL.md на GitHub

Установить scope-drift-detection-spn в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

svg-widgets.yaml

FAQ

Что делает скилл scope-drift-detection-spn?

Use this skill when asked to detect scope drift, behavioral expansion, or gradual privilege/access creep in service principals or automation accounts. Triggers on keywords like "scope drift", "service principal drift", "SPN behavioral change", "automation account drift", "baseline deviation", "access expansion", or when investigating whether a service principal has gradually expanded beyond its intended purpose. This skill builds a 90-day behavioral baseline per SPN, compares it with 7-day recent activity, computes a weighted Drift Score across 5 dimensions, and correlates with SecurityAlert and AuditLogs for corroborating evidence.

Как установить скилл scope-drift-detection-spn?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл scope-drift-detection-spn запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить scope-drift-detection-spn с