qualysclient.QualysClient¶
- class QualysClient(username=None, password=None)¶
Bases:
objecta simple client for interacting with the Qualys API
Methods
Add IP addresses to the user's subscription.
Cancel a running report in the user’s account.
compliance_control_listcompliance_exception_deletecompliance_exception_listcompliance_exception_requestcompliance_exception_updatecompliance_policy_add_asset_group_idscompliance_policy_add_asset_groupsExport compliance policies from your account to an XML file.
compliance_policy_importcompliance_policy_listcompliance_policy_mergecompliance_policy_set_asset_group_idscompliance_posture_listDownload a saved report in the user’s account
excluded_host_change_historyexcluded_host_listhost_listhost_list_detectionLaunch a report in the user's account.
Launch a vulnerability scorecard report in the user’s Report Share.
List IP addresses in the user account.
View a list of reports in the user’s account when Report Share feature is enabled.
Authenticate to Qualys API
Log out of authenticated sessionn
Update IP addresses in the user's subscription.
- add_ips(**kwargs) requests.models.Response¶
Add IP addresses to the user’s subscription.
Once added they are available for scanning and reporting.
- Returns
Response– Qualys API response contained within request.Response object
- cancel_running_report(id: int, **kwargs) requests.models.Response¶
Cancel a running report in the user’s account.
- Parameters
id (int) – Specifies the report ID of a running report that you want to cancel. The status of the report must be “running”.
- Raises
ParameterValidationError – When Parameter Validation fails
- Returns
Response– Qualys API response contained within request.Response object
- compliance_policy_export(id: int, **kwargs) requests.models.Response¶
Export compliance policies from your account to an XML file.
Service provided controls are exported and you can choose to also export user defined controls. The output also includes an appendix with human readable look-ups for control descriptions, giving you explanation on the various aspects of control description and evaluation.
- download_saved_report(id: int, **kwargs) requests.models.Response¶
Download a saved report in the user’s account
You can download all report types (map, scan, patch, authentication, scorecard, remediation, compliance). This option is available when the Report Share feature is enabled in the user’s subscription.
- launch_report(template_id: int, **kwargs) requests.models.Response¶
Launch a report in the user’s account. Launch a report in the user’s account. The Report Share feature must be enabled in the user’s subscription. When a report is launched with Report Share, the report is run in the background, and the report generation processing does not timeout until the report has completed.
- launch_scorecard(name: str, **kwargs) requests.models.Response¶
Launch a vulnerability scorecard report in the user’s Report Share.
Launch a vulnerability scorecard report in the user’s Report Share. It is not possible to launch any compliance scorecard reports or WAS scorecard reports using this API at this time. When a scorecard report is launched, the report is run in the background, and the report generation processing does not timeout until the report has completed.
- Parameters
name (str) –
(Required) Specifies the scorecard name for the vulnerability scorecard report that you want to launch. This name corresponds to a service-provided scorecard or a user-created scorecard. For a service-provided scorecard, specify one of these names:
Asset Group Vulnerability Report
Ignored Vulnerabilities Report
Most Prevalent Vulnerabilities Report
Most Vulnerable Hosts Report
Patch Report
- Returns
Response– Qualys API response contained within request.Response object
- list_ip(**kwargs) requests.models.Response¶
List IP addresses in the user account. By default, all hosts in the user account are included.
Optional input parameters support filtering the list by IP addresses and host tracking method.
- Returns
Response– Qualys API response contained within request.Response object
- list_reports(**kwargs) requests.models.Response¶
View a list of reports in the user’s account when Report Share feature is enabled.
The report list output includes all report types, including scorecard reports.
- Parameters
**kwargs – supported keywords documented within the Qualys VM/PC API user guide
- Returns
Response– Qualys API response contained within request.Response object
- login(username, password)¶
Authenticate to Qualys API
- logout()¶
Log out of authenticated sessionn
- update_ips(ips: str, **kwargs) requests.models.Response¶
Update IP addresses in the user’s subscription.
- Parameters
ips (str) – (Required) The hosts within the subscription you want to update. IPs must be specified by using the “ips” parameter (using the POST method)
- Returns
Response– Qualys API response contained within request.Response object
Example
ips=10.10.10.200,10.10.23.40