MariaDB Record

GET POST/api/2.0/fo/auth/mariadb/

Create, update, list and delete MariaDB records for compliance scans (using PC).

Input ParametersInput Parameters

Parameter

Required/Optional

Data Type

Description

action={action}

Required String 

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

echo_request={0|1}

Optional Integer 

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

ids={value}

Required to update or delete record Integer 

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 String 

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

comments={value}

Optional to create or update record String 

User defined comments. Maximum of 1999 characters.

MariaDB

ssl_verify={0|1}

Optional to create or update record, and valid for server that supports SSL Integer 

Specify 1 for a complete SSL certificate validation.

- If unspecified (or ssl_verify=0), Qualys scanners authenticate with MySQL Servers that don’t use SSL or MariaDB servers that use SSL. However, in the SSL case, the server SSL certificate verification will be skipped.

- If ssl_verify=1, the Qualys scanners will only send a login request after verifying that a connection the MariaDB server uses SSL, the server SSL certificate is valid and matches the scanned host.

hosts={value}

Optional to create or update record Integer 

A list of FQDNs for the hosts that correspond to all host IP addresses on which a custom SSL certificate signed by a trusted root CA is installed. Multiple hosts are comma separated.

database={value}

Required to create record, optional to update record String 

The database name to authenticate. Specify a valid MariaDB database name.

port={value}

Required to create record, optional to update record Integer 

The port the database name is running on. The default is 3306.

windows_config_file=
{value}

Optional to create or update record Path 

The path to the Windows mariadb config file. Access to this config file is required to run certain checks on Windows hosts.

Note: You must include one or both of these parameters in a create request: windows_config_file and unix_config_file.

unix_config_file=
{value}

Optional to create or update record Path

The path to the Unix mariadb config file. Access to this config file is required to run certain checks on Unix hosts.

Note: You must include one or both of these parameters in a create request: windows_config_file and unix_config_file.

client_cert={value}

Optional to create or update record Integer 

PEM-encoded X.509 certificate. Specify if certificate authentication is required by your server to establish an SSL connection.

client_key={value}

Optional to create or update record Integer 

PEM-encoded RSA private key. Specify if certificate authentication is required by your server to establish an SSL connection.

Login credentials

login_type={basic|vault}

Optional Boolean 

The login type is basic by default. You can choose vault (for vault based authentication).

username={value}

Required to create record, optional to update record String 

The username to be used for authentication to MariaDB server.

password={value}

Required to create record, optional to update record String 

The password to be used for authentication to MariaDB server.

Vault

vault_type={value}

Required to create record when login_type=vault Integer 

The vault type to be used for authentication.

vault_id={value}

Required to create record when login_type=vault and you want to retrieve private key from vault Integer 

The vault ID where you want to retrieve the private key from. Certain vaults support this capability.

{vault parameters}

Required to create record when login_type=vault Integer 

Vault specific parameters required depend on the vault type you’ve selected. See Vault Parameters

Target Hosts

ips={value}

Required to create record Integer

The IP address(es) the server will log into using the record’s credentials. Multiple entries are comma separated.

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

add_ips={value}

Optional and valid only to update record Integer 

IPs to be added to an existing record. You may enter a combination of IPs and IP ranges. Multiple entries are comma separated.

remove_ips={value}

Optional and valid to update record Integer 

IPs to be removed from your record. You may enter a combination of IPs and ranges. Multiple entries are comma separated.

network_id={value}

Optional to create or update record, and valid when the networks feature is enabled Integer 

The network ID for the record.

Sample - Create MariaDB Record with Basic LoginSample - Create MariaDB Record with Basic Login

API request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: curl sample" -d "action=create&title=MariaDB_Auth1&username=root&password=abc123&ips=10.10.31.86&echo_request=0&unix_config_file=/etc/my.cnf&port=22&database=mariadb" "https://<qualys_base_url>/api/2.0/fo/auth/mariadb/" "https://<qualys_base_url>/api/2.0/fo/auth/docker/"

XML output

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE BATCH_RETURN SYSTEM "https://<qualys_base_url>/api/2.0/batch_return.dtd">
<BATCH_RETURN>
  <RESPONSE>
    <DATETIME>2018-07-17T21:56:47Z</DATETIME>
    <BATCH_LIST>
      <BATCH>
        <TEXT>Successfully Created</TEXT>
        <ID_SET>
          <ID>284866</ID>
        </ID_SET>
      </BATCH>
    </BATCH_LIST>
  </RESPONSE>
</BATCH_RETURN>

Sample - List MariaDB RecordSample - List MariaDB Record

API request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl" -d"action=list" "https://<qualys_base_url>/api/2.0/fo/auth/mariadb/"

XML output

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE AUTH_MARIADB_LIST_OUTPUT SYSTEM "https://<qualys_base_url>/api/2.0/fo/auth/mariadb/auth_mariadb_list_output.dtd">
<AUTH_MARIADB_LIST_OUTPUT>
  <RESPONSE>
    <DATETIME>2018-07-17T21:57:32Z</DATETIME>
    <AUTH_MARIADB_LIST>
      <AUTH_MARIADB>
        <ID>284866</ID>
        <TITLE><![CDATA[MariaDB_Auth1]]></TITLE>
        <USERNAME><![CDATA[root]]></USERNAME>
        <DATABASE><![CDATA[mariadb]]></DATABASE>
        <PORT>22</PORT>
        <IP_SET>
          <IP>10.10.31.86</IP>
        </IP_SET>
        <LOGIN_TYPE><![CDATA[basic]]></LOGIN_TYPE>
        <SSL_VERIFY>false</SSL_VERIFY>
        <WINDOWS_CONF_FILE><![CDATA[]]></WINDOWS_CONF_FILE>
        <UNIX_CONF_FILE><![CDATA[/etc/my.cnf]]></UNIX_CONF_FILE>
        <NETWORK_ID>0</NETWORK_ID>
        <CREATED>
          <DATETIME>2018-07-17T21:56:47Z</DATETIME>
          <BY>seenu_yn</BY>
        </CREATED>
        <LAST_MODIFIED>
          <DATETIME>2018-07-17T21:56:47Z</DATETIME>
        </LAST_MODIFIED>
      </AUTH_MARIADB>
    </AUTH_MARIADB_LIST>
  </RESPONSE>
</AUTH_MARIADB_LIST_OUTPUT>

DTDs for Authentication Type "mariadb"

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

<platform API server>/api/2.0/fo/auth/mariadb/auth_mariadb_list_output.dtd