Python Scripts
Integration using Python Scripts uses a Python script module file that includes functions for each operation and connection details.
Read this chapter to learn more about the functions and global variables used by agtpython .
For older versions of Bravura Security Fabric , there are also alternate versions of the agtpython connector located in the agent\alt directory that are compatible for specific Python versions.
Script files
The Python connector reads a Python script file which defines the functions. The connector refers to functions that you implement in the script for each operation. Your script must be located in the \<instance>\script\ directory on the Bravura Security Fabric server.
A sample, agtpython-simple.py, is located in the samples directory. If you cannot find the sample file, try re-running setup to modify your installation. Sample files are automatically installed with complete (typical) installations. You can select them in custom installations.
Caution
Any sample script should be modified to fit your environment and prevent security exploits.
Writing a script
Operation configuration
In order for agtpython to perform an operation, you must configure the corresponding operation function in your script. You write these functions to provide interaction details between Bravura Security Fabric and the target system.
Additionally, the login and logout operations are executed (if present in the script). The login is executed preceding an operation call. The logout is executed succeeding an operation call.
An operation function includes a cinfo dictionary object that contains the following:
userid The profile ID of the user
fullname The full name of the user
acctid The ID for the account that the user has on this system
newpw The new password (for password reset and create operations
oldpw The old password (for verify operations)
modeluid The template ID for create
groupid The group ID for group operations
groupname The group description for group operations
listattributes A list containing attributes to list and load
attributes A dictionary containing information about attributes to set during create and update operations, in the following general format:
attributes = {'attrName': {'ACTION': 'VALUE'}, {'SEQUENCE': '-1'}, {'VALUE': ["VALUE1", "VALUE2"]}, {'GROUP': '0'} }
The connect() and disconnect() functions also include the cinfo dictionary object with additional variables.
The following built-in variables are available for replacement:
address The target address
adminid Administrator ID
adminpw Administrator password
sysid System account ID
syspw System account password
settings A dictionary containing any additional settings, in the following format:
settings = {'key1': 'value1',' key2': 'value2'}