Help Center/Host Security Service/API Reference/API Description/Baseline Management/Querying the Weak Password Detection Result List
Updated on 2026-04-03 GMT+08:00

Querying the Weak Password Detection Result List

Function

This API is used to query the list of weak password detection results.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permission required for calling this API.

URI

GET /v5/{project_id}/baseline/weak-password-users

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID, which is used to specify the project that an asset belongs to. After the project ID is configured, you can query assets in the project using the project ID. For details about how to obtain it, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 1 to 256 characters.

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Definition

Enterprise project ID, which is used to filter assets in different enterprise projects. For details, see Obtaining an Enterprise Project ID.

To query assets in all enterprise projects, set this parameter to all_granted_eps.

Constraints

You need to set this parameter only after the enterprise project function is enabled.

Range

The value can contain 1 to 256 characters.

Default Value

0: default enterprise project.

host_name

No

String

Definition

Server name.

Constraints

N/A

Range

The value can contain 0 to 256 characters.

Default Value

N/A

host_ip

No

String

Definition

Server IP address.

Constraints

N/A

Range

The value can contain 0 to 256 characters.

Default Value

N/A

user_name

No

String

Definition

Name of an account using a weak password.

Constraints

N/A

Range

The value can contain 0 to 32 characters.

Default Value

N/A

host_id

No

String

Definition

Server ID. If this parameter is not specified, all the servers of the user are queried.

Constraints

N/A

Range

The value can contain 0 to 64 characters.

Default Value

N/A

limit

No

Integer

Definition

Number of records displayed on each page.

Constraints

N/A

Range

Value range: 10-200

Default Value

10

offset

No

Integer

Definition

Offset, which specifies the start position of the record to be returned.

Constraints

N/A

Range

The value range is 0 to 2,000,000.

Default Value

The default value is 0.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token, which contains user identity and permissions. The token can be used for identity authentication when an API is called. For details about how to obtain the token, see Obtaining a User Token.

Constraints

N/A

Range

The value can contain 1 to 32,768 characters.

Default Value

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_num

Long

Definition

Total weak passwords.

Range

N/A

data_list

Array of WeakPwdListInfoResponseInfo objects

Definition

Weak password list.

Range

N/A

Table 5 WeakPwdListInfoResponseInfo

Parameter

Type

Description

host_id

String

Definition

Server ID.

Range

N/A

host_name

String

Definition

Server name.

Range

N/A

host_ip

String

Definition

Server IP address (private IP address). This field is retained for compatibility purposes.

Range

N/A

private_ip

String

Definition

Server private IP address.

Range

N/A

public_ip

String

Definition

Server EIP.

Range

N/A

update_time

Long

Definition

Latest scan time, in ms.

Range

N/A

weak_pwd_accounts

Array of WeakPwdAccountInfoResponseInfo objects

Definition

List of accounts with weak passwords.

Range

N/A

Table 6 WeakPwdAccountInfoResponseInfo

Parameter

Type

Description

user_name

String

Definition

Name of an account using a weak password.

Range

N/A

service_type

String

Definition

Account Type

Range

  • system: system account

  • mysql: MySQL account

  • redis: Redis account

  • tomcat: Tomcat account

  • ftp: FTP account

duration

Integer

Definition

Validity period of a weak password, in days

Range

N/A

desensitized_weak_passwords

String

Definition

Masked weak password.

Range

N/A

suggestion

String

Definition

Modification suggestion.

Range

N/A

Example Requests

Query the weak password of servers whose enterprise project ID is xxx. Data on the first page (the first 10 records) is returned by default.

GET https://{endpoint}/v5/{project_id}/baseline/weak-password-users?enterprise_project_id=xxx

Example Responses

Status code: 200

Request succeeded.

{
  "total_num" : 2,
  "data_list" : [ {
    "host_id" : "caa958adxxxxxxa481",
    "host_name" : "ubuntu1",
    "host_ip" : "192.168.0.8",
    "private_ip" : "192.168.0.8",
    "public_ip" : "100.85.85.85",
    "update_time" : 0,
    "weak_pwd_accounts" : [ {
      "user_name" : "localhost1",
      "service_type" : "system",
      "duration" : 2147483647,
      "desensitized_weak_passwords" : "$a****1**",
      "suggestion" : "The Password should contain the following character types: uppercase letters, lowercase letters, digits, and special characters."
    } ]
  }, {
    "host_id" : "caa958adxxxxxxa482",
    "host_name" : "ubuntu2",
    "host_ip" : "192.168.0.9",
    "private_ip" : "192.168.0.8",
    "public_ip" : "",
    "update_time" : 0,
    "weak_pwd_accounts" : [ {
      "user_name" : "localhost2",
      "service_type" : "system",
      "duration" : 2147483647,
      "desensitized_weak_passwords" : "*******",
      "suggestion" : "The minimum number of characters in a password should not be smaller than 8"
    } ]
  } ]
}

Status Codes

Status Code

Description

200

Request succeeded.

Error Codes

See Error Codes.