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

Microsoft Graph Security API - Issue with https://graph.microsoft.com/beta/security/tiIndicators

我正在尝试根据 Azure sentinel 推荐的方法使用 Microsoft graph API threat Indicators API 将 IOC 摄取的威胁情报源集成到 Sentinel 实例。我在 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

使用收到的不记名令牌调用以下 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"
    }
  }

有人知道如何使用这个吗?主要动机是使用图 API POST 查询在 Azure Sentinel

中插入威胁指标

在 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

OR(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