Network SSH record

/api/2.0/fo/auth/network_ssh/

[POST]

Network SSH authentication is supported for vulnerability and compliance scans. The new Network SSH API (/api/2.0/fo/auth/network_ssh/) lets you list, create, update and delete Network SSH authentication records. This authentication supports SSH2 format. Network SSH authentication record can be used in place of the Cisco and Checkpoint Firewall authentication records. This authentication record has all the same functionality as the Cisco and Checkpoint Firewall records and additional support for target_type field similar to Unix authentication record. Network SSH authentication records support for password and password2 fields with vaults. This password2 field is similar to expert_password field (for Checkpoint Firewall sub-type) and enable_password field (for Cisco sub-type).

Input Parameters

Parameter

Description

action={action}

(Required) Specify create, update, delete (using POST) or list (using GET or POST). See List Auth Records for type

echo_request={0|1}

(Optional) Specify 1 to view (echo) input parameters in the XML output. By default these are not included.

id={value}

(Required to update or delete record) Record IDs to update/delete. Specify record IDs and/or ID ranges (for example, 1359-1407). Multiple entries are comma separated.

title={value}

(Required to create record) A title for the record. The title must be unique. Maximum 255 characters (ascii).

comments={value}

(Optional to create or update record) User defined comments. Maximum of 1999 characters.

port={value}

(Optional) The port the database name is running on.

target_type={value}

(Optional) Specify the target type.

username={value}

(Required to create record, optional to update record) The username of the account to be used for authentication. If login_type=vault is specified, this is the username of a vault account. Maximum 255 characters (ascii).

password={value}

(Optional) The password of the Network SSH account to be used for authentication. Maximum 100 characters (ascii).

login_type=(basic|vault}

(Optional) Login type can be basic (default) or vault. Set to vault if a third party vault will be used to retrieve the password. Vault parameters need to be provided in the record.

Click here for vault parameters

p2_login_type=(basic|vault}

(Optional) p2 Login type can be basic (default) or vault. Set to vault if a third party vault will be used to retrieve the password. Vault parameters need to be provided in the record.

Click here for vault parameters

p2_<vault parameter>={value}

(Optional) If p2_login_type is vault then all vault parameter fields must be added with prefix 'p2_'

For example, p2_vault_type, p2_vault_id.

Vault specific parameters required depend on the vault type you've selected. See “Vault Definition” in the API user guide.

cleartext_password={0|1}

(Optional) When not specified, the scanning engine only uses strong password encryption for remote login. Specify 1 to allow your password to be transmitted in clear text when connecting to services which do not support strong password encryption. For more info, search for "Clear Text Password" in online help.

For a create request, if cleartext_password=1, the password parameter is required. For an update request, if cleartext_password=1, and the record does not have a password set, then cleartext_password=1 is *silently ignored*.

password2={value}

(Optional) This password2 field is similar to existing expert_password field (for Checkpoint Firewall sub-type) and enable_password field (for Cisco sub-type).

For Checkpoint Firewall: The password required for executing the “expert” command on the target hosts. The password may include 1-31 characters (ascii).

For Cisco: The password required for executing the “enable” command on the target hosts. The password may include 1-31 characters (ascii).

{XML File}

(Optional and valid only for Unix record, i.e. not supported for Cisco or Checkpoint Firewall sub-type)

XML file where you define private-key certificates and root delegations. These are defined using this DTD: <platform API server>/api/2.0/fo/auth/unix/unix_auth_params.dtd

ips={value}

(Required to create record) The IP address(es) for the targets you want to authenticate to. Multiple entries are comma separated.

(Optional to update record) IPs specified will overwrite existing IPs in the record, and existing IPs will be removed.

An IP added to the Network SSH authentication record cannot added in Unix, Cisco or Checkpoint authentication records.

This parameter and the add_ips parameter or the remove_ips parameter cannot be specified in the same request.

 

Sample - Create Network SSH record

API request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: curl" -d

"https://qualysapi.qualys.com/api/2.0/fo/auth/network_ssh/?action=create&username=abc&title=a11&ips=10.10.110.12&password=abc&port=270,17,122&cleartext_password=1&target_type=A10&password2=1234"

API request using XML

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: curl" -d

"https://qualysapi.qualys.com/api/2.0/fo/auth/network_ssh/?action=create&username=abc&title=new%201&ips=10.10.110.12&password=abc&comments=new%20auth%20record&port=270,17,122&cleartext_password=1&target_type=A10&p2_login_type=vault&p2_vault_type=Thycotic%20Secret%20Server&p2_vault_id=41014&p2_secret_name=sc_name&password2=1234&login_type=vault&vault_type=Thycotic%20Secret%20Server&vault_id=41014&secret_name=bder&details=All"

--data-binary @add_params.xml

Content of add_params.xml

<?xml version="1.0" encoding="UTF-8" ?>

<NETWORK_SSH_AUTH_PARAMS>

<PRIVATE_KEY_CERTIFICATES>

<PRIVATE_KEY_CERTIFICATE>

<PRIVATE_KEY_INFO type="vault">

<DIGITAL_VAULT>

<VAULT_TYPE>CA PAM</VAULT_TYPE>

<VAULT_ID>41022</VAULT_ID>

<VAULT_DEVICE_NAME>hq_device</VAULT_DEVICE_NAME>

<VAULT_APP_NAME>APP_NAME</VAULT_APP_NAME>

</DIGITAL_VAULT>

</PRIVATE_KEY_INFO>

<PASSPHRASE_INFO type="vault">

<DIGITAL_VAULT>

<VAULT_TYPE>CA PAM</VAULT_TYPE>

<VAULT_ID>41022</VAULT_ID>

<VAULT_DEVICE_NAME>hq_device</VAULT_DEVICE_NAME>

<VAULT_APP_NAME>APP_NAME</VAULT_APP_NAME>

</DIGITAL_VAULT>

</PASSPHRASE_INFO>

</PRIVATE_KEY_CERTIFICATE>

</PRIVATE_KEY_CERTIFICATES>

</NETWORK_SSH_AUTH_PARAMS>

XML output

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE BATCH_RETURN SYSTEM "http://qualysapi.qualys.com/api/2.0/batch_return.dtd">

<BATCH_RETURN>

    <RESPONSE>

        <DATETIME>2021-04-21T06:34:05Z</DATETIME>

        <BATCH_LIST>

            <BATCH>

                <TEXT>Successfully Created</TEXT>

                <ID_SET>

                    <ID>102451</ID>

                </ID_SET>

            </BATCH>

        </BATCH_LIST>

    </RESPONSE>

</BATCH_RETURN>

 

Sample - Update Network SSH record

API request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: curl" -d

"https://qualysapi.qualys.com/api/2.0/fo/auth/network_ssh/?username=abc&password2=1234&action=update&ids=102419"

XML output

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE BATCH_RETURN SYSTEM "http://qualysapi.qualys.com/api/2.0/batch_return.dtd">

<BATCH_RETURN>

    <RESPONSE>

        <DATETIME>2021-04-21T06:37:07Z</DATETIME>

        <BATCH_LIST>

            <BATCH>

                <TEXT>Successfully Updated</TEXT>

                <ID_SET>

                    <ID>102419</ID>

                </ID_SET>

            </BATCH>

        </BATCH_LIST>

    </RESPONSE>

</BATCH_RETURN>

Sample - Delete Network SSH record

API request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: curl" -d

"action=delete&ids=4474043"

"https://qualysapi.qualys.com/api/2.0/fo/auth/network_ssh/"

XML output

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE BATCH_RETURN SYSTEM "https://qualysapi.qualys.com/api/2.0/batch_return.dtd">

<BATCH_RETURN>

  <RESPONSE>

    <DATETIME>2021-01-12T14:48:56Z</DATETIME>

    <BATCH_LIST>

      <BATCH>

        <TEXT>Successfully Deleted</TEXT>

        <ID_SET>

          <ID>4474043</ID>

        </ID_SET>

      </BATCH>

    </BATCH_LIST>

  </RESPONSE>

</BATCH_RETURN>

DTDs for auth type "network_ssh"

<platform API server>/api/2.0/batch_return.dtd

<platform API server>/api/2.0/fo/auth/network_ssh/dtd/auth_list_output.dtd

Private-key certificates are specified using the network_ssh_auth_params.dtd here

<platform API server>/api/2.0/fo/auth/network_ssh/network_ssh_auth_params.dtd