detecting-suspicious-oauth-application-consent

Enumerate OAuth2 permission grants in Azure AD via Microsoft Graph API and flag suspicious consent activity.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/YukiIto1999/ctf-sleuth --skill detecting-suspicious-oauth-application-consent
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: detecting-suspicious-oauth-application-consent
Source: https://github.com/YukiIto1999/ctf-sleuth/tree/main/.claude/skills/detecting-suspicious-oauth-application-consent
Command: npx skills add https://github.com/YukiIto1999/ctf-sleuth --skill detecting-suspicious-oauth-application-consent

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires msal, requests, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Illicit OAuth consent grants in Azure AD / Entra ID can grant attackers broad access. This skill enumerates OAuth2 permission grants, analyzes scopes for high-risk access, and correlates with service principals and audit logs to identify potentially malicious consent events.

Core Features & Use Cases

  • Enumerate OAuth2 permission grants via Microsoft Graph API
  • Analyze granted scopes against risk profiles and publisher verification
  • Correlate with service principals and directory audit logs to surface suspicious consent patterns

Quick Start

Authenticate to Azure AD Graph API using a tenant, client id, and client secret, then run the full audit to generate risk findings and remediation recommendations.

Frequently Asked Questions about detecting-suspicious-oauth-application-consent

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

FAQPage Schema
How do I detect illicit OAuth consent grants in Azure AD?

To detect illicit OAuth consent grants in Azure AD, enumerate OAuth2 permission grants via Microsoft Graph API and analyze high-risk scopes alongside publisher verification status. This process flags suspicious consent events and generates a structured JSON report with remediation recommendations for revocation.

What is an illicit OAuth consent grant and how does it compromise Entra ID?

An illicit OAuth consent grant in Entra ID occurs when an attacker tricks a user into authorizing a malicious application with broad access scopes. This grants the attacker persistent access to directory data without requiring a password breach, making it a high-risk security threat.

How do I enumerate OAuth2 permission grants using Microsoft Graph API?

You enumerate OAuth2 permission grants using Microsoft Graph API by authenticating with a tenant, client ID, and client secret. Once authenticated, the skill queries the Graph API to list active grants and correlates them with service principals and directory audit logs.

Do I need publisher verification status to analyze suspicious Azure AD consent grants?

Yes, publisher verification status is analyzed to assess suspicious Azure AD consent grants. Unverified publishers combined with high-risk access scopes are strong indicators of potentially malicious consent events that require immediate investigation and potential revocation.

Can I audit Azure AD service principals and directory audit logs for suspicious OAuth activity?

Yes, you can audit Azure AD service principals and directory audit logs for suspicious OAuth activity. The skill correlates OAuth2 permission grants with service principal configurations and audit log events to surface suspicious consent patterns and generate risk findings.

What is the best way to revoke suspicious OAuth2 permission grants in Entra ID?

The best way to revoke suspicious OAuth2 permission grants in Entra ID is to follow the structured JSON report generated by the analysis. This report provides prioritized remediation recommendations for revocation and investigation based on the identified high-risk scopes and suspicious consent patterns.