investigating-m365-entra

investigating-m365-entra is a skill for Claude Code from trilwu/secskills. It costs 88 tokens per session (3,935 once invoked), scanned A, original, MIT.

A guide to investigating Microsoft 365 and Entra ID, Microsoft’s cloud services for email, collaboration, and identity management. It uses sign-in records, audit data, mailbox changes, OAuth permissions, and identity-containment steps.

In plain words
What is it for?
Investigating business email compromise, suspicious sign-ins, stolen or misused accounts, excessive OAuth permissions, hidden mailbox forwarding rules, and changes to MFA or access policies.
Why use it?
Cloud investigations depend on API-held logs whose availability and retention vary by licensing and settings. Knowing what evidence exists helps distinguish a clean result from a missing-data gap.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the secskills-defense plugin — 22 skills shipped together

Good fit Investigating business email compromise, suspicious sign-ins, stolen or misused accounts, excessive OAuth permissions, hidden mailbox forwarding rules, and changes to MFA or access policies.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/trilwu/secskills/investigating-m365-entra
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add trilwu/secskills --skill investigating-m365-entra
Clone the repo
git clone --depth 1 https://github.com/trilwu/secskills

Made for: Claude Code.

Or install secskills-defense, the plugin that ships this one along with the rest of its 22 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for investigating-m365-entra

README.md
[![agentmods](https://agentmods.dev/badge/skills/trilwu/secskills/investigating-m365-entra/github.svg)](https://agentmods.dev/skills/trilwu/secskills/investigating-m365-entra)
Your own site
<a href="https://agentmods.dev/skills/trilwu/secskills/investigating-m365-entra"><img src="https://agentmods.dev/badge/skills/trilwu/secskills/investigating-m365-entra/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for investigating-m365-entra

Your own site · 80×15
<a href="https://agentmods.dev/skills/trilwu/secskills/investigating-m365-entra"><img src="https://agentmods.dev/badge/skills/trilwu/secskills/investigating-m365-entra.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,935 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00088 $0.03935
Opus 5 $0.00044 $0.01968
Sonnet 5 $0.00018 $0.00787
Haiku 4.5 $0.00009 $0.00394

Measured 12d ago against content hash 455b7e457ab8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

investigating-m365-entra scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

secskills-defense/skills/investigating-m365-entra/SKILL.md · 355 lines

How it starts

The opening of the file, as written. The whole thing — 355 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Investigating M365 and Entra ID

M365/Entra investigations differ from on-premises DFIR -- there are no disk images, no memory dumps, and no event logs you can collect yourself. Everything comes from API queries against Microsoft's log stores, several of which require E5 licensing or advanced audit to retain what you need. Knowing which logs exist, which ones are missing, and how long they last is half the investigation.

When to Use

  • Business email compromise (BEC) -- unauthorized mailbox access, forwarding, or impersonation
  • Entra ID account compromise -- suspicious sign-ins, token replay, credential stuffing
  • Suspicious OAuth consent grants -- third-party apps with excessive permissions
  • Mailbox rule manipulation -- inbox rules hiding attacker communications or forwarding mail
  • Azure AD sign-in anomalies -- impossible travel, legacy auth, anonymizer networks
  • Conditional Access or MFA tampering -- policy changes, MFA fatigue attacks

When NOT to Use

  • Broader incident response methodology -- use responding-to-incidents
  • Offensive testing of Entra ID -- use attacking-entra-id
  • An Azure resource/subscription compromise -- use investigating-azure-incidents
  • An AWS compromise -- use investigating-aws-incidents
  • Other cloud infrastructure (GCP, offensive testing) -- use exploiting-cloud-platforms
  • Building detection rules from findings -- use engineering-detections

Log Landscape and Retention

Before you query anything, establish what you have and how far back it goes. Missing logs are a finding, not a reason to skip the question.

Log source Retention (default) License gate Key operations
Unified Audit Log (UAL) 180d default; 1 year for E5-licensed users MailItemsAccessed requires E5 MailItemsAccessed, New-InboxRule, Set-Mailbox, consent grants
Entra ID sign-in logs 30d Export to Log Analytics for longer Sign-in events, CA evaluation, MFA results
Entra ID audit logs 30d None Role assignments, app registrations, credential changes
Identity Protection 30d Requires P2 Risky sign-ins, risk detections
Defender for Cloud Apps 180d Requires MDCA license Activity log, OAuth app inventory
Mailbox audit log 90d (on by default) MailItemsAccessed requires E5 Mail access, send-as, delegate ops

Read the full file on GitHub · 355 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 355 lines · 88 tokens per session scan A 455b7e457ab8

Subscribe to this mod's changes

investigating-m365-entra is a skill published in the GitHub repository trilwu/secskills (138 stars, last pushed 8d ago), licensed MIT. It adds 88 tokens to every session and 3,935 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

agent-platform-tuning

Agent Platform Model Tuning. Use when you need to fine-tune open models or Gemini models using Agent Platform infrastructure. Don't use for model training outside Agent Platform, model deployment to endpoints (use agent-platform-deploy), or managing serving endpoints (use agent-platform-endpoint-management).

google/skills · 64 tokens

gke-compute-classes

Configures, optimizes, and troubleshoots GKE ComputeClasses. Use when configuring Spot VMs with on-demand fallback, targeting specific accelerators (GPUs/TPUs) or machine families, restricting ComputeClass access, or debugging pending pods related to node pool auto-creation. Do not use for cluster-level Node Auto…

google/skills · 83 tokens

gke-alert-configuration

Configures alerting policies in Terraform for Google Kubernetes Engine (GKE) clusters, workloads, and services using PromQL and Google Cloud Managed Service for Prometheus. Use when writing, analyzing, validating, or deploying Terraform alerting policies to monitor GKE service latency, traffic, error rates using…

google/skills · 120 tokens

google-cloud-solution-n-tier-serverless-web-app

Assists in designing and implementing secure n-tier serverless web applications and microservices on Google Cloud. Use when users need architecture designs, security checklists, Terraform code, or deployment guidance for multi-tier serverless apps, regional data residency / European sovereignty compliance, zero-trust…

google/skills · 91 tokens

application-design-center-design-deploy

Processes GCP infrastructure design and deployment workflows within Application Design Center (ADC). Use when: - Designing GCP infrastructure with Terraform. - Validating local HCL. - Performing best-practice plan scans. - Importing templates to Application Design Center (ADC). - Deploying templates. - Troubleshooting…

google/skills · 94 tokens

cloud-run-basics

Manages Cloud Run services, jobs, and worker pools. Use when you need to deploy applications responding to HTTP requests (services), run event-triggered or scheduled tasks (jobs), or handle always-on pull-based background processing (worker pools).

google/skills · 53 tokens