我试图使用Microsoft图形API威胁指示器API,基于Azure sentinel推荐的方法,将IOC的威胁情报来源集成到哨兵实例中。我在linux中执行以下步骤来测试该功能:
使用以下方法从微软获取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哨兵中插入威胁指示符。
发布于 2019-12-20 03:59:17
在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或 (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/tokenhttps://stackoverflow.com/questions/59419193
复制相似问题