Search Scans

[POST] /qps/rest/3.0/search/was/wasscan

Returns a list of scans on web applications that are in the user’s scope

Permissions required - User must have WAS module enabled. User account must have these permissions: Access Permission “API Access”. The output includes scans in the user's scope.

Input ParametersInput Parameters

These elements are optional and act as filters. When multiple elements are specified, parameters are combined using a logical AND. Click here for descriptions of <WebApp> elements

The special field=attributes attribute for the Criteria element is used to search custom attributes (see sample below).

Click here for available operators

Parameter

Mandatory

/Optional

Data Type

Description

id

Optional

integer

The scan ID.

name

Optional

text

The scan name.

webApp.name

Optional

text

The name of the web application being scanned.

webApp.id

Optional

integer

The ID of the web application being scanned.

webApp.tags (with operator="NONE")

Optional

integer

The tags associated with the web application being scanned.

webApp.tags.id

Optional

integer

The tag ID assigned to web application  being scanned.

reference

Optional

text

Scan Reference ID.

launchedDate

Optional

date

The date and time when the scan was launched in UTC date/time format (YYYY-MM-DDTHH:MM:SSZ).

type

Optional

keyword

The scan type: VULNERABILITY or DISCOVERY.

mode

Optional

keyword

 The mode of the scan: ONDEMAND, SCHEDULED or API.

status

Optional

keyword

The status of the scan: SUBMITTED, RUNNING, FINISHED, ERROR, CANCELED, PROCESSING.

authStatus

Optional keyword

Indicates the status of the authentication record: NONE, NOT_USED, SUCCESSFUL, FAILED or PARTIAL.

resultsStatus

Optional keyword

The status of the scan: NOT_USED, TO_BE_PROCESSED, NO_HOST_ALIVE, NO_WEB_SERVICE, SERVICE_ERROR, TIME_LIMIT_REACHED, SCAN_INTERNAL_ERROR, SCAN_RESULTS_INVALID, SUCCESSFUL, PROCESSING, TIME_LIMIT_EXCEEDED, SCAN_NOT_LAUNCHED, SCANNER_NOT_AVAILABLE, SUBMITTED, RUNNING, FINISHED, CANCELED, CANCELING, ERROR, DELETED, CANCELED_WITH_RESULTS.

Sample - List running scansSample - List running scans

Let us view a list of all running scans in the user’s account.

API request

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

Request POST data

<ServiceRequest>
    <filters>
        <Criteria field="status" operator="EQUALS">RUNNING</Criteria>
    </filters>
</ServiceRequest>  
    

XML 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/3.0/was/wasscan.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>2</count>
    <hasMoreRecords>false</hasMoreRecords>
    <data>
        <WasScan>
            <id>13101</id>
            <name>
                <![CDATA[Vulnerability Scan - 2017-02-24]]>
            </name>
            <reference>was/1298538355659.20994</reference>
            <type>VULNERABILITY</type>
            <mode>ONDEMAND</mode>
            <profile>
                <id>1072</id>
                <name>
                    <![CDATA[Initial WAS Options]]>
                </name>
            </profile>
            <launchedDate>2017-02-24T10:05:55Z</launchedDate>
            <launchedBy>
                <id>123056</id>
                <username>username</username>
                <firstName>
                    <![CDATA[John]]>
                </firstName>
                <lastName>
                    <![CDATA[Smith]]>
                </lastName>
            </launchedBy>
            <status>RUNNING</status>
        </WasScan>
        <WasScan>
            <id>13102</id>
            <name>
                <![CDATA[Vulnerability Scan - 2017-02-24]]>
            </name>
            <reference>was/1298541157873.20995</reference>
            <type>VULNERABILITY</type>
            <mode>ONDEMAND</mode>
            <profile>
                <id>1072</id>
                <name>
                    <![CDATA[Initial WAS Options]]>
                </name>
            </profile>
            <launchedDate>2017-02-24T10:52:37Z</launchedDate>
            <launchedBy>
                <id>123056</id>
                <username>username</username>
                <firstName>
                    <![CDATA[John]]>
                </firstName>
                <lastName>
                    <![CDATA[Smith]]>
                </lastName>
            </launchedBy>
            <status>RUNNING</status>
        </WasScan>
    </data>
</ServiceResponse>       
    

Sample - List scans with successful authenticationSample - List scans with successful authentication

Let us view a list of scans in the user’s account successfully authenticated to the target web application.

API request

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

Request POST data

<ServiceRequest>
    <filters>
        <Criteria field="authStatus" operator="EQUALS">SUCCESSFUL</Criteria>
    </filters>
</ServiceRequest>          
    

XML 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/3.0/was/wasscan.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>2</count>
    <hasMoreRecords>false</hasMoreRecords>
    <data>
        <WasScan>
            <id>13096</id>
            <name>
                <![CDATA[Web Vulnerability Scan - 2017-02-23]]>
            </name>
            <reference>was/1298475533625.20931</reference>
            <type>VULNERABILITY</type>
            <mode>ONDEMAND</mode>
            <profile>
                <id>1072</id>
                <name>
                    <![CDATA[Initial WAS Options]]>
                </name>
            </profile>
            <launchedDate>2017-02-23T16:38:53Z</launchedDate>
            <launchedBy>
                <id>123056</id>
                <username>username</username>
                <firstName>
                    <![CDATA[John]]>
                </firstName>
                <lastName>
                    <![CDATA[Smith]]>
                </lastName>
            </launchedBy>
            <status>FINISHED</status>
        </WasScan>
        <WasScan>
            <id>13116</id>
            <name>
                <![CDATA[Relaunch Vulnerability Scan - 2017-02-23]]>
            </name>
            <reference>was/1298558684177.21009</reference>
            <type>VULNERABILITY</type>
            <mode>ONDEMAND</mode>
            <profile>
                <id>1072</id>
                <name>
                    <![CDATA[Initial WAS Options]]>
                </name>
            </profile>
            <launchedDate>2017-02-24T15:44:44Z</launchedDate>
            <launchedBy>
                <id>123056</id>
                <username>username</username>
                <firstName>
                    <![CDATA[John]]>
                </firstName>
                <lastName>
                    <![CDATA[Smith]]>
                </lastName>
            </launchedBy>
            <status>FINISHED</status>
        </WasScan>
    </data>
</ServiceResponse>          
    

Sample - List scans for web applications without tagsSample - List scans for web applications without tags

Return a list of scans of web applications that do not have any tags assigned.

API request

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

Request POST data

<ServiceRequest>
    <filters>
        <Criteria field="webApp.tags" operator="NONE"></Criteria>
    </filters>
</ServiceRequest>          
    

XML response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://qualysapi.qualys.com/qps/xsd/3.0/was/wasscan.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <hasMoreRecords>false</hasMoreRecords>
    <data>
        <WasScan>
            <id>2208317</id>
            <name>
                <![CDATA[1538976557822_Scan16]]>
            </name>
            <reference>was/1538976670564.372113</reference>
            <type>VULNERABILITY</type>
            <mode>API</mode>
            <multi>false</multi>
            <target>
                <webApp>
                    <id>1472824</id>
                    <name>
                        <![CDATA[web app 1538976530195]]>
                    </name>
                    <url>
                        <![CDATA[http://10.11.72.39]]>
                    </url>
                </webApp>
                <scannerAppliance>
                    <type>INTERNAL</type>
                    <friendlyName>
                        <![CDATA[John_doe]]>
                    </friendlyName>
                </scannerAppliance>
                <cancelOption>SPECIFIC</cancelOption>
                <randomizeScan>false</randomizeScan>
            </target>
            <profile>
                <id>458470</id>
                <name>
                    <![CDATA[My Option Profile - with defaults 1538976530177]]>
                </name>
            </profile>
            <launchedDate>2018-10-08T05:31:10Z</launchedDate>
            <launchedBy>
                <id>406790</id>
                <username>user_john</username>
                <firstName>
                    <![CDATA[John]]>
                </firstName>
                <lastName>
                    <![CDATA[Doe]]>
                </lastName>
            </launchedBy>
            <status>SUBMITTED</status>
        </WasScan>
    </data>
</ServiceResponse>  
    

Sample - List scans for web applications with tagsSample - List scans for web applications with tags

Return a list of scans of web applications that have certain tags assigned.

API request

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

Request POST data

<ServiceRequest>
    <filters>
        <Criteria field="webApp.tags.id" operator="EQUALS">8158322</Criteria>
    </filters>
</ServiceRequest>          
    

XML 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/3.0/was/wasscan.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <hasMoreRecords>false</hasMoreRecords>
    <data>
        <WasScan>
            <id>2208317</id>
            <name>
                <![CDATA[1538976557822_Scan16]]>
            </name>
            <reference>was/1538976670564.372113</reference>
            <type>VULNERABILITY</type>
            <mode>API</mode>
            <multi>false</multi>
            <target>
                <webApp>
                    <id>1472824</id>
                    <name>
                        <![CDATA[web app 1538976530195]]>
                    </name>
                    <url>
                        <![CDATA[http://10.11.72.39]]>
                    </url>
                </webApp>
                <scannerAppliance>
                    <type>INTERNAL</type>
                    <friendlyName>
                        <![CDATA[John_doe]]>
                    </friendlyName>
                </scannerAppliance>
                <cancelOption>SPECIFIC</cancelOption>
                <randomizeScan>false</randomizeScan>
            </target>
            <profile>
                <id>458470</id>
                <name>
                    <![CDATA[My Option Profile - with defaults 1538976530177]]>
                </name>
            </profile>
            <launchedDate>2018-10-08T05:31:10Z</launchedDate>
            <launchedBy>
                <id>406790</id>
                <username>user_john</username>
                <firstName>
                    <![CDATA[John]]>
                </firstName>
                <lastName>
                    <![CDATA[Doe]]>
                </lastName>
            </launchedBy>
            <status>SUBMITTED</status>
        </WasScan>
    </data>
</ServiceResponse>          
    

Sample - List canceled the scanSample - List canceled the scan

Let us search for the scan with a response showing the user who canceled the scan.

API request

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

Request POST data

<ServiceRequest>
    <filters>
        <Criteria field="id" operator="IN">1447989</Criteria>
    </filters>
</ServiceRequest>          
    

Request POST data

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/3.0/was/scan.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <hasMoreRecords>false</hasMoreRecords>
    <data>
        <WasScan>
            <id>1447989</id>
            <name>
                <![CDATA[My Vulnerability Scan]]>
            </name>
            <reference>was/1446408743390.1856849</reference>
            <type>VULNERABILITY</type>
            <mode>ONDEMAND</mode>
            <multi>false</multi>
            <target>
                <webApp>
                    <id>2431279</id>
                    <name>
                        <![CDATA[127.0.0.1]]>
                    </name>
                    <url>
                        <![CDATA[http://127.0.0.1/]]>
                    </url>
                </webApp>
                <scannerAppliance>
                    <type>EXTERNAL</type>
                </scannerAppliance>
                <cancelOption>SPECIFIC</cancelOption>
            </target>
            <profile>
                <id>28147</id>
                <name>
                    <![CDATA[My Option Profile]]>
                </name>
            </profile>
            <launchedDate>2017-11-01T20:12:23Z</launchedDate>
            <launchedBy>
                <id>2226741</id>
                <username>user_ak1</username>
                <firstName>
                    <![CDATA[Amy]]>
                </firstName>
                <lastName>
                    <![CDATA[Kim]]>
                </lastName>
            </launchedBy>
            <status>CANCELED</status>
            <cancelMode>USER</cancelMode>
            <canceledBy>
                <id>9872437571</id>
                <username>user_bb5</username>
            </canceledBy>
        </WasScan>
    </data>
</ServiceResponse>         
    

XSD

<platform API server>/qps/xsd/3.0/was/wasscan.xsd