Add Excluded Hosts

GET POST/api/2.0/fo/asset/excluded_ip/?action=add

Add hosts (IPs) to your excluded host list. Hosts in your excluded host list will not be scanned.

Permissions - Managers and Unit Managers have permission to add IPs to the excluded host list.

Input ParametersInput Parameters

Parameter

Required/Optional

Data Type

Description

action=add

Required String 

Specify action=add to add excluded hosts.

echo_request={0|1}

Optional Integer 

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

ips={value}

Required Integer 

The IP addresses to be added to the excluded IPs list. Enter a comma separated list of IPv4 singletons or ranges. For example: 10.10.10.13,10.10.10.25-10.10.10.29

expiry_days={value}

Optional Integer 

The number of days the IPs being added to the excluded IPs list will be considered valid for exclusion. When the expiration is reached, the IPs are removed from the list and made available again for scanning. When unspecified, the IPs being added have no expiration and will remain on the list until removed by a user.

dg_names={value}

Optional String 

Specify users who will be notified 7 days before hosts are removed from the excluded hosts list (i.e. supply distribution group names as defined in the Qualys UI). Multiple distribution groups are comma separated. A maximum of 15 distribution groups may be entered.

comment={value}

Required String 

User-defined notes (up to 1024 characters).

network_id={value}

Optional and valid only when the user making the request has access to more than one network Integer 

Assign a network ID to the IPs being added to the excluded IPs list. By default, the user’s default network ID is assigned.

Sample 1 - Add IPs to Excluded Host ListSample 1 - Add IPs to Excluded Host List

API Request

curl -H "X-Requested-With: curl" -u "USERNAME:PASSWD" -d"action=add&ips=10.100.100.101-10.100.100.255&comment=adding ips&expiry_days=5""https://<qualys_base_url>/api/2.0/fo/asset/excluded_ip/"

XML Output

<!DOCTYPE SIMPLE_RETURN SYSTEM "https://<qualys_base_url>/api/2.0/simple_return.dtd">
<SIMPLE_RETURN>
  <RESPONSE>
    <DATETIME>2018-04-23T00:33:21Z</DATETIME>
    <TEXT>Adding IPs to Excluded IPs list.</TEXT>
    <ITEM_LIST>
      <ITEM>
        <KEY>Added IPs</KEY>
        <VALUE>10.100.100.101-10.100.100.255</VALUE>
      </ITEM>
    </ITEM_LIST>
  </RESPONSE>
</SIMPLE_RETURN>

Sample 2 - IPs Already in Excluded Host ListSample 2 - IPs Already in Excluded Host List

API Request

curl -H "X-Requested-With: curl" -u "USERNAME:PASSWD" -d "action=add&ips=10.10.34.210-10.10.34.212&comment=adding, added IPs " "https://<qualys_base_url>/api/2.0/fo/asset/excluded_ip/"

XML Output

<!DOCTYPE SIMPLE_RETURN SYSTEM "https://<qualys_base_url>/api/2.0/simple_return.dtd">
<SIMPLE_RETURN>
  <RESPONSE>
    <DATETIME>2018-05-14T13:09:03Z</DATETIME>
    <TEXT>Not Adding any IPs to Excluded IPs list.</TEXT>
    <ITEM_LIST>
      <ITEM>
        <KEY>IPs already in Excluded IPs list.</KEY>
        <VALUE>10.10.34.210-10.10.34.212</VALUE>
      </ITEM>
    </ITEM_LIST>
  </RESPONSE>
</SIMPLE_RETURN>

DTD

DTD returned by requests to add and remove excluded hosts.

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