Docker Record

GET POST/api/2.0/fo/auth/docker/

Create, update, list and delete Docker records for compliance scans (using PC). This record is used to authenticate to a Docker daemon (version 1.9 to 1.12) running on a Linux host.

Requirement - Unix authentication is required so you’ll also need a Unix record for the asset running the docker.

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 

The record title.

comments={value}

Optional String 

User defined comments.

Docker

docker_deamon_conf_file= {value}

Optional to create or update record FIle 

Location of the configuration file for the docker daemon.

docker_command={value}

Optional String 

The docker command to connect to a local docker daemon.

Target Hosts

ips={value}

Required to create record Integer 

IPs to be added to your docker record.

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 Docker RecordSample - Create Docker Record

API request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: curl demo" -d "action=create&title=docker_sample&ips=10.10.30.159&docker_deamon_conf_file=/etc/docker/daemon.json&docker_command=/usr/bin/docker&echo_request=1" "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>
  <REQUEST>
    <DATETIME>2018-03-09T06:09:46Z</DATETIME>
    <USER_LOGIN>username</USER_LOGIN>   
    <RESOURCE>https://<qualys_base_url>/api/2.0/fo/auth/docker/</RESOURCE>
    <PARAM_LIST>
      <PARAM>
        <KEY>action</KEY>
        <VALUE>create</VALUE>
      </PARAM>
      <PARAM>
        <KEY>title</KEY>
        <VALUE>docker_sample</VALUE>
      </PARAM>
      <PARAM>
        <KEY>ips</KEY>
        <VALUE>10.10.30.159</VALUE>
      </PARAM>
      <PARAM>
        <KEY>docker_deamon_conf_file</KEY>
        <VALUE>/etc/docker/daemon.json</VALUE>
      </PARAM>
      <PARAM>
        <KEY>docker_command</KEY>
        <VALUE>/usr/bin/docker</VALUE>
      </PARAM>
      <PARAM>
        <KEY>echo_request</KEY>
        <VALUE>1</VALUE>
      </PARAM>
    </PARAM_LIST>
  </REQUEST>
  <RESPONSE>
    <DATETIME>2018-03-09T06:09:46Z</DATETIME>
    <BATCH_LIST>
      <BATCH>
        <TEXT>Successfully Created</TEXT>
        <ID_SET>
          <ID>72685</ID>
        </ID_SET>
      </BATCH>
    </BATCH_LIST>
  </RESPONSE>
</BATCH_RETURN>

Sample - Update Docker RecordSample - Update Docker Record

API request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: curl demo" -d"action=update&ids=72685&add_ips=10.10.26.26""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-03-09T06:12:57Z</DATETIME>
<BATCH_LIST>
<BATCH>
<TEXT>Successfully Updated</TEXT>
<ID_SET>
<ID>72685</ID>
</ID_SET>
</BATCH>
</BATCH_LIST>
</RESPONSE>
</BATCH_RETURN>

DTDs for Authentication Type "Docker"

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

<platform API server>/api/2.0/fo/auth/docker/auth_docker_list_output.dtd