QualysPy


NameQualysPy JSON
Version 0.5.0.0 PyPI version JSON
download
home_pageNone
SummaryA Python wrapper for the Qualys API.
upload_time2024-08-23 11:21:07
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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

```shell
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:

```python
from qualyspy.vmdr import VmdrAPI

api = VmdrAPI()
```

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

```python

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:

```python
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.

```python
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]
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "QualysPy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Jordan Barnartt <jbarnart@uwaterloo.ca>",
    "download_url": "https://files.pythonhosted.org/packages/9c/3d/f89cf04eea37c7fd631e3255e23564da22fb0b3f674c00d03afe00c7db35/qualyspy-0.5.0.0.tar.gz",
    "platform": null,
    "description": "# QualysPy\n\nA Python wrapper for the Qualys API.  Qualys data can be interacted with using a Python model,\nloaded into a PostgreSQL database, and queryed from that database with the same model.\n\nThe Python models are intended to be a 1:1 mapping of the objects returned by the Qualys API.\n\nThis is a work in progress.  The currently supported API calls are:\n\n-  VMDR\n    - host_list_detection\n\n## Requirements\n\n- Python >= 3.10\n- A supported version of Linux (tested on Ubuntu 22.04)\n- A supported version of PostgreSQL, if you want to use the ORM features.\n\n## Installation\n\n```shell\npython -m venv .venv\nsource .venv/bin/activate\npip install qualyspy\n```\n\nThen, create a config file to indicate the Qualys API URLS and credentials and, optionally,\nPostgreSQL database information.  See `.qualyspy-example` for an example configuration file.  By\ndefault, QualysPy will search for this file at ~/.qualyspy, but a different file path\ncan be supplied.\n\n## Usage\n\nDocumentation is located at <https://qualyspy.readthedocs.io>.\n\nEach Qualys API has class subclassed from QualysAPIBase.  For example, to connect to the VMDR API:\n\n```python\nfrom qualyspy.vmdr import VmdrAPI\n\napi = VmdrAPI()\n```\n\nThe API object has methods corresponding to the Qualys API's endpoints.\n\n```python\n\nhost_vulns = api.host_list_detection(ids=12345)\n```\n\nTo load the data into a database, use the ORM class corresponding to the API endpoint.  For the\nhost_list_detection endpoint:\n\n```python\nfrom qualyspy.vmdr import HostListDetectionORM\n# Tip: You can pass echo=True to an ORM class to write the SQL commands to stdout\norm = HostListDetectionORM()\norm.load() # This may take some time, depending on how much data there is to load.\n```\n\nFinally, the data can be queryed and will be outputted in the same form as with VmdrAPI.\n\n```python\nfrom qualyspy.models.vmdr.host_list_vm_detection_orm import Host\n\n# Get all hosts from the database\nwith orm.Session(vmdr_orm.engine) as session:\n    stmt = session.query(Host)\n    host_list = vmdr_orm.query(stmt)[0]\n    host = host_list.host[0]\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python wrapper for the Qualys API.",
    "version": "0.5.0.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/JordanBarnartt/qualyspy/issues",
        "Homepage": "https://github.com/JordanBarnartt/qualyspy"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1e28a70065cbf06f987b2d17532e98c0ea49740dd311e592b9a9913f2a4ba992",
                "md5": "b3a4995be3e0eb1f8224c859c67ec6fe",
                "sha256": "5d649ce78a43b7a68b46d948093fbd44343db870c6f31bb51be88b923a25e3b2"
            },
            "downloads": -1,
            "filename": "qualyspy-0.5.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b3a4995be3e0eb1f8224c859c67ec6fe",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 35371,
            "upload_time": "2024-08-23T11:21:05",
            "upload_time_iso_8601": "2024-08-23T11:21:05.921500Z",
            "url": "https://files.pythonhosted.org/packages/1e/28/a70065cbf06f987b2d17532e98c0ea49740dd311e592b9a9913f2a4ba992/qualyspy-0.5.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9c3df89cf04eea37c7fd631e3255e23564da22fb0b3f674c00d03afe00c7db35",
                "md5": "a4a99bd943f92e6fd2685c3f501ea79a",
                "sha256": "70a4e5f7cfcf2ba92a0a43915ff557edcbd3f452ebceedd843eaa4fe4357bd63"
            },
            "downloads": -1,
            "filename": "qualyspy-0.5.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a4a99bd943f92e6fd2685c3f501ea79a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 31471,
            "upload_time": "2024-08-23T11:21:07",
            "upload_time_iso_8601": "2024-08-23T11:21:07.336584Z",
            "url": "https://files.pythonhosted.org/packages/9c/3d/f89cf04eea37c7fd631e3255e23564da22fb0b3f674c00d03afe00c7db35/qualyspy-0.5.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-23 11:21:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "JordanBarnartt",
    "github_project": "qualyspy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "qualyspy"
}
        
Elapsed time: 0.74238s