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>
14 KiB
Querying the List of Affected Servers of a Security Configuration Item
Function
This API is used to query the list of affected servers of a specified security configuration item.
URI
GET /v5/{project_id}/baseline/risk-config/{check_name}/hosts
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID Minimum: 20 Maximum: 64 |
check_name |
Yes |
String |
Name of the configuration check (baseline), for example, SSH, CentOS 7, and Windows. Minimum: 0 Maximum: 256 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
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: 64 |
standard |
Yes |
String |
hw_standard: Cloud security practice standard |
host_name |
No |
String |
Server name Minimum: 0 Maximum: 256 |
host_ip |
No |
String |
Server IP address Minimum: 0 Maximum: 256 |
limit |
No |
Integer |
Number of items per page Minimum: 0 Maximum: 200 Default: 10 |
offset |
No |
Integer |
Offset, which specifies the start position of the record to be returned. Minimum: 0 Maximum: 2000000 Default: 0 |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. Minimum: 32 Maximum: 2097152 |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
total_num |
Long |
Total amount of data affected by configuration check Minimum: 0 Maximum: 2147483647 |
data_list |
Array of SecurityCheckHostInfoResponseInfo objects |
Data list Array Length: 0 - 2147483647 |
Parameter |
Type |
Description |
---|---|---|
host_id |
String |
Host ID Minimum: 0 Maximum: 64 |
host_name |
String |
Server name Minimum: 0 Maximum: 256 |
host_public_ip |
String |
Server public IP address Minimum: 0 Maximum: 128 |
host_private_ip |
String |
Server private IP address Minimum: 0 Maximum: 256 |
scan_time |
Long |
Scan time (ms) Minimum: 0 Maximum: 9223372036854775807 |
failed_num |
Integer |
Number of risk items Minimum: 0 Maximum: 2147483647 |
passed_num |
Integer |
Number of passed items Minimum: 0 Maximum: 2147483647 |
Example Requests
This API is used to query the list of affected servers whose baseline name is SSH, check standard is cloud security practice standard, and enterprise project ID is xxx.
GET https://{endpoint}/v5/{project_id}/baseline/risk-config/SSH/hosts?standard=hw_standard&enterprise_project_id=xxx
Example Responses
Status code: 200
servers affected by the security configuration item
{ "total_num" : 1, "data_list" : [ { "failed_num" : 6, "host_id" : "71a15ecc-049f-4cca-bd28-5e90aca1817f", "host_name" : "zhangxiaodong2", "host_private_ip" : "192.168.0.129", "host_public_ip" : "*.*.*.10", "passed_num" : 10, "scan_time" : 1661716860935 } ] }
Status Codes
Status Code |
Description |
---|---|
200 |
servers affected by the security configuration item |
Error Codes
See Error Codes.