Reviewed-by: Belejkanic, Lukas <lukas.belejkanic@t-systems.com> Reviewed-by: Drobnak, David <david.drobnak@t-systems.com> Co-authored-by: Li, Qiao <qiaoli@huawei.com> Co-committed-by: Li, Qiao <qiaoli@huawei.com>
15 KiB
Asset Fingerprint of a Server - Open Port Information
Function
This API is used to check open port information in the asset fingerprints of a server.
URI
GET /v5/{project_id}/asset/ports
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
project_id |
Yes |
String |
Project ID Minimum: 1 Maximum: 256 |
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
host_id |
Yes |
String |
Server ID Minimum: 0 Maximum: 128 |
host_name |
No |
String |
Server name Minimum: 0 Maximum: 128 |
host_ip |
No |
String |
Server IP address Minimum: 0 Maximum: 128 |
port |
No |
Integer |
Port number Minimum: 1 Maximum: 65535 |
type |
No |
String |
Port type: TCP or UDP. |
enterprise_project_id |
No |
String |
Enterprise project ID. The value 0 indicates the default enterprise project. To query all enterprise projects, set this parameter to all_granted_eps. Default: 0 Minimum: 0 Maximum: 256 |
limit |
No |
Integer |
Number of records on each page. Minimum: 10 Maximum: 100 Default: 10 |
offset |
No |
Integer |
Offset, which specifies the start position of the record to be returned. Minimum: 0 Maximum: 10000 Default: 0 |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. Minimum: 32 Maximum: 4096 |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
|---|---|---|
total_num |
Integer |
Number of open ports Minimum: 0 Maximum: 10000 |
data_list |
Array of PortResponseInfo objects |
Port information list Array Length: 0 - 10000 |
Parameter |
Type |
Description |
|---|---|---|
host_id |
String |
Server ID Minimum: 1 Maximum: 128 |
laddr |
String |
Listening IP address Minimum: 1 Maximum: 128 |
status |
String |
port status, normal, danger or unknow
|
port |
Integer |
Port number Minimum: 0 Maximum: 65535 |
type |
String |
Port type: TCP or UDP. |
pid |
Integer |
Process ID Minimum: 1 Maximum: 65535 |
path |
String |
Path of the process execution file. Minimum: 1 Maximum: 256 |
agent_id |
String |
Agent ID Minimum: 1 Maximum: 64 |
container_id |
String |
Container ID Minimum: 0 Maximum: 128 |
Example Requests
The first 10 open ports whose host_id is dd91cd32-a238-4c0e-bc01-3b11653714ac are queried by default.
GET https://{endpoint}/v5/{project_id}/asset/ports?hlimit=10&offset=0&host_id=dd91cd32-a238-4c0e-bc01-3b11653714ac
Example Responses
Status code: 200
Port information list
{
"total_num" : 1,
"data_list" : [ {
"host_id" : "3702fbd6-xxxx-xxxx-xxxx-6715770bxxxx",
"agent_id" : "eb5d03f02fffd85aaf5d0ba5c992d97713244f420e0b076dcf6ae0574c78aa4b",
"container_id" : "",
"laddr" : "0.0.0.0",
"path" : "/usr/sbin/",
"pid" : 1554,
"port" : 22,
"status" : "unknow",
"type" : "TCP"
} ]
}
Status Codes
Status Code |
Description |
|---|---|
200 |
Port information list |
Error Codes
See Error Codes.