Public methods available in Groovy Script for invocation on
different objects.
Following is a list of public methods available for some objects that can be accessed via Groovy Script. For some methods a brief information is
also presented in the Details column.
Methods for Asset object
S. Return Type Method Signature Details
No.
1 boolean hasTag(String Returns true if the host has tag otherwise returns false if tag is not present on asset or tag itself is not
tagName) there.
2 String getName() Return asset name.
3 DateTime getCreated() Return time when asset is created. Return org.joda.time.DateTime object.
4 DateTime getUpdated() Return last update time. Return org.joda.time.DateTime object.
5 Long getRemoteVersion() -
6 DateTime getTagReevalDate() Return org.joda.time.DateTime object.
7 User getUser() Return com.qualys.portal.application.module.core.domain.user.User object.
8 UserSnapshot getCreatedBy() Return com.qualys.portal.application.module.qualysguard.domain.UserSnapshot object.
9 UserSnapshot getUpdatedBy() Return com.qualys.portal.application.module.qualysguard.domain.UserSnapshot object.
10 List<Long> getTpMatchingQids() -
11 Boolean isDeleted() -
12 Set<AssetTag> getTags() Return set of com.qualys.portal.application.module.asset.domain.asset objects.
13 UUID getNetworkGuid() -
14 Set<Tag> getBannedTags() Return set of com.qualys.portal.application.module.asset.domain.Tag objects.
15 AttributeCollection getAttributes() Mehod return com.qualys.portal.application.module.core.domain.attribute.AttributeCollection object.
16 AssetType getAssetType() Return type of asset. AssetType is an enum. Possible values are:
1. UNKNOWN
2. HOST
3. SCANNER
4. WEBAPP
5. MALWARE_DOMAIN
6. APPLIANCE
Methods of HostAsset object
First check for type of asset using asset.getAssetType()==Asset.AssetType.HOST
S. Return Type Method Signature Details
No.
1 String resultsForQid(Long qid) Returns the vulnerability results for the specified QID on this host, or NULL.
2 boolean hasVulnWithResults(Long qId, Returns true if the host have vulnerability with specified results.
String resultsSearch)
3 boolean hasAnyVuln(List<Integer> qids) Returns true if the host has any of the qids.
4 boolean hasVulnsWithSeverity(Integer... Returns true if the host has vulnerabilities with the severity.
severitys)
5 boolean hasAllPortsOpen(List<Integer> Returns true if the host has ALL the specified ports open (UDP OR TCP).
ports)
6 boolean hasAnyPortsOpen(List<Integer> Returns true if the host has ANY of the specified ports open (TCP OR UDP).
ports)
7 boolean hasSoftwareByName(String Returns true if any of the items in the installed software list have a name that
softwareName) CONTAINS the specified softwareName (case-insensitive).
8 Map<InetAddress, getNicAddresses() Return map of InetAddress and
om.qualys.portal.application.module.asset.domain.asset.NetworkInterfaceAddress
NetworkInterfaceAddress> objects.
9 String getHostName() -
10 Long getUserHostId() -
11 DateTime getDateIgModified() Return org.joda.time.DateTime object.
12 DateTime getDateVulnModified() Return org.joda.time.DateTime object.
13 String getLastLoggedOnUser() -
14 TrackingMethod getTrackingMethod() -
15 String getNetbiosName() -
16 String getNetbiosNetworkId() -
17 String getOperatingSystem() -
18 List<HostAssetInstance> getInstances() Return list
ofcom.qualys.portal.application.module.asset.domain.asset.data.HostAssetInstance
objects.
19 List<HostOpenPort> getOpenPorts() Return list of
com.qualys.portal.application.module.asset.domain.asset.data.HostOpenPort
objects.
20 List<HostService> getServices() Return list of
com.qualys.portal.application.module.asset.domain.asset.data.HostService objects.
21 List<HostVolume> getVolumes() Return list of
com.qualys.portal.application.module.asset.domain.asset.data.HostVolume objects.
22 List<HostProcessor> getProcessors() Return list of
com.qualys.portal.application.module.asset.domain.asset.data.HostProcessor
objects.
23 List<HostAccount> getAccounts() Return list of
com.qualys.portal.application.module.asset.domain.asset.data.HostAccount
objects.
24 List<HostInstanceVuln> getVulns() Return list of
com.qualys.portal.application.module.asset.domain.asset.data.HostInstanceVuln
objects.
25 Set<HostAssetInstance> getInstances() Return list of
com.qualys.portal.application.module.asset.domain.asset.data.HostAssetInstance
objects.
26 Map<Integer,HostInstanceVuln> getVulnMap() Return map of integer and
com.qualys.portal.application.module.asset.domain.asset.data.HostInstanceVuln
objects.
27 Map<Long, IndexedVuln> getIndexedVulnMap() Return map of long and
com.qualys.portal.application.module.asset.domain.asset.IndexedVuln objects.
28 Map<Integer, getInstanceMap() Return map of integer and
HostAssetInstance> com.qualys.portal.application.module.asset.domain.asset.data.HostAssetInstance
objects.
29 DateTime getLastComplianceScanDate() Return org.joda.time.DateTime object.
30 DateTime getLastVmScanDate() Return org.joda.time.DateTime object.
31 DateTime getLastScanDate Return org.joda.time.DateTime object.
32 DateTime getInitializedDate() Return org.joda.time.DateTime object.
33 boolean isInRange(String ipRange) -
34 boolean isInRange(IPv4Range range) -
Methods of ScannerAsset object
First check for type of asset using asset.getAssetType()==Asset.AssetType.SCANNER
Return Type Method Signature Details
1 boolean isExternal() Return TRUE if this is an external scanner.
2 Boolean getIsUpdated() -
Methods of WebApp object
First check for type of asset using asset.getAssetType()==Asset.AssetType.WEBAPP
S. No. Return Type Method Signature Details
1 URL getUrl() -
2 URL getNormalizedUrl() -
3 String[] getUris() -
4 ScannerAsset getDefaultScanner() Return com.qualys.portal.application.module.asset.domain.asset.ScannerAsset object.
5 Boolean getScannerLocked() -
6 String getHeaders() -
7 Boolean getBehaviorSitemapFile() -
8 String getDomains() -
9 Boolean getUseGlobalExclusionLists() Is Web App allowed to use global Exclusion Lists.
10 WebAppComment getLastComment() Return com.qualys.portal.application.module.was.domain.webapp.WebAppComment
object.
11 String getOperatingSystem() Operating system associated to the web application.
12 HttpProxySnapshot getProxy() Return com.qualys.portal.application.module.domain.proxy.HttpProxySnapshot object.
13 boolean isMalwareEnabled() -
14 boolean isMalwareNotificationEnabled() -
15 String getMalwareScheduleTime() -
16 String getMalwareScheduleTimezone() -
17 Integer getMalwareSecurityRisk() -
18 Long getMalwareDomainId() -
19 Long getMalwareTaskId() -
20 int getPort() -
21 String getVhost() -
22 String getStartingUri() -
23 Boolean getHasScreenshot() -
24 Boolean getScannerLocked() -
25 ImmutableList<Tag> getScannerTagsList() Return list of com.qualys.portal.application.module.asset.domain.Tag object.
Methods of HostInstanceVuln object
First check for type of asset using asset.getAssetType()==Asset.AssetType.HOST then get a list of HostInstanceVuln objects using
List<HostInstanceVuln> list = Asset.getVulns();
Following methods can then be applied on any of the HostInstanceVuln objects from the list.
S. Return Type Method Signature Details
No.
1 VulnDef getVuln() Return com.qualys.portal.application.module.vulnoffice.domain.VulnDef object.
2 String getFqdn() -
3 Integer getPort() -
4 Boolean getSsl() -
5 Boolean isFound() If return true means open,reopen or new. If return false means fixed.
6 Boolean getIgnored() -
7 Boolean getDisabled() -
8 DateTime getFirstFoundDate() Return org.joda.time.DateTime object.
9 DateTime getLastFoundDate() Return org.joda.time.DateTime object.
10 DateTime getLastScannedDate() Return org.joda.time.DateTime object. Return the last scan date.
11 DateTime getUpdatedDate() Return org.joda.time.DateTime object.
12 Long getQgUserVulnId() -
13 Integer getCategory() Return type of vulnerability. Possible values are
1 = Potential
2 = Invalid/Deprecated
4 = Confirmed
14 String getFlags() -
15 Boolean getDeleted() -
16 Integer getVulnState() -
17 ScanFinding getScanFinding() Return com.qualys.portal.application.module.scan.domain.ScanFinding object.
18 AbstractScan getScan() Return com.qualys.portal.application.module.scan.domain.AbstractScan object.
19 HostInstanceVulnResult getVulnResult() Return com.qualys.portal.application.module.asset.domain.asset.data.HostInstanceVulnResult
object.
20 Long getQid() -
21 String getResults() -
Methods of VulnDef object
First check for type of asset using asset.getAssetType()==Asset.AssetType.HOST then get a list of HostInstanceVuln objects using
List<HostInstanceVuln> list = Asset.getVulns();
Thereafter, get a VulnDef object on any of the HostInstanceVuln objects using VulnDef vulndef =hostInstanceVuln.getVuln();
S. No. Return Type Method Signature Details
1 Set<VulnPatchDef> getPatches() Return set of com.qualys.portal.application.module.vulnoffice.domain.VulnPatchDef objects.
2 String getCodevuln() -
3 String getType() -
4 Integer getSeverity() Return severity.
5 Integer getRisk() -
6 String getFixType() -
7 Integer getTimeToFix() -
8 String getRemote() -
9 String getLocal() -
10 String getCategory() -
11 String getDomainvuln() -
12 DateTime getDatePublished() Return org.joda.time.DateTime object.
13 DateTime getDateInsert() Return org.joda.time.DateTime object.
14 DateTime getDateDistrib() Return org.joda.time.DateTime object.
15 String getStatus() -
16 String getPopularity() -
17 Integer getVerified() -
18 String getVulnpath() -
19 String getMlVer() -
20 String getVulnsigVer() -
21 String getProperties() Possible return values (single or comma separated) are:
r = remote detection (no authentication required)
v = potential vulnerability
n = windows authentication required
u = Unix authentication required (SSH)
o = oracle authentication required
m = snmp authentication required
e = VMware authentication required
d = db2 authentication required
b = http basic authentication required
h = form authentication required
d = exploitive (dangerous, can take down services, crash, etc)
p = pci-related vulnerability
c = NAC/NAM vulnerability
22 String getOs() -
23 String getService() -
24 String getPort() -
25 String getAccessvector() -
26 String getAccesscomplexity() -
27 String getAuthentication() -
28 String getConfidentialityimpact() -
29 String getImpactbias() -
30 String getIntegrityimpact() -
31 String getAvailabilityimpact() -
32 String getExploitability() -
33 String getRemediationlevel() -
34 String getReportconfidence() -
35 String getCollateraldamagepotential() -
36 String getTargetdistribution() -
37 Float getBasescore() -
38 Float getEnvscore() -
39 String getTemporalscore() -
40 String getStatusqa() -
41 DateTime getDateReleased() Return org.joda.time.DateTime object.
42 DateTime getDateUpdated() Return org.joda.time.DateTime object.