Search Host Assets

[POST] /qps/rest/2.0/search/am/hostasset

Returns a list of host assets matching the provided criteria. Assets are returned when they are visible to the user (i.e. in the user’s scope).

Pagination - A maximum of 100 host assets are returned by default. To customize this specify a “preferences” tag in the POST body of your request.

Limit your results - Use the optional “fields” parameter to limit the amount of information returned for each host asset. Learn more about limiting your results



Permissions required - Managers with full scope, other users must have these permissions: Access Permission “API Access” and Asset Management Permission “Read Asset”

Input ParametersInput Parameters

Click here for available operators

Parameter

Mandatory

/Optional

Data Type

Description

qwebHostId

Optional

integer

 

lastVulnScan

Optional

date

 

lastComplianceScan

Optional

date

 

informationGatheredUpdated

Optional

date

 

os

Optional

text

 

dnsHostName

Optional

text

 

address

Optional

text

 

vulnsUpdated

Optional

date

 

id

Optional

integer

 

name

Optional

text

 

created

Optional

date

 

type

 

text

 

netbiosName

 

string

 

netbiosNetworkID

 

text

 

networkGuid

 

text

 

trackingMethod

   

(AssetTrackingMethod: NONE, ICS_OCA, IP, DNSNAME, NETBIOS, INSTANCE_ID, QAGENT, GCP_INSTANCE_ID (only for GCP instances), SHODAN, PASSIVE_SENSOR, EASM, WEBHOOK,ACTIVE_DIRECTORY,SERVICE_NOW, THIRD_PARTY

port

 

integer

 

installedSoftware

 

text

 

tagName

 

text

 

tagId

 

integer

 

updated

  date

Modified date in output.

Assets with cloud agents

activationKey

 

string

Allowed operator: EQUALS

agentConfigurationName

 

string

Allowed operators: EQUALS, CONTAINS

agentConfigurationId

 

long

Allowed operator: EQUALS

agentVersion

 

string

Allowed operators: EQUALS, LESSER, GREATER

lastCheckedIn

 

date

Allowed operators: EQUALS, LESSER, GREATER

cloudProviderType

 

text

AWS, AZURE, IBM, OCI, GCP, Alibaba

EC2 assets

 

region

 

text

Specify the region code for the AWS region.

For example, ap-northeast-1, us-east-2, eu-west-3, etc.

vpcId

 

text

The ID of your Amazon VPC.

imageId

 

text

ID of the Amazon Machine Image (AMI).

instanceId

 

text

EC2 Instance ID.

accountId

 

text

Amazon account ID.

instanceState

 

text

EC2 Instance state. For example, PENDING, RUNNING, TERMINATED, STOPPED, etc.

subnetId

 

text

ID of the subnet where your instance is located (when Amazon VPC is used).

privateDnsName

 

text

The private DNS name of the instance.

awsTagKey

 

text

EC2 instance tags. For example, Owner, Department, Email, Lifecycle, Name, etc.

awsTagValue

 

text

Values for the AWS Tag keys.
For EC2 assets, apart from instanceState, awsTagKey, and awsTagValue, all other parameters are case sensitive. All EC2 parameters support text input with EQUALS operator. Additionally, the instanceState parameter supports EQUALS, NOT EQUALS. The awsTagKey and awsTagValue parameters support EQUALS, CONTAINS.

Alibaba Assets

aliHostName

  string

The hostname of the instance. For example: iZa2djeoxsg0wxcophdfaxZ

aliImageId

  string 

The Id of the image used during the instance creation process. For example:

ubuntu_14_0405_64_20G_alibase_20170824.vhd

aliInstanceId

  string

The ID of the instance. For example: i-a2djeoxsg0wxcophdfax

aliMacAddress

  string

The MAC address of the instance. If the instance has multiple network interface controllers (NICs), only the MAC address of eth0 is displayed. For example: 00:16:3e:0f:XX:XX

aliNetworkType

   

The network type of the instance. Only instances that reside in virtual private clouds (VPCs) are supported. For example: vpc

aliInstanceType

  string

The type of the instance. For example: ecs.g6e.large

aliAccountId

  text

The Id of the Alibaba cloud account to which the instance belongs. For example: 1609****

aliPrivateIp

  string

The private IPv4 address assigned to the NIC. For example: 192.168.XX.XX

aliPublicIp

  string

The public IPv4 address of the instance. For example: 149.xx.xx.xx

aliRegion

  text

The region to which the instance belongs. For example: ap-south-1

aliZone

  string

The zone to which the instance belongs.

aliVpcCIDR

  integer

The CIDR block of the VPC that an instance is in. For example: 172.xx.0.xx/16

aliVpcId

  string

The Id of the virtual private cloud (VPC) to which the instance belongs. For example: vpc-a2d6pc0293vvdadd5yikj

aliSerialNumber

  string

The serial number of the instance. For example: 12tre43e6r-3er4-er43-rtg4-89r76t45

alivSwitchId

  string

The Id of the switch to which the instance is connected. For example: vsw-a2d5goa9k20sqx1m05hdd

alivSwitchCIDR

  integer

The CIDR block of the switch to which the instance is connected. For example: 192.168.XX.XX/24

aliNetworkInterfaceId

  string

The identifier of the NIC. For example: eni-a2d39qixai21eetux572

alidnsServer

  integer

The Domain Name System (DNS) configurations of the instance. For example: 100.xx.x.136

aliState

  text

The state of the instance in Alibaba. Valid values: RUNNING, TERMINATED, STOPPED.

Azure Assets

vmId

  text

The ID of your VM instance.

subscriptionId

  text

Your unique Microsoft Azure subscription ID.

location

  text

Specify the location code for the Azure region.

For example, centralindia, westus2.

state VM

  keyword

The Instance state. You can specify one of the following states:STARTING, RUNNING, STOPPING, STOPPED, DEALLOCATED, DEALLOCATING, DELETED.

subnet

  text

ID of the subnet where your VM instance is located (when Azure VPC is used).

resourceGroup

  text

Type of the resource group to which the VM instance belongs.

resourceGroupName

  text

Name of the resource group type to which the VM instance belongs.

privateIpAddress

  text

The private IP address of the VM instance.

publicIpAddress

  text

The public IP address of the VM instance.

azureTagKey

  text

VM instance tags. For example, Owner, Department, Email, Lifecycle, Name, etc.

azureTagValue

  text

Values for the VM instance tag keys.

imageOffer

  text

Image offer of the VM instance.

imageVersion

  text

Image version of the VM instance.

IBM

ibmId

  value

The ID of your IBM resource.

ibmTagKey

  value

Tag key of the IBM resource.

ibmTagValue

  value

Value of the IBM resource tag.

datacenterId

  value

ID of the datacenter in which the IBM resource if located.

ibmLocation

  value

Name of datacenter in which the IBM resource if located.

Oracle Cloud Compute instances (OCI)

     

ociId

  string

The ID of your OCI.

compartmentId

  string

The compartment ID of your OCI.

hostName

  string

OCI asset host name.

ociTagKey

  string

OCI tags in lowercase. For example, owner, department, email, lifecycle, name, etc.

ociTagValue

  string

Values for the OCI tag keys.

id

  string

OCI asset ID.

ociRegion

  text

Specify the region code for the OCI region.

Note: For Oracle Cloud Compute instances, ociTagKey, and ociTagValue, all other parameters are case sensitive. All parameters support text input with EQUALS operator. The ociTagKey and ociTagValue parameters support EQUALS, CONTAINS.

Sample - Search host assetsSample - Search host assets

Find host assets with a Windows operating system that are tracked by Instance ID

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST" --data-binary @- "<qualys_base_url>/qps/rest/2.0/search/am/hostasset" < file.xml
Note: “file.xml” contains the request POST data.      
    

Request POST data

<ServiceRequest>
    <filters>
        <Criteria field="os" operator="EQUALS">Windows</Criteria>
        <Criteria field="trackingMethod" operator="EQUALS">INSTANCE_ID</Criteria>
    </filters>
</ServiceRequest>      
    

Response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/2.0/am/hostasset.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <hasMoreRecords>true</hasMoreRecords>
    <lastId>5693290</lastId>
    <data>
        <HostAsset>
            <id>2020094</id>
            <name>Updated Name</name>
            <os>Windows</os>
            <dnsHostName>win95.old.corp.net</dnsHostName>
            <created>2018-09-06T19:16:35Z</created>
            <modified>2018-09-06T19:16:35Z</modified>
            <type>HOST</type>
            <tags>
                <list />
            </tags>
            <sourceInfo>
                <list/>
            </sourceInfo>
            <netbiosName>TEST</netbiosName>
            <netbiosNetworkId>10</netbiosNetworkId>
            <networkGuid>66bf43c8-7392-4257-b856-
       a320fde231eb</networkGuid>
            <address>127.0.0.1</address>
            <trackingMethod>INSTANCE_ID</trackingMethod>
            <openPort>
                <list/>
            </openPort>
            <software>
                <list/>
            </software>
            <vuln>
                <list/>
            </vuln>
        </HostAsset>
    </data>
</ServiceResponse>      
    

Sample - Find cloud agents with a specific agent versionSample - Find cloud agents with a specific agent version

API request

curl -u fo_username:password -X POST -H "X-Requested-With: curl" -H "Content-Type: text/xml" -H "Cache-Control: no-cache" --data-binary @host_asset_search.xml "http://qualysapi.qualys.com/qps/rest/2.0/search/am/hostasset/"      
    

Request POST data

<?xml version="1.0" encoding="UTF-8" ?>
<ServiceRequest>
    <filters>
        <Criteria field="agentVersion"      
         operator="EQUALS">1.4.5.168</Criteria>
        <Criteria field="tagName" operator="EQUALS">Cloud
         Agent</Criteria>
    </filters>
</ServiceRequest>      
    

Response

<?xml version="1.0" encoding="UTF-8"?> <ServiceResponse
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://qualysapi.qualys.com/qps/xsd/2.0/am/hostasset.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>6</count>
    <hasMoreRecords>false</hasMoreRecords>
    <lastId>5693290</lastId>
    <data>
        <HostAsset>
            <id>3043442</id>
            <name>102115-M83</name>
            <created>2016-11-04T11:43:40Z</created>
            <modified>2016-11-08T22:35:53Z</modified>
            <type>HOST</type>
            <tags>
                <list>
                    <TagSimple>
                        <id>8832525</id>
                        <name>Cloud Agent</name>
                    </TagSimple>
                </list>
            </tags>
            <sourceInfo>
                <list>
                    <AssetSource/>
                </list>
            </sourceInfo>
            <qwebHostId>12688456922</qwebHostId>
            <dnsHostName>102115-M83</dnsHostName>
            <agentInfo>
                <agentVersion>1.4.5.168</agentVersion>
                <agentId>2e689bb2-53ab-4a58-be0a-
                 a7576964f310</agentId>
                <status>STATUS_INACTIVE</status>
                <lastCheckedIn>2016-10-21T19:03:30Z</lastCheckedIn>
                <connectedFrom>10.100.11.163</connectedFrom>
                <chirpStatus>Manifest Downloaded</chirpStatus>
                <platform>Windows</platform>
                <agentConfiguration>
                    <id>8099</id>
                    <name>Initial Profile - SSN3</name>
                </agentConfiguration>
                <activationKey>
                    <activationId>3ae32b8d-a8cf-4c0e-a477-
                     86fad2dda4f4</activationId>
                    <title>harshal</title>
                </activationKey>
            </agentInfo>
            <netbiosName>102115-M83</netbiosName>
            <address>10.100.11.163</address>
            <trackingMethod>QAGENT</trackingMethod>
            <openPort>
                <list/>
            </openPort>
            <software>
                <list/>
            </software>
            <vuln>
                <list/>
            </vuln>
            <processor>
                <list/>
            </processor>
            <volume>
                <list/>
            </volume>
            <account>
                <list/>
            </account>
            <networkInterface>
                <list/>
            </networkInterface>
        </HostAsset>
    </data>
</ServiceResponse>      
    

Sample - Find host assets with specific ID containing docker informationSample - Find host assets with specific ID containing docker information

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST" --data-binary @- "<qualys_base_url>/qps/rest/2.0/search/am/hostasset" < file.xml
Note: “file.xml” contains the request POST data.      
    

Request POST data

<?xml version="1.0" encoding="UTF-8"?>
<ServiceRequest>
    <filters>
        <Criteria field="id" operator="EQUALS">7727721</Criteria>
    </filters>
</ServiceRequest>      
    

XML output

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=
"<qualys_base_url>/qps/xsd/2.0/am/hostasset.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <hasMoreRecords>false</hasMoreRecords>
    <lastId>5693290</lastId>
    <data>
        <HostAsset>
            <id>7727721</id>
            <name>10.113.198.121</name>
            <created>2018-06-15T11:51:26Z</created>
            <modified>2018-06-15T11:51:26Z</modified>
            <type>HOST</type>
            <tags>
                <list>
                    <TagSimple>
                        <id>8910214</id>
                        <name>SSD27701</name>
                    </TagSimple>
                    <TagSimple>
                        <id>9252992</id>
                        <name>All_data1</name>
                    </TagSimple>
                </list>
            </tags>
            <qwebHostId>707520</qwebHostId>
            <lastVulnScan>2018-06-15T11:48:58Z</lastVulnScan>
            <os>CentOS Linux 7.2.1511</os>
            <address>10.113.198.121</address>
            <trackingMethod>IP</trackingMethod>
            <openPort>
                <list>
                    <HostAssetOpenPort>
                        <port>8080</port>
                        <protocol>TCP</protocol>
                        <serviceId>1180</serviceId>
                        <serviceName>HyperText Transport
                          Protocol</serviceName>
                    </HostAssetOpenPort>
                </list>
            </openPort>
            <vuln>
                <list>
                    <HostAssetVuln>
                        <qid>6</qid>
                        <hostInstanceVulnId>151189838</hostInstanceVulnId>
                        <firstFound>2018-06-15T11:48:58Z</firstFound>
                        <lastFound>2018-06-15T11:48:58Z</lastFound>
                    </HostAssetVuln>
                    <HostAssetVuln>
                        <qid>45038</qid>
                        <hostInstanceVulnId>151189845</hostInstanceVulnId>
                        <firstFound>2018-06-15T11:48:58Z</firstFound>
                        <lastFound>2018-06-15T11:48:58Z</lastFound>
                    </HostAssetVuln>
                </list>
            </vuln>
            <networkInterface>
                <list>
                    <HostAssetInterface>
                        <type>LOCAL</type>
                        <address>10.113.198.121</address>
                    </HostAssetInterface>
                </list>
            </networkInterface>
            <isDockerHost>true</isDockerHost>
            <dockerInfo>
                <dockerVersion>18.06.0-ce-rc1</dockerVersion>
                <noOfContainers>1</noOfContainers>
                <noOfImages>2</noOfImages>
            </dockerInfo>
        </HostAsset>
    </data>
</ServiceResponse>      
    

Sample - Find host assets with specific ID containing split manifest version information for VM, PC, or SCASample - Find host assets with specific ID containing split manifest version information for VM, PC, or SCA

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST" --data-binary @- "<qualys_base_url>/qps/rest/2.0/search/am/hostasset" < file.xml
Note: “file.xml” contains the request POST data.      
    

Request POST data

<?xml version="1.0" encoding="UTF-8"?>
<ServiceRequest>
    <filters>
        <Criteria field="id" operator="EQUALS">7866685</Criteria>
    </filters>
</ServiceRequest>      
    

XML output

<?xml version="1.0" encoding="UTF-8"?> <ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/2.0/am/hostasset.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <hasMoreRecords>false</hasMoreRecords>
    <lastId>5693290</lastId>
    <data>
        <HostAsset>
            <id>7866685</id>
            <name>ip-172-31-3-82.ap-south-1.compute.internal</name>
            <created>2018-08-01T09:34:44Z</created>
            <modified>2018-08-10T08:39:49Z</modified>
            <type>HOST</type>
            <tags>
                <list>
                    <TagSimple>
                        <id>10125654</id>
                        <name>Cloud Agent</name>
                    </TagSimple>
                </list>
            </tags>
            <sourceInfo>
                <list>
                    <AssetSource/>
                    <Ec2AssetSourceSimple>
                        <assetId>7866685</assetId>
                        <type>EC_2</type>
                        <firstDiscovered>2018-08-01T09:34:45Z</firstDiscovered>
                        <lastUpdated>2018-08-01T09:34:45Z</lastUpdated>
                        <reservationId>r-0cd44450f874d4a08</reservationId>
                        <availabilityZone>ap-south-1b</availabilityZone>
                        <privateDnsName>ip-172-31-3-82.ap-south-1.compute.internal</privateDnsName>
                        <publicDnsName>ec2-13-232-170-59.ap-south-1.compute.amazonaws.com</publicDnsName>
                        <localHostname>ip-172-31-3-82.ap-south-1.compute.internal</localHostname>
                        <instanceId>i-0ce729520a8a7d696</instanceId>
                        <instanceType>t2.micro</instanceType>
                        <instanceState>RUNNING</instanceState>
                        <groupId>sg-608b270a</groupId>
                        <groupName>launch-wizard-4</groupName>
                        <spotInstance>false</spotInstance>
                        <accountId>383031258652</accountId>
                        <subnetId>subnet-5a0d6a17</subnetId>
                        <vpcId>vpc-39ccea50</vpcId>
                        <region>ap-south-1</region>
                        <zone>VPC</zone>
                        <imageId>ami-5b673c34</imageId>
                        <publicIpAddress>13.232.170.59</publicIpAddress>
                        <privateIpAddress>172.31.3.82</privateIpAddress>
                        <macAddress>0a:da:e8:58:09:fe</macAddress>
                        <monitoringEnabled>false</monitoringEnabled>
                    </Ec2AssetSourceSimple>
                </list>
            </sourceInfo>
            <qwebHostId>753424</qwebHostId>
            <lastComplianceScan>2018-08-10T00:25:12Z</lastComplianceScan>
            <lastVulnScan>2018-08-10T04:55:06Z</lastVulnScan>
            <lastSystemBoot>2018-08-01T09:23:42Z</lastSystemBoot>
            <lastLoggedOnUser>ec2-user</lastLoggedOnUser>
            <os>Red Hat Enterprise Linux Server 7.5</os>
            <dnsHostName>ip-172-31-3-82.ap-south-1.compute.internal</dnsHostName>
            <agentInfo>
                <agentVersion>1.7.1.38</agentVersion>
                <agentId>66fb864e-9609-4324-8eec-48ab6cb7f260</agentId>
                <status>STATUS_ACTIVE</status>
                <lastCheckedIn>2018-08-10T08:39:42Z</lastCheckedIn>
                <connectedFrom>13.232.170.59</connectedFrom>
                <location>Mumbai,Maharashtra India</location>
                <locationGeoLatitude>18.975</locationGeoLatitude>
                <locationGeoLongtitude>72.8258</locationGeoLongtitude>
                <chirpStatus>Inventory Scan Complete</chirpStatus>
                <platform>Linux</platform>
                <activatedModule>AGENT_VM</activatedModule>
                <manifestVersion>
                    <vm>VULNSIGS-VM-0.12.1.0-17</vm>
                    <pc>VULNSIGS-PC-0.17.0.0-27</pc>
                </manifestVersion>
                <agentConfiguration>
                    <id>514001</id>
                    <name>My Default</name>
                </agentConfiguration>
                <activationKey>
                    <activationId>f9391862-de71-4106-9478-ca14042980dd</activationId>
                    <title>AWS</title>
                </activationKey>
            </agentInfo>
            <networkGuid>6b48277c-0742-61c1-82bb-cac0f9c4094a</networkGuid>
            <address>13.232.170.59</address>
            <trackingMethod>QAGENT</trackingMethod>
            <totalMemory>990</totalMemory>
            <timezone>UTC</timezone>
            <openPort>
                <list>
                    <HostAssetOpenPort>
                        <port>323</port>
                        <protocol>UDP</protocol>
                    </HostAssetOpenPort>
...
                
                </list>
            </openPort>
            <software>
                <list>
                    <HostAssetSoftware>
                        <name>GeoIP</name>
                        <version>1.5.0-11.el7</version>
                    </HostAssetSoftware>
                    <HostAssetSoftware>
                        <name>NetworkManager</name>
                        <version>1.10.2-13.el7</version>
                    </HostAssetSoftware>
                    ...
                
                </list>
            </software>
            <vuln>
                <list>
                    <HostAssetVuln>
                        <qid>370198</qid>
                        <hostInstanceVulnId>157377851</hostInstanceVulnId>
                        <firstFound>2018-08-06T10:08:37Z</firstFound>
                        <lastFound>2018-08-10T04:55:06Z</lastFound>
                    </HostAssetVuln>
                    <HostAssetVuln>
                        <qid>370472</qid>
                        <hostInstanceVulnId>157377852</hostInstanceVulnId>
                        <firstFound>2018-08-06T10:08:37Z</firstFound>
                        <lastFound>2018-08-10T04:55:06Z</lastFound>
                    </HostAssetVuln>
                    ...
                
                </list>
            </vuln>
            <processor>
                <list>
                    <HostAssetProcessor>
                        <name>Intel(R) Xeon(R)</name>
                        <speed>2400</speed>
                    </HostAssetProcessor>
                </list>
            </processor>
            <volume>
                <list>
                    <HostAssetVolume>
                        <name>/</name>
                        <size>10724814848</size>
                        <free>9259859968</free>
                    </HostAssetVolume>
                    ...
                
                </list>
            </volume>
            <account>
                <list>
                    <HostAssetAccount>
                        <username>root</username>
                    </HostAssetAccount>
                    <HostAssetAccount>
                        <username>ec2-user</username>
                    </HostAssetAccount>
                </list>
            </account>
            <networkInterface>
                <list>
                    <HostAssetInterface>
                        <interfaceName>eth0</interfaceName>
                        <macAddress>0a:da:e8:58:09:fe</macAddress>
                        <type>LOCAL</type>
                        <address>fe80:0:0:0:8da:e8ff:fe58:9fe</address>
                        <gatewayAddress>172.31.0.1</gatewayAddress>
                    </HostAssetInterface>
                    ...
                
                </list>
            </networkInterface>
        </HostAsset>
    </data>
</ServiceResponse>      
    

Sample - Search host assets using EC2 attributesSample - Search host assets using EC2 attributes

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST"
--data-binary @-
"<qualys_base_url>/qps/rest/2.0/search/am/hostasset" < file.xml
Note: "file.xml" contains the request POST data.      
    

Request POST data

<?xml version="1.0" encoding="UTF-8"?>
<ServiceRequest>
    <filters>
        <Criteria field="region" operator="EQUALS">ap-northeast-1</Criteria>
        <Criteria field="vpcId" operator="EQUALS">vpc-98a11ffd</Criteria>
        <Criteria field="accountId" operator="EQUALS">205767712438</Criteria>
        <Criteria field="privateDnsName" operator="EQUALS">ip-172-30-1-133.ap-
      northeast-1.compute.internal</Criteria>
    </filters>
</ServiceRequest>      
    

XML output

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/2.0/am/hostasset.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <hasMoreRecords>false</hasMoreRecords>
    <lastId>5693290</lastId>
    <data>
        <HostAsset>
            <id>1553126</id>
            <name>ip-172-30-1-133</name>
            <created>2018-12-03T09:10:18Z</created>
            <modified>2018-12-08T10:14:40Z</modified>
            <type>HOST</type>
            <tags>
                <list>
                    <TagSimple>
                        <id>7977614</id>
                        <name>Cloud Agent</name>
                    </TagSimple>
                </list>
            </tags>
            <sourceInfo>
                <list>
                    <AssetSource/>
                    <Ec2AssetSourceSimple>
                        <assetId>1553126</assetId>
                        <type>EC_2</type>
                        <firstDiscovered>2018-12-
                           03T09:10:18Z</firstDiscovered>
                        <lastUpdated>2018-12-03T09:10:18Z</lastUpdated>
                        <reservationId>r-08a2a6ee33b3acd9f</reservationId>
                        <availabilityZone>ap-northeast-
                            1b</availabilityZone>
                        <privateDnsName>ip-172-30-1-133.ap-northeast-
                            1.compute.internal</privateDnsName>
                        <localHostname>ip-172-30-1-133.ap-northeast-
                            1.compute.internal</localHostname>
                        <instanceId>i-07081d0a8ab051d80</instanceId>
                        <instanceType>t2.micro</instanceType>
                        <instanceState>RUNNING</instanceState>
                        <groupId>sg-9a08a0e3</groupId>
                        <groupName>launch-wizard-12</groupName>
                        <accountId>205767712438</accountId>
                        <subnetId>subnet-5c198e2b</subnetId>
                        <vpcId>vpc-98a11ffd</vpcId>
                        <region>ap-northeast-1</region>
                        <zone>VPC</zone>
                        <imageId>ami-92df37ed</imageId>
                        <publicIpAddress>13.113.179.242</publicIpAddress>
                        <privateIpAddress>172.30.1.133</privateIpAddress>
                        <macAddress>06:c2:ed:39:19:98</macAddress>
                    </Ec2AssetSourceSimple>
                </list>
            </sourceInfo>
            <qwebHostId>294355</qwebHostId>
            <lastComplianceScan>2018-12-08T01:45:34Z</lastComplianceScan>
            <lastVulnScan>2018-12-08T07:14:58Z</lastVulnScan>
            <lastSystemBoot>2018-05-25T06:06:35Z</lastSystemBoot>
            <lastLoggedOnUser>ec2-user</lastLoggedOnUser>
            <os>Amazon Linux 2018.03</os>
            <dnsHostName>ip-172-30-1-133</dnsHostName>
            <agentInfo>
                <agentVersion>2.3.0.20</agentVersion>
                <agentId>f6e1a6be-a99a-4d79-a5b1-f339aeaf8095</agentId>
                <status>STATUS_INACTIVE</status>
                <lastCheckedIn>2018-12-08T07:15:20Z</lastCheckedIn>
                <connectedFrom>13.113.179.242</connectedFrom>
                <location>Tokyo,Tokyo Japan</location>
                <locationGeoLatitude>35.685</locationGeoLatitude>
                <locationGeoLongtitude>139.7514</locationGeoLongtitude>
                <chirpStatus>Inventory Scan Complete</chirpStatus>
                <platform>Linux</platform>
                <activatedModule>AGENT_VM,AGENT_PC,FIM</activatedModule>
                <manifestVersion>
                    <vm>VULNSIGS-VM-0.19.0.0-34</vm>
                    <pc>VULNSIGS-PC-0.19.0.0-34</pc>
                </manifestVersion>
                <agentConfiguration>
                    <id>166800</id>
                    <name>27-March</name>
                </agentConfiguration>
                <activationKey>
                    <activationId>8d988825-5685-4dcf-8d14-
                      0fde25eab037</activationId>
                    <title>september-2018</title>
                </activationKey>
            </agentInfo>
            <networkGuid>6b48277c-0742-61c1-82bb-
               cac0f9c4094a</networkGuid>
            <address>13.113.179.242</address>
            <trackingMethod>QAGENT</trackingMethod>
            <totalMemory>987</totalMemory>
            <timezone>UTC</timezone>
            <openPort>
                <list>
                    <HostAssetOpenPort>
                        <port>57091</port>
                        <protocol>UDP</protocol>
                    </HostAssetOpenPort>
                    ...
                
                </list>
            </openPort>
            <software>
                <list>
                    <HostAssetSoftware>
                        <name>acl</name>
                        <version>2.2.49-6.11.amzn1</version>
                    </HostAssetSoftware>
                    ...
                
                </list>
            </software>
            <vuln>
                <list>
                    <HostAssetVuln>
                        <qid>38582</qid>
                        <hostInstanceVulnId>88353071</hostInstanceVulnId>
                        <firstFound>2018-12-03T22:07:32Z</firstFound>
                        <lastFound>2018-12-08T07:14:58Z</lastFound>
                    </HostAssetVuln>
                    ...
                
                </list>
            </vuln>
            <processor>
                <list>
                    <HostAssetProcessor>
                        <name>Intel(R) Xeon(R)</name>
                        <speed>2400</speed>
                    </HostAssetProcessor>
                </list>
            </processor>
            <volume>
                <list>
                    <HostAssetVolume>
                        <name>/dev</name>
                        <size>506937344</size>
                        <free>506880000</free>
                    </HostAssetVolume>
                    ...
                
                </list>
            </volume>
            <account>
                <list>
                    <HostAssetAccount>
                        <username>root</username>
                    </HostAssetAccount>
                    <HostAssetAccount>
                        <username>ec2-user</username>
                    </HostAssetAccount>
                </list>
            </account>
            <networkInterface>
                <list>
                    <HostAssetInterface>
                        <hostname>ip-172-30-1-133</hostname>
                        <interfaceName>eth0      Link encap</interfaceName>
                        <macAddress>06:C2:ED:39:19:98</macAddress>
                        <type>LOCAL</type>
                        <address>172.30.1.133</address>
                        <gatewayAddress>172.30.1.1</gatewayAddress>
                    </HostAssetInterface>
                  ...
                
                </list>
            </networkInterface>
            <isDockerHost>false</isDockerHost>
        </HostAsset>
    </data>
</ServiceResponse>      
    

Sample - Search host assets using Alibaba attributesSample - Search host assets using Alibaba attributes

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST" --databinary
@- "<qualys_base_url>/qps/rest/2.0/search/am/hostasset"
< file.xml
Note: "file.xml" contains the request POST data.      
    

Request POST data

<ServiceRequest>
    <filters>
        <Criteria field="aliInstanceId" operator="EQUALS">i-2vc9f0kid1ljxld3harf</Criteria>
        <Criteria field="aliRegion" operator="EQUALS">cnchengdu</Criteria>
        <Criteria field="aliAccountId"operator="EQUALS">5XXXXXXXXXXXXXX4</Criteria>
    </filters>
</ServiceRequest>      
    

XML output

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/2.0/a m/hostasset.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <hasMoreRecords>false</hasMoreRecords>
    <data>
        <HostAsset>
            <id>22156587</id>
            <name>alibaba_cloud_2.1903</name>
            <created>2023-02-28T07:18:21Z</created>
            <modified>2023-02-28T15:10:48Z</modified>
            <type>HOST</type>
            <tags>
                <list>
                    <TagSimple>
                        <id>22852814</id>
                        <name>DynTag-06-01</name>
                    </TagSimple>
                    <TagSimple>
                        <id>21233812</id>
                        <name>My Tag</name>
                    </TagSimple>
                    <TagSimple>
                        <id>16541442</id>
                        <name>Cloud Agent</name>
                    </TagSimple>
                </list>
            </tags>
            <sourceInfo>
                <list>
                    <AssetSource/>
                    <AlibabaAssetSourceInfoSimple>
                        <assetId>21897147</assetId>
                        <type>ALIBABA</type>
                        <firstDiscovered>2023-02-21T11:54:39Z</firstDiscovered>
                        <lastUpdated>2023-03-06T11:41:20Z</lastUpdated>
                        <hostName>iZ2vc9f0kid1ljxld3harfZ</hostName>
                        <imageId>aliyun_2_1903_x64_20G_alibase_20220727.vhd</imageId>
                        <instanceId>i-2vc9f0kid1ljxld3harf</instanceId>
                        <macAddress>00:16:xx:xx:b2:xx</macAddress>
                        <networkType>vpc</networkType>
                        <instanceType>ecs.t5-lc1m2.small</instanceType>
                        <accountId>XXXXXXXXXXXXXXXX</accountId>
                        <privateIp>172.xx.xx.xx</privateIp>
                        <publicIp>47.xx.xx.241</publicIp>
                        <region>cn-chengdu</region>
                        <zone>cn-chengdu-a</zone>
                        <vpcCidr>172.xx.0.0/12</vpcCidr>
                        <vpcId>vpc-2vcoalvud4d8dgzvtw617</vpcId>
                        <serialNumber>c6452655-5895-44a6-863c8e8512d1ddc1</serialNumber>
                        <vSwitchId>vsw-2vcne3n3wxdptf8gwvaqw</vSwitchId>
                        <vSwitchCIDR>172.xx.xx.0/xx</vSwitchCIDR>
                        <networkInterfaceId>eni-2vc2sges56b6pv6vf40c</networkInterfaceId>
                        <dnsServer>100.xx.xx.xx,100.xx.xx.xx</dnsServer>
                        <state>RUNNING</state>
                    </AlibabaAssetSourceInfoSimple>
                    <AssetSource/>
                </list>
            </sourceInfo>
            <qwebHostId>3223441</qwebHostId>
            <fqdn>alibaba_cloud_X.XXXX</fqdn>
            <os>Microsoft Windows 10 Microsoft Windows 10 Pro 10.0.17134 Build 17134 Microsoft Windows 10 Pro 10.0.18362 Build 18362</os>
            <dnsHostName>alibaba_cloud_2.1903</dnsHostName>
            <agentInfo>
                <agentVersion>4.7.14.0</agentVersion>
                <agentId>bbbc2bf1-0907-4cee-9a89-9836ddcfde36</agentId>
                <status>STATUS_ACTIVE</status>
                <lastCheckedIn>2023-02-28T07:22:53Z</lastCheckedIn>
                <connectedFrom>10.xx.xx.xx</connectedFrom>
                <chirpStatus>Provisioned</chirpStatus>
                <platform>Windows</platform>
                <activatedModule>AGENT_VM,AGENT_PM,ICS,AGENT_PC,IOC,FIM,AGENT_LC</activatedModule>
                <agentConfiguration/>
                <activationKey>
                    <activationId>4ffcecd6-a1f1-4a0b-ad50-c19168fea23d</activationId>
                    <title>UPDATE1</title>
                </activationKey>
            </agentInfo>
            <netbiosName>alibaba_cloud_2.1903</netbiosName>
            <networkGuid>6b48277c-0742-61c1-82bbcac0f9c4094a</networkGuid>
            <address>10.xx.215.xx</address>
            <trackingMethod>QAGENT</trackingMethod>
            <isDockerHost>false</isDockerHost>
        </HostAsset>
    </data>
</ServiceResponse>      
    

Sample - Search host assets using Azure attributesSample - Search host assets using Azure attributes

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST" --data-binary @- "<qualys_base_url>/qps/rest/2.0/search/am/hostasset" < file.xml Note: "file.xml" contains the request POST data.

Request POST data

<?xml version="1.0" encoding="UTF-8"?> <ServiceRequest>     <filters>         <Criteria field="vmId" operator="EQUALS">399af5dc-c32a-4c40-95a5-c6ed0e786430</Criteria>         <Criteria field="subscriptionId" operator="EQUALS">XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</Criteria>         <Criteria field="state" operator="EQUALS">DELETED</Criteria>     </filters> </ServiceRequest>

XML output

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/2.0/am/hostasset.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>9</count>
    <hasMoreRecords>false</hasMoreRecords>
    <lastId>5693290</lastId>
    <data>
        <HostAsset>
            <id>2584223</id>
            <name>user_john</name>
            <created>2019-03-04T13:12:30Z</created>
            <modified>2019-03-07T13:37:02Z</modified>
            <type>HOST</type>
            <tags>
                <list>
                    <TagSimple>
                        <id>7517812</id>
                        <name>Sample Tag</name>
                    </TagSimple>
                </list>
            </tags>
            <sourceInfo>
                <list>
                    <AzureAssetSourceSimple>
                        <assetId>2545223</assetId>
                        <type>AZURE</type>
                        <firstDiscovered>2019-03-04T13:13:59Z</firstDiscovered>
                        <lastUpdated>2019-05-09T08:51:37Z</lastUpdated>
                        <azureVmTags>
                            <tags>
                                <list>
                                    <AzureTags>
                                        <key>Owner</key>
                                        <value>John</value>
                                    </AzureTags>
                                </list>
                            </tags>
                        </azureVmTags>
                        <name>sample_resource</name>
                        <location>centralindia</location>
                        <vmSize>Standard_B1s</vmSize>
                        <vmId>399af5dc-c32a-4c40-95a5-c6ed0e786430</vmId>
                        <offer>CentOS</offer>
                        <state>SUCCEEDED</state>
                        <state>DELETED</state>
                        <publisher>OpenLogic</publisher>
                        <version>latest</version>
                        <osType>Linux</osType>
                        <subnet>default</subnet>
                        <subscriptionId>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</subscriptionId>
                        <resourceGroupName>sample_resource_group_name</resourceGroupName>
                        <privateIpAddress>172.17.1.5</privateIpAddress>
                    </AzureAssetSourceSimple>
                </list>
            </sourceInfo>
            <qwebHostId>41049</qwebHostId>
            <fqdn>sample_resource_fqdn</fqdn>
            <os>Linux</os>
            <dnsHostName>sample_resource_dns</dnsHostName>
            <trackingMethod>VIRTUAL_MACHINE_ID</trackingMethod>
            <networkInterface>
                <list>
                    <HostAssetInterface>
                        <type>PRIVATE</type>
                        <address>172.16.1.4</address>
                    </HostAssetInterface>
                </list>
            </networkInterface>
            <isDockerHost>false</isDockerHost>
        </HostAsset> ...        
    </data>
</ServiceResponse>

Sample - Search host asset API returns criticality score for a host assetSample - Search host asset API returns criticality score for a host asset

API request

curl -n -u "USERNAME:PASSWORD" -H "content-type: text/xml"-X "POST" -- "<qualys_base_url>/rest/2.0/search/am/hostasset" < file.xml Note: “file.xml” contains the request POST data.

Request POST data

<?xml version="1.0" encoding="UTF-8" ?>
<ServiceRequest>
    <filters>
        <Criteria field="name">
         operator="EQUALS">hkencrtest</Criteria>
    </filters>
</ServiceRequest>

Response

<?xml version="1.0" encoding="UTF-8"?> <ServiceResponse
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/rest/2.0/search/am/hostasset">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <hasMoreRecords>false</hasMoreRecords>
    <data>
        <HostAsset>
            <id>3052446</id>
            <name>hkencrtest</name>
            <created>2020-02-06T09:29:23Z</created>
            <modified>2020-10-27T11:56:50Z</modified>
            <type>HOST</type>
            <tags>
                <list>
                    <TagSimple>
                        <id>13309029</id>
                        <name>test-name-tagk8s</name>
                    </TagSimple>
...
        
                    <name>hkencrtest</name>
                    <location>centralindia</location>
                    <vmSize>Standard_B1ls</vmSize>
                    <vmId>bdb01734-17de-4a8b-a846-1fdc0c4ebd90</vmId>
                    <offer>UbuntuServer</offer>
                    <state>DELETED</state>
                    <publisher>Canonical</publisher>
                    <version>latest</version>
                    <osType>Linux</osType>
                    <subnet>default</subnet>
                    <subscriptionId>9de9e0a7-4f67-4812-917d-2246853844e1</subscriptionId>
                    <resourceGroupName>hktest10</resourceGroupName>
                    <macAddress>00-0D-3A-3E-2A-EE</macAddress>
                    <publicIpAddress>13.71.5.220</publicIpAddress>
                    <privateIpAddress>172.16.0.4</privateIpAddress>
                </AzureAssetSourceSimple>
            </list>
        </sourceInfo>
        <criticalityScore>2</criticalityScore>
        <fqdn>hkencrtest</fqdn>
...      
    

Sample - Searching IBM assets in your accountSample - Searching IBM assets in your account

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST"
--data-binary @-
"<qualys_base_url>/qps/rest/2.0/search/am/hostasset" <
file.xml
Note: "file.xml" contains the request POST data.      
    

Request POST data

<?xml version="1.0" encoding="UTF-8"?>
<ServiceRequest>
    <filters>
        <Criteria field="ibmId" operator="EQUALS">64486457</Criteria>
    </filters>
</ServiceRequest>      
    

XML output

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://qualysapi.qualys.com/qps/xsd/2.0/am/hostasset.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <hasMoreRecords>false</hasMoreRecords>
    <data>
        <HostAsset>
            <id>1940247</id>
            <name>COMW8X86-34-160</name>
            <created>2018-08-22T09:36:57Z</created>
            <modified>2021-11-08T03:48:10Z</modified>
            <type>HOST</type>
            <sourceInfo>
                <list>
                    <IBMAssetSourceSimple>
                        <assetId>1940247</assetId>
                        <type>IBM</type>
                        <ibmId>64486457</ibmId>
                        <location>wdc07</location>
                        <datacenterId>2017603</datacenterId>
                        <deviceName>&quot;sme-centos01.Qualys-
                           Inc.cloud&quot;</deviceName>
                        <publicVlan>1330,1234</publicVlan>
                        <domain>Qualys-Inc.cloud</domain>
                        <privateVlan>1473,1474,1500</privateVlan>
                        <publicIpAddress>10.10.10.111</publicIpAddress>
                        <privateIpAddress>10.10.10.111</privateIpAddress>
                    </IBMAssetSourceSimple>
                    <AssetSource/>
                </list>
            </sourceInfo>
            <qwebHostId>27103</qwebHostId>
            <lastSystemBoot>2018-11-01T18:44:32Z</lastSystemBoot>
            <lastLoggedOnUser>root</lastLoggedOnUser>
            <domain>WORKGROUP</domain>
            <fqdn>sme-win01.Qualys-Inc.cloud.WORKGROUP</fqdn>
            <os>CentOS Linux 7.5.1804</os>
            <dnsHostName>sme-win01.Qualys-Inc.cloud</dnsHostName>
            <agentInfo>
                <agentVersion>2.1.0.494</agentVersion>
                <agentId>6710851f-1d18-4b2a-ac05-ea972e10ebb5</agentId>
                <status>STATUS_ACTIVE</status>
                <lastCheckedIn>2021-11-08T03:48:10Z</lastCheckedIn>
                <connectedFrom>10.10.10.111</connectedFrom>
                <chirpStatus>Inventory Scan Complete</chirpStatus>
                <platform>Windows</platform>
                <activatedModule>AGENT_PC</activatedModule>
                <agentConfiguration>
                    <id>10001</id>
                    <name>Suspend SelfPatch</name>
                </agentConfiguration>
                <activationKey>
                    <activationId>28cf22f0-89a4-459c-b9ae-
                        bc661901c4ff</activationId>
                    <title>Accuracy T34 PC Windows</title>
                </activationKey>
            </agentInfo>
            <address>10.10.10.111</address>
            <trackingMethod>QAGENT</trackingMethod>
            <manufacturer>Xen</manufacturer>
            <model>HVM domU</model>
            <totalMemory>986</totalMemory>
            <timezone>-05:00</timezone>
            <biosDescription>Xen 4.7.5-1.21 08/13/2018</biosDescription>
            <openPort>
                <list>
                    <HostAssetOpenPort>
                        <port>5353</port>
                        <protocol>UDP</protocol>
                    </HostAssetOpenPort>
                    ...
                
                </list>
            </openPort>
            <software>
                <list>
                    <HostAssetSoftware>
                        <name>cronie-anacron</name>
                        <version>1.4.11-19.el7</version>
                    </HostAssetSoftware>
                    <HostAssetSoftware>
                        <name>groff-base</name>
                        <version>1.22.2-8.el7</version>
                    </HostAssetSoftware>
                    ...
                
                </list>
            </software>
            <processor>
                <list>
                    <HostAssetProcessor>
                        <name>Intel(R) Xeon(R) Gold 6130</name>
                        <speed>2100</speed>
                    </HostAssetProcessor>
                </list>
            </processor>
            <volume>
                <list>
                    <HostAssetVolume>
                        <name>/</name>
                        <size>24694149120</size>
                        <free>22382100480</free>
                    </HostAssetVolume>
                    ...
                
                </list>
            </volume>
            <account>
                <list>
                    <HostAssetAccount>
                        <username>root</username>
                    </HostAssetAccount>
                    ...
                
                </list>
            </account>
            <networkInterface>
                <list>
                    <HostAssetInterface>
                        <interfaceName>eth1</interfaceName>
                        <macAddress>06:d2:2b:49:8d:9e</macAddress>
                        <type>LOCAL</type>
                        <address>fe80:0:0:0:4d2:2bff:fe49:8d9e</address>
                        <gatewayAddress>169.61.80.145</gatewayAddress>
                    </HostAssetInterface>
                  ...
                
                </list>
            </networkInterface>
            <isDockerHost>false</isDockerHost>
        </HostAsset>
    </data>
</ServiceResponse>      
    

XSD

<platform API server>/qps/xsd/2.0/am/hostasset.xsd