Skip to content

Notice

This guide is for the original release of AQtive Guard. For the current AQG SaaS platform, go to the AQtive Guard User Guide.

Python application tracer installation

The SandboxAQ Python Tracer is a Python module that logs cryptographic calls made by the Pyca cryptography library. The logged information is formatted for analysis by AQtive Guard.

Requirements

  • Python 3.5 or higher
  • Pyca cryptography library 39.0.x

Download

Two files are provided:

  1. The Python Tracer as a single Python wheel package: sandbox-<VERSION>-py3-none-any.whl.
  2. An integration help tool (a pth file): sandboxaq_python_tracer.pth.

If you’ve purchased the appropriate license, a download link to the tracer should have been sent to you. Visit our support portal if you have questions or need help.

Note

It is possible to install the integration help tool using the Python package without the .pth file.

Installation

There are several ways to install the Python Tracer, depending on your preferred package manager. The following two examples demonstrate how to use pip or Poetry.

Note

Make sure the Python wheel file is either located in the same directory where you’re running the command or is accessible from the current working directory.

pip installation

If your application uses pip, you can install the Python Tracer using the following command:

pip install sandbox-<VERSION>-py3-none-any.whl

Poetry installation

If your application uses Poetry, you can install the Python Tracer using the following commands:

poetry add sandbox-<VERSION>-py3-none-any.whl

and then

poetry install

Test the poetry installation

As a smoke test, you can verify the successful poetry installation by checking your pyproject.toml file, which should contain the following line:

sandbox = {path = sandbox-<VERSION>-py3-none-any.whl}

Install the integration help tool

The sandboxaq_python_tracer.pth file provided needs to be present in the site-packages directory of the Python environment used by the application. This directory’s path is in the sys.path of Python.

Do this using one of the following two methods:

  • Use the tool included in the Python tracer package.
  • Manually copy the .pth file to where you need it.

Use the tool included in the Python tracer package.

The tool included with the Python tracer helps to set up the integration help tool in three ways:

  1. python -m sandboxaq.tool add will check for the location of the site-packages directory and add the necessary file.
  2. python -m sandboxaq.tool check will check for the location of the site-packages directory and either print it or state that it can’t be found.
  3. python -m sandboxaq.tool remove will check for the location of the site-packages directory and remove the file from it.

Important

Before running these commands, make sure that the Python tracer is installed in the current Python environment.

Copy the file manually

The sandboxaq_python_tracer.pth file provided must be present in the site-packages directory of the Python environment used by the application. This directory’s path is in the sys.path of Python.

Here are some examples of site-packages directory location, X.Y representing the Python version used:

  • /usr/local/lib/pythonX.Y/site-packages
  • /home/.../.local/lib/pythonX.Y/site-packages
  • /path/to/venv/lib/pythonX.Y/site-packages