Azure MS SQL record

/api/2.0/fo/auth/ms_sql/

[POST]

Create, update, list, and delete Azure MS SQL records for compliance scans (using PC).Compliance scans are supported (using PC).

Input Parameters

Parameter

Description

action={action}

(Required) Specify create, update, delete (using POST) or list (using GET or POST).

echo_request={0|1}

(Optional) Set to 1 to view the request’s input parameters (names and values) in the XML output. By default parameters are not included.

ids={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) User defined comments. Maximum of 1999 characters.

Login Credentials

 

provider_name={value}

(Optional) Name of the cloud service provider. The only value supported is azure. This value will be passed by default.

login_type={basic|vault}

(Optional) 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) The username to be used for authentication to Azure MS SQL. The username must contain '@'.

password={value}

(Required to create record, optional to update record) when login_type=basic, specify the password to be used for authentication to Azure MS SQL. Maximum 100 characters (ascii).

instance_name={value}

(Optional to create or update record) The name of the database instance to be scanned. This is the instance name assigned to the TCP/IP port. Important: This is not the host name that is assigned to the Azure MS SQL Server instance name. The only value supported is MSSQLSERVER. This value will be passed by default. Currently, we do not support named instances for this parameter.

database_name={value}

(Optional to create or update record) The database name of the Azure MS SQL database to be scanned. The database name may contain a maximum of 128 characters. These parameters are mutually exclusive: database_name and auto_discover_databases=1.

auto_discover_databases= {0|1}

(Optional to create or update record) The database name of the Azure MS SQL database to be scanned. The database name may contain a maximum of 128 characters. These parameters are mutually exclusive: database_name and auto_discover_databases=1.

port={value}

(Required to create record, optional to update record) The port number assigned to the database instance to be scanned.

Vaults

 

vault_type={value}

(Required if login_type=vault) The third party vault to be used to retrieve the password for login. Certain vaults support this capability. View our latest Vault Support Matrix

vault_id={value}

(Required only when action=create and login_type=vault) The ID of the vault you want to use.

{vault parameters}

(Required only when action=create and login_type=vault) Vault specific parameters required depend on the vault type you've selected. See Vault Parameters.

Target Hosts

 

ips={value}

(Required to create record) IPs to be added to your Azure MS SQL Record record. You may enter a combination of IPs and IP ranges to identify compliance hosts. Multiple entries are comma separated.

(Optional to update record) Overwrites (replaces) the IP list for the authentication record. The IPs you specify are added and any existing IPs are removed.

add_ips={value}

(Optional and valid only to update record) Add IPs to the IPs list for this record. Multiple IPs/ranges are comma separated.

remove_ips={value}

(Optional and valid to update record) IPs to be removed from your record. You may enter a combination of IPs and ranges. Multiple entries are comma separated. This parameter and the ips parameter cannot be specified in the same request.

network_id={value}

(Optional and valid when the networks feature is enabled) The network ID for the record.

Sample - List Azure MS SQL Records

API request

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

"action=list&ids=4620763"

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

XML output

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

<!DOCTYPE AUTH_AZURE_MS_SQL_LIST_OUTPUT SYSTEM "https://qualysapi.qualys.com/api/2.0/fo/auth/azure_ms_sql/dtd/auth_list_output.dtd">

<AUTH_AZURE_MS_SQL_LIST_OUTPUT>

  <RESPONSE>

    <DATETIME>2021-04-23T13:53:08Z</DATETIME>

    <AUTH_AZURE_MS_SQL_LIST>

      <AUTH_AZURE_MS_SQL>

        <ID>4620763</ID>

        <TITLE><![CDATA[AzureMSSQL_Auth_API]]></TITLE>

        <PROVIDER_NAME><![CDATA[Azure]]></PROVIDER_NAME>

        <USERNAME><![CDATA[[email protected]]]></USERNAME>

        <INSTANCE><![CDATA[MSSQLSERVER]]></INSTANCE>

        <DATABASE><![CDATA[testdb]]></DATABASE>

        <PORT>42</PORT>

        <IP_SET>

          <IP>1.1.1.4</IP>

        </IP_SET>

        <LOGIN_TYPE><![CDATA[basic]]></LOGIN_TYPE>

        <CREATED>

          <DATETIME>2021-04-01T11:47:51Z</DATETIME>

          <BY>up_at</BY>

        </CREATED>

        <LAST_MODIFIED>

          <DATETIME>2021-04-01T11:47:51Z</DATETIME>

        </LAST_MODIFIED>

      </AUTH_AZURE_MS_SQL>

    </AUTH_AZURE_MS_SQL_LIST>

  </RESPONSE>

</AUTH_AZURE_MS_SQL_LIST_OUTPUT>

Sample - Create Azure MS SQL Record (with basic login)

API request

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

"action=create&title=my-azuremssql-record&ips=1.1.1.4&port=42&database_name=dbname"

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

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-04-23T11:47:51Z</DATETIME>

    <BATCH_LIST>

      <BATCH>

        <TEXT>Successfully Created</TEXT>

        <ID_SET>

          <ID>4620763</ID>

        </ID_SET>

      </BATCH>

    </BATCH_LIST>

  </RESPONSE>

</BATCH_RETURN>

Sample - Update Azure MS SQL Record (with auto_discover_databases=1)

API request

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

"action=update&auto_discover_databases=1&ids=207024"

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

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-04-26T22:22:41Z</DATETIME>

        <BATCH_LIST>

            <BATCH>

                <TEXT>Successfully Updated</TEXT>

                <ID_SET>

                    <ID>207024</ID>

                </ID_SET>

            </BATCH>

        </BATCH_LIST>

    </RESPONSE>

</BATCH_RETURN>

Sample - Delete Azure MS SQL Records

API request

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

"action=delete&ids=4620768"

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

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-04-26T13:12:51Z</DATETIME>

    <BATCH_LIST>

      <BATCH>

        <TEXT>Successfully Deleted</TEXT>

        <ID_SET>

          <ID>4620768</ID>

        </ID_SET>

      </BATCH>

    </BATCH_LIST>

  </RESPONSE>

</BATCH_RETURN>