List hostPorts

Namespace: microsoft.graph.security

Note

The Microsoft Graph API for Microsoft Defender Threat Intelligence requires an active Defender Threat Intelligence Portal license and API add-on license for the tenant.

Get the list of hostPort resources associated with a host.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) ThreatIntelligence.Read.All Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application ThreatIntelligence.Read.All Not available.

HTTP request

GET /security/threatIntelligence/hosts/{hostId}/ports

Optional query parameters

This method supports the $count, $skip, $top, $select, and $expand OData query parameters to help customize the response. For general information, see OData query parameters.

The following properties can be used for $select calls.

Property Example Notes
All hostPort properties $select=id,firstSeenDateTime Use the name as it appears in the hostPort resource.
mostRecentSslCertificate $select=mostRecentSslCertificate You can't use $select on nested properties (for example, mostRecentSslCertificate/id).
host $select=host You can't use $select on nested properties (for example, host/id).

The following properties can be used for $expand calls.

Property Example
mostRecentSslCertificate $expand=mostRecentSslCertificate

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and a collection of hostPort objects in the response body.

Examples

Request

The following example shows a request.

GET https://graph.microsoft.com/v1.0/security/threatIntelligence/hosts/8.8.8.8/ports

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-Type: application/json

{
  "value": [
    {
      "id": "tKhoxnUMGirrHqYiMpsdaQRDZKBnXrao",
      "port": 443,
      "firstSeenDateTime": "2016-12-06T20:23:38.00Z",
      "lastSeenDateTime": "2023-07-18T23:24:01.00Z",
      "lastScanDateTime": "2023-07-18T23:24:29.00Z",
      "timesObserved": 15590,
      "status": "open",
      "protocol": "tcp",
      "banners": [
        {
          "banner": "HTTP/1.1 302 Found\r\nX-Content-Type-Options:...",
          "firstSeenDateTime": "2023-06-21T00:49:23.00Z",
          "lastSeenDateTime": "2023-07-18T15:31:57.00Z",
          "scanProtocol": "http_raw",
          "timesObserved": 2
        },
        {
          "banner": "HTTP/1.1 302 Found\r\nX-Content-Type-Options:...",
          "firstSeenDateTime": "2021-03-12T15:38:42.00Z",
          "lastSeenDateTime": "2023-07-18T15:22:16.00Z",
          "scanProtocol": "http_raw",
          "timesObserved": 2975
        }
      ],
      "services": [
        {
          "firstSeenDateTime": "2020-10-28T22:39:51.00Z",
          "lastSeenDateTime": "2023-07-18T22:13:54.00Z",
          "isRecent": true,
          "component": {
            "id": "EVfwHhqkUQESmqrKSFHobDUHDAKBsWLf",
            "name": "scaffolding on HTTPServer2",
            "version": "",
            "category": "Server"
          }
        },
        {
          "firstSeenDateTime": "2022-06-26T04:29:25.00Z",
          "lastSeenDateTime": "2023-07-18T00:54:13.00Z",
          "isRecent": false,
          "component": {
            "id": "ZobhjJgOwebxpsXdCUjfTpshygqgcfJj",
            "name": "nginx",
            "version": "1.18.0",
            "category": "Server"
          }
        }
      ],
      "mostRecentSslCertificate": {
        "id": "ZmI5NjU1MTUwNWYxZWRiMjRkZDNiMzZmY2ZmZGI3NjU4MzNiODExOA=="
      },
      "host": {
        "id": "85.13.139.18"
      }
    }
  ]
}