Skip to main content

QualysPy

A Python wrapper for the Qualys API. Qualys data can be interacted with using a Python model, loaded into a PostgreSQL database, and queryed from that database with the same model.

The Python models are intended to be a 1:1 mapping of the objects returned by the Qualys API.

This is a work in progress. The currently supported API calls are:

  • VMDR
    • host_list_detection

Requirements

  • Python >= 3.10
  • A supported version of Linux (tested on Ubuntu 22.04)
  • A supported version of PostgreSQL, if you want to use the ORM features.

Installation

python -m venv .venv
source .venv/bin/activate
pip install qualyspy

Then, create a config file to indicate the Qualys API URLS and credentials and, optionally, PostgreSQL database information. See .qualyspy-example for an example configuration file. By default, QualysPy will search for this file at ~/.qualyspy, but a different file path can be supplied.

Usage

Documentation is located at https://qualyspy.readthedocs.io.

Each Qualys API has class subclassed from QualysAPIBase. For example, to connect to the VMDR API:

from qualyspy.vmdr import VmdrAPI

api = VmdrAPI()

The API object has methods corresponding to the Qualys API's endpoints.

host_vulns = api.host_list_detection(ids=12345)

To load the data into a database, use the ORM class corresponding to the API endpoint. For the host_list_detection endpoint:

from qualyspy.vmdr import HostListDetectionORM
# Tip: You can pass echo=True to an ORM class to write the SQL commands to stdout
orm = HostListDetectionORM()
orm.load() # This may take some time, depending on how much data there is to load.

Finally, the data can be queryed and will be outputted in the same form as with VmdrAPI.

from qualyspy.models.vmdr.host_list_vm_detection_orm import Host

# Get all hosts from the database
with orm.Session(vmdr_orm.engine) as session:
    stmt = session.query(Host)
    host_list = vmdr_orm.query(stmt)[0]
    host = host_list.host[0]

Release files for QualysPy 0.5.10.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for QualysPy 0.5.10.9
File Size Uploaded
qualyspy-0.5.10.9.tar.gz 43.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for QualysPy 0.5.10.9
File Interpreter ABI Platform
qualyspy-0.5.10.9-py3-none-any.whl Python 3 none any Details

Total release size: 92.3 kB

Release files / qualyspy-0.5.10.9.tar.gz

Download URL qualyspy-0.5.10.9.tar.gz
Size 43.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e358264762524495fa38eec9380474dfb2fcdb729af10c8982a711a0e574b072
BLAKE2b-256 checksum
How to use checksums
34c1aa702e688f95a46d5e0eab69666422c7c688a2a3bc62e81b0722b8f81ce0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.9

Release files / qualyspy-0.5.10.9-py3-none-any.whl

Download URL qualyspy-0.5.10.9-py3-none-any.whl
Size 49.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a104b54b3ca412912e8e01c7b6b174fce3dfe640ea58d848e250020de42edc74
BLAKE2b-256 checksum
How to use checksums
8c74ca0bd29829972da42c1b6c19d8faa3097ff7d2e8ee45160b715419416200
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.9

Release history Release notifications | RSS feed

This release

0.5.10.9 This release

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page