Table Of Contents

Previous topic

3. Introduction

Next topic

5. pluginv

4. Getting started

To begin developing with the Plugin SDK the following components are required:

  • working Pipenv tool,

  • working Python 3.6 interpreter,

To build a python virtual environment, the following packages must be installed:

  • libssl-dev

  • libldap2-dev

  • libsasl2-dev

  • libffi-dev

For instance, to install the packages on Ubuntu system, execute the following command:

apt-get install libssl-dev libldap2-dev libsasl2-dev libffi-dev

4.1. Starting from a plugin skeleton

There is a basic AA plugin skeleton on GitHub.com: https://github.com/OneIdentity/safeguard-sessions-plugin-skeleton-aa that can be used as a starting point for the next steps.

4.2. Starting from scratch

If you prefer to start from scratch, create a Pipfile that contains at least these lines:

[packages]

[dev-packages]
oneidentity-safeguard-sessions-plugin-sdk = "*"

[requires]
python_version = "3.6"

4.3. Preparing the python environment

Build a python virtual environment which will be used to develop and test the plugin:

pipenv install -d

This will install the latest version of the Plugin SDK in the virtual environment. If you want to support a previous version of the SDK with your plugin (because you want to use it on an older version of SPS for example), then write that version into the Pipfile. You should only designate the major and minor versions, this way you will receive the bugfixes, but no breaking changes. The fixed version should be the same as in the api field of the MANIFEST file.

[dev-packages]
oneidentity-safeguard-sessions-plugin-sdk = "~=1.4.0"

To find out what version of the SDK is present in the virtual environment, use the pluginv tool.

pipenv run pluginv version-sdk

4.4. Using the python environment

Create the necessary MANIFEST file for the plugin and add a source file, for example main.py. In the api field of the MANIFEST, write the version which is in the Pipfile, if you fixed it, or which has been installed in the environment (see previous section).

The code in main.py is now usable together with the Plugin SDK inside the virtual environment. To build a snapshot plugin ZIP package, execute the following commands:

pipenv run pluginv dist

The resulting file will be in the dist directory, ready for upload to a Safeguard for Privileged Sessions appliance.