命名空间:microsoft.graph.networkaccess
重要
Microsoft Graph /beta
版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
获取通过全局安全访问服务路由的流量的日志事件列表。
此 API 可用于以下国家级云部署。
全局服务 | 美国政府 L4 | 美国政府 L5 (DOD) | 由世纪互联运营的中国 |
---|---|---|---|
✅ | ✅ | ✅ | ❌ |
权限
为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考。
权限类型 | 最低特权权限 | 更高特权权限 |
---|---|---|
委派(工作或学校帐户) | NetworkAccess-Reports.Read.All | NetworkAccess.ReadWrite.All |
委派(个人 Microsoft 帐户) | 不支持。 | 不支持。 |
应用程序 | NetworkAccess-Reports.Read.All | NetworkAccess.ReadWrite.All |
重要
在具有工作或学校帐户的委托方案中,必须为登录用户分配受支持的Microsoft Entra角色或具有支持的角色权限的自定义角色。 此作支持以下最低特权角色。
- 全局读取者
- 全局安全访问日志读取器
- 全局安全访问管理员
- 安全管理员
HTTP 请求
GET /networkAccess/logs/traffic
可选的查询参数
此方法支持 $select
、、$expand
、 $filter
$sort
和 $top
OData 查询参数 OData 查询参数,以帮助自定义响应。
名称 | 语法 | 注释 |
---|---|---|
服务器端分页 | @odata.nextLink=https://graph.microsoft.com/beta/networkAccess/logs/traffic?$skiptoken=“generatedtoken” | 页面大小默认为 ,限制为 1000。 |
筛选器 | /logs/traffic?$filter=connectionId eq 'a812bcdc-aa36-4c51-b70d-20a84f0ce556' | 所有属性都是可筛选的。 |
Sort | /logs/traffic?$orderby=createdDateTime desc | 可以按所有属性排序。 |
顶部 | /logs/traffic?$top=50 | 最大值为 1000。 |
Select | /logs/traffic?$select=transactionId,connectionId,createdDateTime | 选择特定属性。 |
请求标头
名称 | 说明 |
---|---|
Authorization | 持有者 {token}。 必填。 详细了解 身份验证和授权。 |
请求正文
请勿提供此方法的请求正文。
响应
如果成功,此方法在 200 OK
响应正文中返回响应代码和 networkAccessTraffic 对象的集合。
示例
请求
以下示例显示了一个请求。
GET https://graph.microsoft.com/beta/networkAccess/logs/traffic
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/networkAccess/logs/$metadata#traffic",
"@odata.nextLink": "https://graph.microsoft.com/beta/networkAccess/logs/traffictraffic?$filter=contains(headers/xForwardedFor, 'incent')&$top=2&$skiptoken=164190b1473351bb7d1dbebf20c81cfc3844e5d55b80e32b8d73b99cf523f5a0",
"value": [
{
"tenantId": "cb9af522-39fe-4056-b879-e3200ff37b3d",
"createdDateTime": "2023-03-06T07:58:46.8346145Z",
"transactionId": "20221208T213303Z-gnwuk8cd9h2wvbnm4cq7banegs0000000080000000001m9x",
"connectionId": "6+Cy7aaBT+aGV+Ds.1",
"sessionId": "",
"trafficType": "microsoft365",
"deviceCategory": "client",
"destinationIp": "100.64.0.239",
"destinationPort": 443,
"destinationFQDN": "oneozco.sharepoint.com",
"sourceIp": "20.51.192.19",
"sourcePort": 63391,
"deviceOperatingSystem": "Windows 10 Pro",
"deviceOperatingSystemVersion": "10.0.19044",
"agentVersion": "1.5.233",
"deviceId": "46bba529-d081-4cec-883b-4023b9bde1e0",
"userId": "ef147e40-db4c-40e4-9e63-f254f576421f",
"userPrincipalName": "user1@microsoft.com",
"transportProtocol": "TCP",
"networkProtocol": "IPv4",
"action": "allowed",
"policyRule": {
"@odata.type": "microsoft.graph.networkaccess.policyRule",
"id": "11111-c507-4b11-8e9b-236e79b04279"
},
"policy": {
"@odata.type": "microsoft.graph.networkaccess.policy",
"id": "fbea3325-6cc8-46e9-8c61-0451d96a1c02"
},
"sentBytes": 1500,
"receivedBytes": 1000,
"headers": {
"referrer": "process",
"origin": "https://developer.mozilla.org",
"xForwardedFor": "incentivize"
},
"destinationUrl": "https://destinationfqdn/file.zip",
"filteringProfileId": "ff612f2c-04b7-4234-8a8f-079ec1b7b4bc",
"filteringProfileName": "Block Social and malicious files",
"policyName": "Block malicious files Syros",
"initiatingProcessName": "msedge.exe",
"vendorNames": ["Microsoft"],
"httpMethod": "get",
"responseCode": 403,
"popProcessingRegion": "EastUS2",
"operationStatus": "success",
"destinationWebCategory": {
"displayName": "General,IllegalSoftware",
"group": null
},
"applicationSnapshot": {
"appId": ""
}
},
{
"tenantId": "cb9af522-39fe-4056-b879-e3200ff37b3d",
"createdDateTime": "2023-03-07T07:58:46.8346145Z",
"transactionId": "vvvvvrrrrr-gnwuk8cd9h2wvbnm4cq7banegs0000000080000000001m9x",
"connectionId": "6+Cy7aaBT+aGV+Ds.1",
"sessionId": "",
"trafficType": "internet",
"deviceCategory": "client",
"destinationIp": "100.64.0.239",
"destinationPort": 443,
"destinationFQDN": "oneozco.sharepoint.com",
"sourceIp": "20.51.192.19",
"sourcePort": 63391,
"deviceOperatingSystem": "Windows 10 Pro",
"deviceOperatingSystemVersion": "10.0.19044",
"agentVersion": "1.5.233",
"deviceId": "46bba529-d081-4cec-883b-4023b9bde1e0",
"userId": "ef147e40-db4c-40e4-9e63-f254f576421f",
"userPrincipalName": "user1@microsoft.com",
"transportProtocol": "TCP",
"networkProtocol": "IPv4",
"action": "allowed",
"policyRule": {
"@odata.type": "microsoft.graph.networkaccess.policyRule",
"id": "11111-c507-4b11-8e9b-236e79b04279"
},
"policy": {
"@odata.type": "microsoft.graph.networkaccess.policy",
"id": "fbea3325-6cc8-46e9-8c61-0451d96a1c02"
},
"sentBytes": 1500,
"receivedBytes": 1000,
"headers": {
"referrer": "process",
"origin": "https://developer.mozilla.org",
"xForwardedFor": "incentivize"
}
}
]
}