Microsoft Graph 安全 API - https://graph.microsoft.com/beta/security/tiIndicators 的问题

Dee*_*eep 2 azure azure-security azure-sentinel microsoft-graph-api

我正在尝试使用基于 Azure 哨兵推荐的将 IOC 摄取的威胁情报源集成到哨兵实例的 Microsoft 图形 API 威胁指标 API。我在 linux curl 中执行以下步骤来测试功能:

使用以下命令从 Microsoft 获取 OAuth 令牌:

curl -X POST -d 'grant_type=client_credentials&client_id=[myClientId]&client_secret=[myAppSecret]&scope=openid profile ThreatIndicators.ReadWrite.OwnedBy' https://login.microsoftonline.com/[myTenantId]/oauth2/token
Run Code Online (Sandbox Code Playgroud)

使用收到的不记名令牌调用以下 API: curl -X GET -H "Authorization: Bearer [access token]" https://graph.microsoft.com/beta/security/tiIndicators

我收到以下提到的错误:

{
  "error": {
    "code": "InvalidAuthenticationToken",
    "message": "Access token validation failure. Invalid audience.",
    "innerError": {
      "request-id": "########################",
      "date": "2019-12-19T07:41:51"
    }
  }
Run Code Online (Sandbox Code Playgroud)

有人知道如何使用它吗?主要动机是使用图形 API POST 查询在 Azure Sentinel 中插入威胁指标

All*_* Wu 5

在 V1.0 令牌端点的请求正文中使用resource而不是scope

curl -X POST -d 'grant_type=client_credentials&client_id=[myClientId]&client_secret=[myAppSecret]&resource=https://graph.microsoft.com' https://login.microsoftonline.com/[myTenantId]/oauth2/token
Run Code Online (Sandbox Code Playgroud)

(V2.0 令牌端点如下)

curl -X POST -d 'grant_type=client_credentials&client_id=[myClientId]&client_secret=[myAppSecret]&scope=https://graph.microsoft.com/.default' https://login.microsoftonline.com/[myTenantId]/oauth2/v2.0/token
Run Code Online (Sandbox Code Playgroud)