Skip to content

Latest commit

 

History

History
197 lines (154 loc) · 7.07 KB

security-host-list-ports.md

File metadata and controls

197 lines (154 loc) · 7.07 KB
title description author ms.localizationpriority ms.subservice doc_type
List hostPorts
Get the list of hostPort resources associated with a host.
angelo-moulic
medium
security
apiPageType

List hostPorts

Namespace: microsoft.graph.security

[!INCLUDE beta-disclaimer]

[!INCLUDE threatintelligence-api-disclaimer]

Get the list of hostPort resources associated with a host.

[!INCLUDE national-cloud-support]

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.

[!INCLUDE permissions-table]

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/beta/security/threatIntelligence/hosts/8.8.8.8/ports

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


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"
      }
    }
  ]
}