The interface is localized. Skill descriptions and documents are machine-translated by AI into your language; code, commands, paths and technical terms stay in the original, and the author's document governs.
Explore skills
Productivity · SKILL.md

analyzing-office365-audit-logs-for-compromise

analyzing-office365-audit-logs-for-compromise

通过 Microsoft Graph API 解析 Office 365 统一审计日志,检测邮件转发规则创建、收件箱委托、可疑 OAuth 应用授权以及其他账户失陷指标。

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill documentation

GitHub

name: analyzing-office365-audit-logs-for-compromise description: 通过 Microsoft Graph API 解析 Office 365 统一审计日志,检测邮件转发规则创建、收件箱委托、可疑 OAuth 应用授权以及其他账户失陷指标。 domain: cybersecurity subdomain: cloud-security tags: [Office365, Microsoft-Graph, audit-logs, email-compromise, inbox-rules, OAuth, BEC] version: "1.0" author: mahipal license: Apache-2.0

分析 Office 365 审计日志以检测账户失陷

概述

商业邮件欺诈(Business Email Compromise,BEC)攻击通常会在 Office 365 审计日志中留下痕迹:可疑的收件箱规则创建、将邮件转发到外部地址、邮箱委托更改以及未经授权的 OAuth 应用授权。本 skill 使用 Microsoft Graph API 查询统一审计日志,枚举各邮箱的收件箱规则,检测转发配置,并识别账户失陷指标。

前置条件

  • Azure AD 应用注册,具备 AuditLog.Read.All、MailboxSettings.Read、Mail.Read(应用权限)
  • Python 3.9+ 及 msal、requests 库
  • 用于认证的客户端密钥或证书
  • 全局读取者(Global Reader)或安全读取者(Security Reader)角色

步骤

  1. 使用 MSAL 客户端凭据流向 Microsoft Graph 进行身份认证
  2. 查询统一审计日志中的可疑操作(Set-Mailbox、New-InboxRule)
  3. 枚举各邮箱的收件箱规则并标记转发规则
  4. 检测邮箱委托更改(Add-MailboxPermission)
  5. 识别向可疑应用程序的 OAuth 授权
  6. 检查审计日志中的可疑登录模式
  7. 生成包含时间线的失陷指标报告

预期输出

  • JSON 报告,列出转发规则、委托更改、OAuth 授权以及带有风险评分的可疑审计事件
  • 失陷指标及受影响邮箱的时间线
Saved skills