Get details of all assets that satisfy the filter criteria to include or exclude specified fields. If you don’t provide a filter parameter, it will show details of all the assets.
Parameter |
Mandatory /Optional |
Data Type |
Description |
---|---|---|---|
excludeFields |
Optional |
string |
Comma separated list of fields to be excluded from the asset object in the response. Default is None. You can choose from the list of fields specified in the Limit your results section. For example, to exclude openPort and software from the response: excludeFields=openPort,software |
includeFields |
Optional |
string |
Comma separated list of fields to be included in the asset object in the response. Default is All. You can choose from the list of fields specified in the Limit your results section. For example, to include only operatingSystem and hardware in the response: includeFields=operatingSystem,hardware |
assetLastUpdated |
Optional |
string |
Shows records updated on or after this date with the UTC format as yyyy-MM-ddTHH:mmZ e.g. 2019-03-01T11:30Z This date gets updated whenever any activity happens on the asset. Few examples of such activity: - Vulnerability Management scan - Policy Compliance scan - Inventory collection - Security Configuration Assessment - CertView scan - AssetView or CloudView connector run - Secure Enterprise Mobility scan - Out-of-Band Configuration Assessment - Asset rename - Purge of VM, PC, OCA, CertView records - Agent manifest download - Asset Inventory asset identification updates |
lastSeenAssetId |
Optional |
integer |
Use to get the list of assets having asset id greater than the specified last seen assetid. You can get a list of a maximum of 100 assets in one API call. If you have more than 100 assets, you need to make multiple API calls to get the list of all your assets. See the following snippet from the Response: Response:
The snippet shows: - lastSeenAssetId: 6920718 It indicates the asset id of the last seen asset. - hasMore: 1 It indicates that there are more assets. If you want to get a list of your all assets, refer to the following example: Example: https://gateway.qg1.apps.qualys.com/rest/2.0/search/am/asset?lastSeenAssetId=6920718 Consider the scenario, wherein you have 1000 assets. In the first API call, you get a list of 100 assets. The asset id of the 100th asset is shown in the lastSeenAssetId parameter. In the 2nd API call, you must enter the asset id of the 100th asset in the lastSeenAssetId parameter to get the list of the next 100 assets. Similarly, in every subsequent API call, you must enter the asset id of the 100th asset in the lastSeenAssetId parameter. Thus, you get the list of your total assets by running 10 API calls. |
pageSize |
Optional |
integer |
The number of records per page to be included in the response. If pageSize is not specified in the request, 100 records will be fetched by default. The maximum value supported for pageSize is 300. |
filter |
Optional |
string |
Filter the events list by providing a filter in json and xml format. Make sure your filter criteria is provided in xml/json format in the request body. If you don’t provide filter parameter, it will show details of all the assets. For more information on supported operators, refer Supported Operators.
For example (json) -
For example (xml) -
|
softwareType |
Optional |
string |
Specify the software type to get the host details for specified software type. Available values for softwareType parameter are Application, Unknown, and Others. |
Authorization |
Mandatory |
string |
Authorization token to authenticate to the Qualys Cloud Platform. Prepend token with "Bearer" and one space. For example - Bearer authToken |
missingSoftware.name |
Mandatory | string |
Provide the missing software name. |
missingSoftware.category1 |
Mandatory | string |
Provide the missing software category 1. |
missingSoftware.category2 |
Mandatory | string |
Provide the missing software category 2. |
missingSoftware.publisher |
Mandatory | string |
Provide the missing software publisher. |
missingSoftware.product |
Mandatory | string |
Provide the missing software product. |
API Request (without filter)
curl -X POST
-H "Accept: application/json"
-H "Authorization: Bearer <JWTToken>"
-H "Content-Type: application/json" -i
"<qualys_base_url>/rest/2.0/search/am/asset"
Request (with filter - XML)
curl -X POST -H "Accept: application/xml"
-H "Authorization: Bearer <JWTToken>"
-H "Content-Type: application/xml" -i
"<qualys_base_url>/rest/2.0/search/am/asset" filter.xml
Request (with filter - JSON)
"curl -X POST -H "Accept: application/json"
-H "Authorization: Bearer <JWTToken>"
-H "Content-Type: application/json"
-i "<qualys_base_url>/rest/2.0/search/am/asset" filter.json
Here", "filter.json file is the request in json format."
Request body in XML format (filter.xml)
<FilterRequest>
<filters>
<Criteria field="operatingSystem.category1" operator="EQUALS">
<value>Mac</value>
</Criteria>
</filters>
</FilterRequest>
Request body in JSON format (filter.json)
{
"filters":[
{
"field":"operatingSystem.category1",
"operator":"EQUALS",
"value":"Mac"
}
]
Response
{
"responseMessage":"Valid API Access",
"count":1,
"responseCode":"SUCCESS",
"lastSeenAssetId":6920718,
"hasMore":1,
"assetListData":{
"asset":[
{
"assetId":6920718,
"assetUUID":"50d20290-c66a-42e7-8c0a-ba6e92b6324c",
"hostId":1437386,
"lastModifiedDate":"2021-04-06T10:02:33.000Z",
"agentId":null,
"createdDate":"2020-11-25T12:49:25.000Z",
"sensorLastUpdatedDate":"2021-04-06T10:02:33.000Z",
"assetType":"HOST",
"address":"10.115.110.95",
"dnsName":"localhost.localdomain",
"assetName":"localhost.localdomain",
"netbiosName":null,
"timeZone":"IST",
"biosDescription":null,
"lastBoot":null,
"totalMemory":5806,
"cpuCount":null,
"lastLoggedOnUser":"root",
"hwUUID":"422a2b16-4c8b-588a-a20c-c1851ad7e376",
"biosSerialNumber":"VMware-42 2a 2b 16 4c 8b 58 8a-a2 0c c1 85 1a d7 e3 76",
"biosAssetTag":"No Asset Tag",
"isContainerHost":false,
"operatingSystem":{
"osName":"The CentOS Project CentOS 7 (1810)",
"fullName":"The CentOS Project CentOS 7 (1810)",
"category":"Linux / Server",
"category1":"Linux",
"category2":"Server",
"productName":"CentOS",
"publisher":"The CentOS Project",
"edition":null,
"marketVersion":"7",
"version":"1810",
"update":null,
"architecture":null,
"lifecycle":{
"gaDate":"2018-12-03T00:00:00.000Z",
"eolDate":"2020-12-31T00:00:00.000Z",
"eosDate":"2024-06-30T00:00:00.000Z",
"stage":"EOL",
"lifeCycleConfidence":"Exact",
"eolSupportStage":"Full updates",
"eosSupportStage":"Maintenance Updates"
},
"taxonomy":{
"id":null,
"name":"Linux / Server",
"category1":"Linux",
"category2":"Server"
},
"productUrl":"https://www.centos.org/,https://en.wikipedia.org/wiki/CentOS,",
"productFamily":null,
"installDate":null,
"release":"7.4.1708"
},
"hardware":{
"fullName":"VMware VMware Virtual Platform VMware Virtual Platform",
"category":"Virtualized / Virtual Machine",
"category1":"Virtualized",
"category2":"Virtual Machine",
"manufacturer":"VMware",
"productName":"VMware Virtual Platform",
"model":"VMware Virtual Platform",
"lifecycle":{
"introDate":null,
"gaDate":null,
"eosDate":null,
"obsoleteDate":null,
"stage":"Unknown",
"lifeCycleConfidence":" "
},
"taxonomy":{
"id":null,
"name":"Virtualized / Virtual Machine",
"category1":"Virtualized",
"category2":"Virtual Machine"
},
"productUrl":"https://www.linuxjournal.com/article/3458,,",
"productFamily":null
},
"userAccountListData":null,
"openPortListData":{
"openPort":[
{
"port":709,
"description":"",
"protocol":"UDP",
"detectedService":"portmap/rpcbind",
"firstFound":"2020-11-25T12:46:42.000Z",
"lastUpdated":"2020-11-25T12:46:42.000Z"
},
{
"port":50000,
"description":"",
"protocol":"TCP",
"detectedService":"IBM_DB2_Universal_Database",
"firstFound":"2020-11-25T12:46:42.000Z",
"lastUpdated":"2020-11-25T12:46:42.000Z"
},
{
"port":6000,
"description":"",
"protocol":"TCP",
"detectedService":"x11",
"firstFound":"2020-11-25T12:46:42.000Z",
"lastUpdated":"2020-11-25T12:46:42.000Z"
},
{
"port":22,
"description":"",
"protocol":"TCP",
"detectedService":"ssh",
"firstFound":"2020-11-25T12:46:41.000Z",
"lastUpdated":"2020-11-25T12:46:41.000Z"
},
{
"port":3389,
"description":"",
"protocol":"TCP",
"detectedService":null,
"firstFound":"2020-11-25T12:46:42.000Z",
"lastUpdated":"2020-11-25T12:46:42.000Z"
},
{
"port":111,
"description":"",
"protocol":"UDP",
"detectedService":"rpc_udp",
"firstFound":"2020-11-25T12:46:42.000Z",
"lastUpdated":"2020-11-25T12:46:42.000Z"
},
{
"port":111,
"description":"",
"protocol":"TCP",
"detectedService":"rpc",
"firstFound":"2020-11-25T12:46:41.000Z",
"lastUpdated":"2020-11-25T12:46:41.000Z"
}
]
},
"volumeListData":{
"volume":[
{
"name":"tmpfs",
"free":2737078272,
"size":3043934208
},
{
"name":"/dev/mapper/centos-home",
"free":18629619712,
"size":18700304384
},
{
"name":"devtmpfs",
"free":3026444288,
"size":3026444288
},
{
"name":"/dev/mapper/centos-root",
"free":19672580096,
"size":38304645120
},
{
"name":"/dev/sda1",
"free":876040192,
"size":1063256064
}
]
},
"networkInterfaceListData":{
"networkInterface":[
{
"hostname":"localhost.localdomain",
"addressIpV4":"192.168.122.1",
"addressIpV6":null,
"macAddress":"52:54:00:77:e1:71",
"interfaceName":"virbr0",
"dnsAddress":null,
"gatewayAddress":"",
"manufacturer":null,
"macVendorIntroDate":null,
"addresses":null
},
{
"hostname":"localhost.localdomain",
"addressIpV4":"10.115.110.95",
"addressIpV6":"fe80:0:0:0:250:56ff:feaa:e2da",
"macAddress":"00:50:56:aa:e2:da",
"interfaceName":"ens192",
"dnsAddress":null,
"gatewayAddress":"",
"manufacturer":"VMware",
"macVendorIntroDate":946944000000,
"addresses":null
}
]
},
"softwareListData":{
"software":[
{
"id":-5698725809391962787,
"fullName":"Python 2.7.5 64-Bit",
"softwareType":"Application",
"isIgnored":false,
"ignoredReason":null,
"category":"Application Development / Programming Languages",
"category1":"Application Development",
"category2":"Programming Languages",
"productName":"Python",
"component":null,
"publisher":"Python",
"edition":null,
"marketVersion":"2",
"version":"2.7",
"update":"2.7.5",
"architecture":"64-Bit",
"installDate":"2020-03-27T16:11:47.000Z",
"installPath":null,
"lastUpdated":"2020-11-25T12:46:46.000Z",
"lastUseDate":null,
"language":null,
"formerlyKnownAs":null,
"isPackage":false,
"isPackageComponent":false,
"packageName":null,
"productUrl":"https://en.wikipedia.org/wiki/History_of_Python,,",
"lifecycle":{
"gaDate":"2010-07-03T00:00:00.000Z",
"eolDate":"2020-01-01T00:00:00.000Z",
"eosDate":"2020-01-01T00:00:00.000Z",
"stage":"EOL/EOS",
"lifeCycleConfidence":"Exact",
"eolSupportStage":"End-of-life",
"eosSupportStage":"End-of-life"
},
"supportStageDesc":"Python's policy is to drop support major versions once they reach their end of life",
"license":{
"category":"Open Source",
"subcategory":"Python License (Python-2.0)"
},
"authorization":"Authorized"
},
{
"id":9136542396418607016,
"fullName":"OpenBSD OpenSSH Server 7.4p1",
"softwareType":"Application",
"isIgnored":false,
"ignoredReason":null,
"category":"Networking / Access Software",
"category1":"Networking",
"category2":"Access Software",
"productName":"OpenSSH",
"component":"Server",
"publisher":"OpenBSD",
"edition":null,
"marketVersion":"7",
"version":"7.4",
"update":"7.4p1",
"architecture":null,
"installDate":"2020-03-05T14:23:53.000Z",
"installPath":null,
"lastUpdated":"2020-11-25T12:46:53.000Z",
"lastUseDate":null,
"language":null,
"formerlyKnownAs":"OpenBSD Secure Shell",
"isPackage":true,
"isPackageComponent":false,
"packageName":null,
"productUrl":"https://en.wikipedia.org/wiki/OpenSSH,,",
"lifecycle":{
"gaDate":"2016-12-19T00:00:00.000Z",
"eolDate":null,
"eosDate":null,
"stage":"EOL",
"lifeCycleConfidence":"Calculated",
"eolSupportStage":" ",
"eosSupportStage":" "
},
"supportStageDesc":null,
"license":{
"category":"Open Source",
"subcategory":"BSD 2-Clause License (FreeBSD/Simplified)"
},
"authorization":"Authorized"
}
]
},
"provider":null,
"cloudProvider":null,
"agent":null,
"sensor":{
"activatedForModules":[
"VM"
],
"pendingActivationForModules":[
],
"lastVMScan":1606306572000,
"lastComplianceScan":0,
"lastFullScan":1606306572000
},
"container":null,
"inventory":{
"source":"IP",
"created":1606308565000,
"lastUpdated":1617703353000
},
"activity":null,
"tagList":{
"tag":[
{
"tagId":14151022,
"tagName":"static split",
"foregroundColor":0,
"backgroundColor":-65536,
"businessImpact":null,
"criticalityScore":3
}
]
},
"serviceList":null,
"lastLocation":null,
"criticality":{
"score":2,
"isDefault":true,
"lastUpdated":"2021-06-30T09:43:27.000Z"
},
"businessInformation":{
"company":"Qualys",
"department":"Engineering",
"ownedBy":"Paul",
"environment":"QA",
"managedBy":"Amit",
"supportedBy":"Nick",
"supportGroup":"ABC_01",
"operationalStatus":"Blocked"
},
"assignedLocation":{
"name":"4492 Camino De La Plaza, Pune,IN",
"city":"Pune",
"state":"MH",
"country":"IN"
},
"businessAppListData":{
"businessApp":[
{
"id":"BARCODE283904",
"name":"Quoting App",
"environment":"Production",
"businessCriticality":"2 - Less Critical",
"managedBy":"Amit",
"ownedBy":"Narendra",
"supportedBy":"Rishabh",
"supportGroup":"SME Operations",
"operationalStatus":"Mended",
"status":"Installed",
"usedFor":"Production"
},
{
"id":"BARCODE2839067gfh",
"name":"HRA",
"environment":"Production",
"businessCriticality":"1 - Most Critical",
"managedBy":"Amit",
"ownedBy":"Narendra",
"supportedBy":"Rishabh",
"supportGroup":"SME Operations",
"operationalStatus":"broken",
"status":"Installed",
"usedFor":"Production"
}
]
},
"riskScore":690,
"passiveSensor":null,
"asn":"AS27385",
"isp":"Qualys, Inc.",
"domain":[
"qualys.com",
"qualys.in"
],
"subdomain":[
"docs.qualys.com",
"www.qualys.com"
],
"whois":[
{
"domain":"vulnerability-management.com",
"createdDate":null,
"dnssec":null,
"domainStatus":"clientTransferProhibited",
"registrantOrganization":"Qualys, Inc.",
"registrantName":null,
"registrantEmail":"6d229c2ef8870a654745766aab8e6ace-49101@contact.gandi.net",
"registrantContact":null,
"registrar":"Gandi SAS",
"organizationName":"Qualys, Inc.",
"updatedDate":null
}"missingSoftware":null,
"customAttributes":[
{
"key":"Media State4",
"value":"Media disconnected",
"connectorName":"Qualys"
},
{
"key":"Default Gateway11",
"value":"192.168.1.1",
"connectorName":"Qualys"
},
"..."{
"key":"Subnet Mask",
"value":"255.255.255.0",
"connectorName":"Qualys"
},
"..."
],
"processor":null
}
]
}
}
API Request
curl --location --request POST
'<qualys_base_url>/rest/2.0/search/am/asset'
--header 'Authorization: Bearer <JWT Token>'
--header 'Content-Type: application/xml'
--data-raw '<FilterRequest>'
API Request: Get Software Instances Details from the Asset by AssetID
curl --location --request GET
'<qualys_base_url>/rest/2.0/search/am/asset?assetId=29003737&pageSize=1'
--header 'Authorization: Bearer <JWT Token>'
--header 'Content-Type: application/xml'
--data-raw ''
Filter Request Sample (XML format):
<FilterRequest>
<filters>
<criteria field="software.hasRunningInstance" operator="EQUALS">
<value>true</value>
</criteria>
</filters>
</FilterRequest>
Response
{
"responseMessage": "Valid API Access",
"count": 1,
"responseCode": "SUCCESS",
"lastSeenAssetId": 40006682,
"hasMore": 1,
"assetListData": {
"asset": [
{
"assetId": 40006682,
...
"softwareListData": {
"software": [
...{
"id": -4649343832335530267,
"discoverySources": null,
"fullName": "Apache HTTP Server 2.4.38",
"softwareType": "Application",
...
"productUrl":
"https://httpd.apache.org/,https://access.redhat.com/errata/RHBA2018:1891,",
"lifecycle": {
"gaDate": "2005-12-01T00:00:00.000Z",
"eolDate": "Not Announced",
"eosDate": "Not Announced",
"stage": "GA",
"lifeCycleConfidence": "Exact",
"eolSupportStage": "Not Announced",
"eosSupportStage": "Not Announced",
"detectionScore": 46
},
"supportStageDesc": null,
"license": {
"category": "Open Source",
"subcategory": "Apache License 2.0 (Apache2.0)"
},
"authorization": null,
"discoveredPublisher": null,
"discoveredName": "apache2",
"discoveredVersion": "2.4.38-3+deb10u3",
"authorizationDetectionScore": null,
"cpeId": 31566331,
"cpe":
"cpe:2.3:a:apache:http_server:2.4.38:*:*:*:*:*:*:*",
"cpeType": "NIST",
"softwareInstances": [
{
"firstSeen": "2022-11-06T03:10:40.000Z",
"lastSeen": "2022-12-12T12:52:28.000Z",
"BIN_PATH": "/usr/sbin/apache2",
"PRODUCT": "Apache",
"ServerRoot": "/etc/apache2",
"CONF_PATH": "/etc/apache2/apache2.conf"
}
]
},
]
}
}
]
}
}
API Request (with filter)
curl --location --request POST
'<qualys_base_url>/rest/2.0/search/am/asset'
--header 'Authorization: Bearer <JWT Token>'
--header 'Content-Type: application/xml'
--data
'<FilterRequest>'
Request Body
<filters>
<Criteria field="easm.tags.name"
operator="EQUALS"><value>cloud</value></Criteria>
</filters>
</FilterRequest>'
API Response
{
"responseMessage": "Valid API Access",
"count": 1,
"responseCode": "SUCCESS",
"lastSeenAssetId": 22303132,
"hasMore": 1,
"assetListData": {
"asset": [
{
"assetId": 22303132,
"assetUUID": "c966xxxx-dcb4-xx65-94ce-7xxxe60ca697",
"hostId": null,
...
"missingSoftware": null,
"whois": [
{
"domain": "totalcloud.io",
...
}
],
"isp": "Amazon.com, Inc.",
"asn": "AS16509",
"easmTags": [
"cloud",
"cdn"
],
"hostingCategory1": "Unknown",
"customAttributes": null,
"processor": null
}
]
}
}
API Request (with filter)
curl --location --request POST
'<qualys_base_url>/rest/2.0/search/am/asset?=null'
--header 'Authorization: Bearer <JWT Token>'
--header 'Content-Type: application/xml'
--data ''
Response
{ "responseMessage": "Valid API Access", "count": 1, "responseCode": "SUCCESS", "lastSeenAssetId": 22303132, "hasMore": 1, "assetListData": { "asset": [ { "assetId": 22303132, "assetUUID": "c9xx9134-dcxx-4e65-9xxe-xxx3e60ca697", "hostId": null, "lastModifiedDate": "2023-03-13T11:11:49.000Z", "agentId": null, ... "missingSoftware": null, "whois": [ { "domain": "totalcloud.io", "createdDate": "2016-02-01T00:00:00.000Z", "dnssec": null, ... } ], "isp": "Amazon.com, Inc.", "asn": "AS16509", "easmTags": [ "cloud", "cdn" ], "hostingCategory1": "Unknown", "customAttributes": null, "processor": null } ] } }
API Request
curl --location --request POST
'<qualys_base_url>/rest/2.0/search/am/asset?=null' \
--header 'Content-Type: application/xml' \
--header 'Authorization: Bearer <JWT_Token>' \
--data '<FilterRequest>
<filters>
<Criteria field="asset.type" operator="EQUALS"><value>SCANNER</value></Criteria>
</filters>
</FilterRequest>'
API Response
{
"responseMessage": "Valid API Access",
"count": 7,
"responseCode": "SUCCESS",
"lastSeenAssetId": 32377802,
"hasMore": 0,
"assetListData": {
"asset": [
{
"assetId": 16587699,
"assetUUID": "b516ea66-6921-9451-e053-2a4f2c0a1522",
"hostId": null,
"lastModifiedDate": "2024-09-17T05:27:06.000Z",
"agentId": null,
"createdDate": "2020-11-27T12:36:55.000Z",
"sensorLastUpdatedDate": "2024-09-17T05:27:06.000Z",
"assetType": "SCANNER",
"address": null,
"dnsName": null,
"assetName": "POD04-Scanner",
"netbiosName": null,
"timeZone": null,
"biosDescription": null,
"lastBoot": null,
"totalMemory": null,
"cpuCount": null,
"lastLoggedOnUser": null,
"domainRole": null,
"hwUUID": null,
"biosSerialNumber": null,
"biosAssetTag": null,
"isContainerHost": null,
"operatingSystem": null,
"hardware": null,
"userAccountListData": null,
"openPortListData": null,
"volumeListData": null,
"networkInterfaceListData": null,
"softwareListData": null,
"softwareComponent": null,
"provider": null,
"cloudProvider": null,
"agent": null,
"sensor": null,
"container": null,
"inventory": null,
"activity": null,
"tagList": {
"tag": [
{
"tagId": 134046247,
"tagName": "BU-specAG11",
"foregroundColor": 0,
"backgroundColor": 0,
"businessImpact": null,
"criticalityScore": null
},
{
"tagId": 142628002,
"tagName": "testscan1",
"foregroundColor": 0,
"backgroundColor": 0,
"businessImpact": null,
"criticalityScore": null
},
]
},
"serviceList": null,
"lastLocation": null,
"criticality": null,
"businessInformation": null,
"assignedLocation": null,
"businessAppListData": null,
"riskScore": null,
"passiveSensor": null,
"domain": null,
"subdomain": null,
"missingSoftware": null,
"whois": null,
"organizationName": null,
"isp": null,
"asn": null,
"easmTags": null,
"hostingCategory1": null,
"customAttributes": null,
"processor": null
},
]
}
}