DET-123 · human · confidence High

Risky OAuth Consent Grants

Flag new consents that give an app broad, long-lived access to mail, files or chat.

Every OAuth consent is written to the identity provider's audit log with the app ID, the scopes and who approved it. Insiders who wire a personal app or shadow agent into company data almost always leave this record. Scoring each grant on scope breadth, publisher status and the app's home tenant turns a noisy log into a short daily review list. It also catches tenant-wide admin consents, which carry the most risk because they apply to every user.

Data sources
Microsoft Entra ID audit logsGoogle Workspace OAuth Token audit logOkta System LogSlack Audit Logs
Platforms
Microsoft 365AzureGoogle WorkspaceIdentitySaaS

Logic

AuditLogs
| where OperationName in ("Consent to application", "Add delegated permission grant", "Add app role assignment to service principal")
| extend Scopes = tostring(TargetResources[0].modifiedProperties)
| where Scopes has_any ("Mail.Read", "Mail.ReadWrite", "Files.Read.All", "Sites.Read.All", "offline_access", "full_access_as_app")
| extend IsAdminConsent = tostring(AdditionalDetails) has "ConsentType: AllPrincipals"
| project TimeGenerated, InitiatedBy, TargetResources, Scopes, IsAdminConsent
// Google: oauth token log, event_name == "authorize" and scope contains "drive" or "gmail"; Okta: eventType eq "app.oauth2.as.consent.grant"

False positives

Staff onboarding approved productivity tools, and IT consenting new vendor apps during rollouts.

Catches 3 techniques