Skip to content
Ian Glennon edited this page Jun 7, 2023 · 2 revisions

Welcome to the API_Driven_Migration Wiki!

Anatomy of a migration

Migration of a subscription's data is limited to that data which has been provided by a user to the source subscription. That is, things that you have created within the subscription such as asset groups, scan schedules, asset tags, etc. It does not include data generated by the Qualys platform, such as detected vulnerabilities, asset data, etc. This data cannot be migrated.

The data which can be migrated can, in the main, be automated by making use of the functions contained within this repository. It is for the user to create the scripts which use these functions to perform the migration.

Designing and writing Python scripts for migrations

The code in this repository is intended for use by people with both API and Python skills. If you have neither of these, you should seek advice from on of the many Qualys partner organizations who may be able to offer assistance.

The approach to take when designing scripts which use these functions is to first read the relevant API guides on https://www.qualys.com/documentation/#apis. This will give you greater insight into the calls being made by these functions and help you diagnose any issues.

The methodology is quite simple. You export the data from one subscription, convert, treat, transform or otherwise manipulate this data into a form which can be submitted in an API call to recreate that data in the new subscription, then make those API calls. The modules contained herein are intended to aid in those tasks by providing functions to extract data from one subscription, manipulate/convert/treat/transform the data and then make the API calls using that modified data to another subscription.

This documentation

The reference documentation contained in this Wiki is intended solely for the purpose of describing the purpose of each function library and providing the details on each function, the parameters is requires and the values it returns.

Users are expected to make use of these functions within their own scripts to facilitate subscription migration.

The pages of this Wiki were generated using Sphinx-docs using the docstrings within each function, and converted into Markdown format. As a result, some documentation may be incorrectly formatted or incomplete. Please raise an issue in the Issues section of this repository if you encounter any such pages.

Using the libraries

Each library is implemented as a Python Module. These should be copied into your script's directory and imported by your script

Directory Structure

- MyScript
|-- myscript.py
|-- QualysCommon
    |
    |-- QualysAPI.py

Script example

import QualysCommon.QualysAPI

api = QualysAPI.QualysAPI(args)

OR

from QualysCommon.QualysAPI import QualysAPI

api = QualysAPI(args)

Contributing and reporting bugs

Contributions are welcomed by forking this repository and generating pull requests. Pull requests will be reviewed periodically. Creating a pull request does not mean the request will be accepted.

Bugs can be reported via the Issues section of this repository. While the repository and the code herein are not supported by Qualys, nor any warranty provided for their use, the author does try to keep the repository free from bugs wherever possible. Not all functions contained herein have been tested, so your mileage may vary.

A note about the QualysWAS module

This module has not been tested in any way. Some functions are not implemented at all, others may only be partially implemented. Use of this module is, as with other modules in this repository, as the user's own risk.

Clone this wiki locally