Nginx Record

GET POST/api/2.0/fo/auth/nginx/

Create, update, list and delete Nginx authentication records. Compliance scans are supported (using PC and SCA). User permissions for this API are the same as other authentication record APIs.

Requirement - You must configure authentication credentials on target hosts.

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

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).

ips={value}

Required to create record Integer 

Enter a combination of IPs and IP ranges to identify compliance hosts. Multiple entries are comma separated.

add_ips={value}

Optional and valid only to update record Integer 

Add IPs to the IP list for an existing record. You may enter a combination of IPs and IP ranges. Multiple entries are comma separated.

remove_ips={value}

Optional and valid only 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.

unix_base_path={value}

Optional Path 

Absolute path of the Nginx binary file location.

unix_conf_path={value}

Optional Path 

The path to the Nginx configuration file on your Unix hosts.

unix_prefix_path

Optional Path 

The path to the Nginx configuration file on your Unix hosts.

Sample - Create Nginx RecordSample - Create Nginx Record

API Request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl" -d"action=create&ips=1.2.3.4&title=API_Nginx&unix_bin_path=/usr/local/nginx/sbin/nginx&unix_conf_path=/usr/local/nginx/conf/nginx.conf&unix_prefix_path=/usr/local/nginx" "https://<qualys_base_url>/api/2.0/fo/auth/nginx/"

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>2021-08-13T11:36:30Z</DATETIME>
    <BATCH_LIST>
      <BATCH>
        <TEXT>Successfully Created</TEXT>
        <ID_SET>
          <ID>1157719</ID>
        </ID_SET>
      </BATCH>
    </BATCH_LIST>
  </RESPONSE>
</BATCH_RETURN>

Sample - Update Nginx RecordSample - Update Nginx Record

API Request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl" -d"action=update&ids=229028&ips=10.10.10.10&title=Test Nginx&unix_bin_path=/usr/local/nginx/sbin/nginx&unix_conf_path=/usr/local/nginx/conf/nginx.conf&unix_prefix_path=/usr/local/nginx""https://<qualys_base_url>/api/2.0/fo/auth/nginx"

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>2021-08-03T03:15:35Z</DATETIME>
        <BATCH_LIST>
            <BATCH>
                <TEXT>Successfully Updated</TEXT>
                <ID_SET>
                    <ID>229028</ID>
                </ID_SET>
            </BATCH>
        </BATCH_LIST>
    </RESPONSE>
</BATCH_RETURN>

Sample - List Nginx RecordSample - List Nginx Record

You’ll see Nginx record IDs in the output when you have Nginx records in your account.

API Request

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

XML Output

 

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE AUTH_RECORDS_OUTPUT SYSTEM 
"https://<qualys_base_url>/api/2.0/fo/auth/nginx/auth_nginx_list_outpu
t.dtd">
<AUTH_NGINX_LIST_OUTPUT>
 <RESPONSE>
 <DATETIME>2021-08-02T13:57:09Z</DATETIME>
 <AUTH_NGINX_LIST>
 <AUTH_NGINX>
 <ID>228028</ID>
 <TITLE>
 <![CDATA[Nginx second]]>
 </TITLE>
 <IP_SET>
 <IP>10.11.12.13</IP>
 </IP_SET>
 <UNIX_BIN_PATH>
 <![CDATA[/usr/local/nginx/sbin/nginx]]>
 </UNIX_BIN_PATH>
 <UNIX_CONF_PATH>
 <![CDATA[/usr/local/nginx/conf/nginx.conf]]>
 </UNIX_CONF_PATH>
 <UNIX_PREFIX_PATH>
 <![CDATA[/usr/local/nginx]]>
 </UNIX_PREFIX_PATH>
 <NETWORK_ID>0</NETWORK_ID>
 <CREATED>
 <DATETIME>2021-07-29T06:15:12Z</DATETIME>
 <BY>joe_user</BY>
 </CREATED>
 <LAST_MODIFIED>
 <DATETIME>2021-07-29T07:20:17Z</DATETIME>
 </LAST_MODIFIED>
 </AUTH_NGINX>
 </AUTH_NGINX_LIST>
 <GLOSSARY>
 <USER_LIST>
 <USER>
 <USER_LOGIN>joe_user</USER_LOGIN>
 <FIRST_NAME>Joe</FIRST_NAME>
 <LAST_NAME>User</LAST_NAME>
 </USER>
 </USER_LIST>
 </GLOSSARY>
 </RESPONSE>
</AUTH_NGINX_LIST_OUTPUT>

Sample - Delete Nginx RecordSample - Delete Nginx Record

API Request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl" -d"action=delete&ids=5146728,5146726" "https://<qualys_base_url>/api/2.0/fo/auth/nginx/"

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>2021-08-27T11:38:07Z</DATETIME>
    <BATCH_LIST>
      <BATCH>
        <TEXT>Successfully Deleted</TEXT>
        <ID_SET>
          <ID>5146726</ID>
          <ID>5146728</ID>
        </ID_SET>
      </BATCH>
    </BATCH_LIST>
  </RESPONSE>
</BATCH_RETURN>

DTDs for Authentication Type "nginx"

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

<platform API server>/api/2.0/fo/auth/nginx/auth_nginx_list_output.dtd