Running

In order to run the integration, you need to provide the configuration as a file location or directly as a JSON string.

To run with a configuration file use:

python3 ApiSecurityManager.py -p <path_to_config_file>

To run directly with a configuration JSON use:

python3 ApiSecurityManager.py -c {"the configuration json"}

Note that if no parameter is passed, the default file location is /etc/imperva/cloud-api-security/config/config.json.

You can always run the following to get help information:

python3 ApiSecurityManager.py -h

Status

At the end of the run, the tool returns a numeric status which indicates if the run had errors, or if it was fully successful.
For a fully successful run, a zero value (0) is returned. For any run were an error occurred, a non-zero value is returned.

In addition, a full status report in JSON format is provided. The status report is printed into the log, and if a file path is provided in the configuration JSON (status_path in the logging section), the status report will be written to there with a file named status.json.

The status report JSON structure is as follows:

Field

Description

time

The execution end time (epoch in milliseconds)

has_errors

True if there were errors, otherwise false

apis

An object with three object values - "added", "updated", and "deleted". Each object contains two list - "success" and "error", of APIs according to the action and if it was successful or not

fetchers

An object containing two lists - "success" and "error" of fetchers according to if the tool managed to fetch APIs from them

Getting Help

If you have questions about the library, be sure to check out the source code documentation.
If you still have questions, reach out to me via email at doron.lehmann@imperva.com.

Reporting Bugs

Open a Git Issue and include as much information as possible. If possible, provide sample code that illustrates the problem you're encountering. If you're experiencing a bug on a specific repository only, provide a link to it, if possible. Do not open a Git Issue for help, leave it only for bug reports.