【问题标题】:Microsoft Graph Security API - Issue with https://graph.microsoft.com/beta/security/tiIndicatorsMicrosoft Graph 安全 API - https://graph.microsoft.com/beta/security/tiIndicators 的问题
【发布时间】:2019-12-20 02:29:04
【问题描述】:

我正在尝试使用基于 Azure 哨兵推荐的 Microsoft 图形 API 威胁指标 API 将 IOC 摄取的威胁情报源集成到哨兵实例的方式。我在 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 中插入威胁指标

【问题讨论】:

  • 如果我的回答对您有帮助,您可以接受它作为答案(单击答案旁边的复选标记,将其从灰色切换为已填充。)。这对其他社区成员可能是有益的。谢谢。

标签: azure microsoft-graph-api azure-security azure-sentinel


【解决方案1】:

在 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

【讨论】:

  • @DEEPANSHUMARWAH 没问题:)
猜你喜欢
  • 2023-01-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-02-06
  • 2022-12-07
  • 2023-03-10
相关资源
最近更新 更多