This article lists the device inventory management APIs supported for Defender for IoT OT sensors.
Use this API to request a list of all device connections.
URI: /api/v1/devices/connections
GET
Query parameters
Define any of the following query parameters to filter the results returned. If you don't set query parameters, all device connections are returned.
Name |
Description |
Example |
Required / Optional |
discoveredBefore |
Numeric. Filter results that were detected before a given time, where the given time is defined in milliseconds from Epoch time, and in UTC timezone. |
/api/v1/devices/2/connections?discoveredBefore=<epoch> |
Optional |
discoveredAfter |
Numeric. Filter results that were detected after a given time, where the given time is defined in milliseconds from Epoch time, and in UTC timezone. |
/api/v1/devices/2/connections?discoveredAfter=<epoch> |
Optional |
lastActiveInMinutes |
Numeric. Filter results by a given time frame during which connections were active. Defined backwards, in minutes, from the current time. |
/api/v1/devices/2/connections?lastActiveInMinutes=20 |
Optional |
Response type: JSON
Array of JSON objects that represent device connections, or the following failure message:
Message |
Description |
Failure – error |
Operation failed |
Success response fields
Name |
Type |
Nullable / Not nullable |
List of values |
firstDeviceId |
Numeric |
Not nullable |
- |
secondDeviceId |
Numeric |
Not nullable |
- |
lastSeen |
Numeric |
Not nullable |
Epoch (UTC) |
discovered |
Numeric |
Not nullable |
Epoch (UTC) |
ports |
Number array |
Nullable |
- |
protocols |
JSON array |
Nullable |
Protocol field |
Protocol fields
Name |
Type |
Nullable / Not nullable |
name |
String |
Not nullable |
commands |
String array |
Nullable |
Response example
[
{
"firstDeviceId": 171,
"secondDeviceId": 22,
"lastSeen": 1511281457933,
"discovered": 1511872830000,
"ports": [
502
],
"protocols": [
{
name: "modbus",
commands: [
"Read Coils"
]
},
{
name: "ams",
commands: [
"AMS Write"
]
},
{
name: "http",
commands: [
]
}
]
},
{
"firstDeviceId": 171,
"secondDeviceId": 23,
"lastSeen": 1511281457933,
"discovered": 1511872830000,
"ports": [
502
],
"protocols": [
{
name: "s7comm",
commands: [
"Download block",
"Upload"
]
}
]
}
]
Type: GET
APIs:
curl -k -H "Authorization: <AUTH_TOKEN>" https://<IP_ADDRESS>/api/v1/devices/connections
Examples:
curl -k -H "Authorization: 1234b734a9244d54ab8d40aedddcabcd" https://127.0.0.1/api/v1/devices/connections
Use this API to request a list of all the connections per device.
URI: /api/v1/devices/<deviceID>/connections
GET
Path parameter
Name |
Description |
Example |
Required / Optional |
deviceId |
Get connections for the given device. |
/api/v1/devices/<deviceId>/connections |
Required |
Query parameters
Name |
Description |
Example |
Required / Optional |
discoveredBefore |
Numeric. Filter results that were detected before a given time, where the given time is defined in milliseconds from Epoch time, and in UTC timezone. |
/api/v1/devices/2/connections?discoveredBefore=<epoch> |
Optional |
discoveredAfter |
Numeric. Filter results that were detected after a given time, where the given time is defined in milliseconds from Epoch time, and in UTC timezone. |
/api/v1/devices/2/connections?discoveredAfter=<epoch> |
Optional |
lastActiveInMinutes |
Numeric. Filter results by a given time frame during which connections were active. Defined backwards, in minutes, from the current time. |
/api/v1/devices/2/connections?lastActiveInMinutes=20 |
Optional |
Response type: JSON
Array of JSON objects that represent device connections, or the following failure message:
Message |
Description |
Failure – error |
Operation failed |
Success response fields
Name |
Type |
Nullable / Not nullable |
List of values |
firstDeviceId |
Numeric |
Not nullable |
- |
secondDeviceId |
Numeric |
Not nullable |
- |
lastSeen |
Numeric |
Not nullable |
Epoch (UTC) |
discovered |
Numeric |
Not nullable |
Epoch (UTC) |
ports |
Number array |
Nullable |
- |
protocols |
JSON array |
Nullable |
Protocol field |
Protocol fields
Name |
Type |
Nullable / Not nullable |
name |
String |
Not nullable |
commands |
String array |
Nullable |
Response example
[
{
"firstDeviceId": 171,
"secondDeviceId": 22,
"lastSeen": 1511281457933,
"discovered": 1511872830000,
"ports": [
502
],
"protocols": [
{
name: "modbus",
commands: [
"Read Coils"
]
},
{
name: "ams",
commands: [
"AMS Write"
]
},
{
name: "http",
commands: [
]
}
]
},
{
"firstDeviceId": 171,
"secondDeviceId": 23,
"lastSeen": 1511281457933,
"discovered": 1511872830000,
"ports": [
502
],
"protocols": [
{
name: "s7comm",
commands: [
"Download block",
"Upload"
]
}
]
}
]
Type: GET
APIs:
curl -k -H "Authorization: <AUTH_TOKEN>" 'https://<IP_ADDRESS>/api/v1/devices/<deviceId>/connections?lastActiveInMinutes=&discoveredBefore=&discoveredAfter=
Examples:
With given query parameters:
curl -k -H "Authorization: 1234b734a9244d54ab8d40aedddcabcd" 'https://127.0.0.1/api/v1/devices/2/connections?lastActiveInMinutes=20&discoveredBefore=1594550986000&discoveredAfter=1594550986000
Use this API to request a list of all known CVEs discovered on devices in the network, sorted by descending CVE score.
URI: /api/v1/devices/cves
GET
Example: /api/v1/devices/cves
Define any of the following query parameters to filter the results returned.
Name |
Description |
Example |
Required / Optional |
top |
Numeric. Determine how many top-scored CVEs to get for each device IP address. |
/api/v1/devices/cves?top=50
/api/v1/devices/<ipAddress>/cves?top=50 |
Optional. Default = 100 |
Type: JSON
JSON array of device CVE objects, or the following failure message:
Message |
Description |
Failure – error |
Operation failed |
Success response fields
Name |
Type |
Nullable / Not nullable |
List of values |
cveId |
String |
Not nullable |
A canonical, industry-standard ID for the given CVE. |
ipAddress |
String |
Not nullable |
IP addresses |
score |
String |
Not nullable |
A CVE score, between 0.0 - 10.0 |
attackVector |
String |
Not nullable |
Network , Adjacent Network , Local , or Physical |
description |
String |
Not nullable |
- |
Response example
[
{
"cveId": "CVE-2007-0099",
"score": "9.3",
"ipAddress": "10.35.1.51",
"attackVector": "NETWORK",
"description": "Race condition in the msxml3 module in Microsoft XML Core
Services 3.0, as used in Internet Explorer 6 and other
applications, allows remote attackers to execute arbitrary
code or cause a denial of service (application crash) via many
nested tags in an XML document in an IFRAME, when synchronous
document rendering is frequently disrupted with asynchronous
events, as demonstrated using a JavaScript timer, which can
trigger NULL pointer dereferences or memory corruption, aka
\"MSXML Memory Corruption Vulnerability.\""
},
{
"cveId": "CVE-2009-1547",
"score": "9.3",
"ipAddress": "10.35.1.51",
"attackVector": "NETWORK",
"description": "Unspecified vulnerability in Microsoft Internet Explorer 5.01
SP4, 6, 6 SP1, and 7 allows remote attackers to execute
arbitrary code via a crafted data stream header that triggers
memory corruption, aka \"Data Stream Header Corruption
Vulnerability.\""
}
]
Type: GET
APIs:
curl -k -H "Authorization: <AUTH_TOKEN>" https://<IP_ADDRESS>/api/v1/devices/cves
Examples:
curl -k -H "Authorization: 1234b734a9244d54ab8d40aedddcabcd" https://127.0.0.1/api/v1/devices/cves
Use this API to request a list of all known CVEs discovered on devices in the network for a specific IP address.
URI: /api/v1/devices/cves
GET
Example: /api/v1/devices/cves
Path parameter
Name |
Description |
Example |
Required / Optional |
ipAddress |
Get CVEs for the given IP address. |
/api/v1/devices/<ipAddress>/cves |
Required |
Define the following query parameter to filter the results returned.
Name |
Description |
Example |
Required / Optional |
top |
Numeric. Determine how many top-scored CVEs to get for each device IP address. |
/api/v1/devices/cves?top=50
/api/v1/devices/<ipAddress>/cves?top=50 |
Optional. Default = 100 |
Type: JSON
JSON array of device CVE objects, or the following failure message:
Message |
Description |
Failure – error |
Operation failed |
Success response fields
Name |
Type |
Nullable / Not nullable |
List of values |
cveId |
String |
Not nullable |
A canonical, industry-standard ID for the given CVE. |
ipAddress |
String |
Not nullable |
IP addresses |
score |
String |
Not nullable |
A CVE score, between 0.0 - 10.0 |
attackVector |
String |
Not nullable |
Network , Adjacent Network , Local , or Physical |
description |
String |
Not nullable |
- |
Response example
[
{
"cveId": "CVE-2007-0099",
"score": "9.3",
"ipAddress": "10.35.1.51",
"attackVector": "NETWORK",
"description": "Race condition in the msxml3 module in Microsoft XML Core
Services 3.0, as used in Internet Explorer 6 and other
applications, allows remote attackers to execute arbitrary
code or cause a denial of service (application crash) via many
nested tags in an XML document in an IFRAME, when synchronous
document rendering is frequently disrupted with asynchronous
events, as demonstrated using a JavaScript timer, which can
trigger NULL pointer dereferences or memory corruption, aka
\"MSXML Memory Corruption Vulnerability.\""
},
{
"cveId": "CVE-2009-1547",
"score": "9.3",
"ipAddress": "10.35.1.51",
"attackVector": "NETWORK",
"description": "Unspecified vulnerability in Microsoft Internet Explorer 5.01
SP4, 6, 6 SP1, and 7 allows remote attackers to execute
arbitrary code via a crafted data stream header that triggers
memory corruption, aka \"Data Stream Header Corruption
Vulnerability.\""
}
]
Type: GET
APIs:
curl -k -H "Authorization: <AUTH_TOKEN>" https://<IP_ADDRESS>/api/v1/devices/<deviceIpAddress>/cves?top=
Examples:
With given query parameters:
curl -k -H "Authorization: 1234b734a9244d54ab8d40aedddcabcd" https://127.0.0.1/api/v1/devices/10.10.10.15/cves?top=50
Use this API to request a list of all devices detected by this sensor.
URI: api/v1/devices/
GET
Query parameter
Define the following query parameter to filter the results returned. If you don't set query parameters, all device connections are returned.
Name |
Description |
Example |
Required / Optional |
authorized |
Boolean:
- true : Filter for data on authorized devices only. - false : Filter for data on unauthorized devices only. |
/api/v1/devices/ |
Optional |
Type: GET
curl -k -H "Authorization: <AUTH_TOKEN>" 'https://<IP_ADDRESS>/api/v1/devices/'
Next steps
For more information, see the Defender for IoT API reference overview.