7. API
Functions overview
Functions provided by the PyRAP API are listed in the table below.
get_status
dic
Gets PyRASP agent status
get_blacklist
lst
Retrieves current blacklisted entries
set_config
dic
Changes PyRASP agent configuration parameters
get_config
dic
Retrieves current PyRASP agent configuration
get_status()
get_status()
The get_status()
function provides core informations about the agent in a dictionnary structure.
Available keys are listed in teh table below.
version
str
Version of the agent
config
str
Type of the running configuration (Default
, Local
, Cloud
)
blacklist
int
Blacklists entries count
xss_loaded
bool
XSS Machine Learning engine enabled
sqli_loaded
bool
SQL Injection Machine Learning engine enabled
get_blacklist()
get_blacklist()
The get_blacklist()
function returns the current balcklist entries of the agent in teh form of a list.
set_config(params)
set_config(params)
The set_config()
function sets running configuration parameters.
Arguments
params
: A dictionary in the form{ '<param_name>': '<param_value>', ... }
SECURITY_CHECKS
parameters must be specified asSECURITY_CHECKS.<check>
ex:{ 'SECURITY_CHECKS.xss': 0 }
Return Value
A dictionnary with 2 keys:
success
: list of params successfully changedfail
: list of params that were not changes
Example
get_config()
get_config()
The get_config()
function collects the full runing configuration of the agent.
Last updated