Analysis and Diagnostics

The analysis and Diagnostics module can be used to gather logs from a Verify Identity Access deployment as well as monitor system health and collect resource usage (CPU, memory, disk, network latency).

class pyivia.core.analysisdiagnostics.AnalysisDiagnostics

Object is used to manage and collect log files from Verify Identity Access deployments

application_logs: ApplicationLog

Retrieve log files generated by verify identity access runtime applications.

remote_syslog: RemoteSyslog

Manage remote syslog configuration used by Verify Identity Access.

Application Logs

class pyivia.core.analysis.applicationlog.ApplicationLog(base_url, username, password)
clear_application_logs(paths=[]) Response

Clear one or more log files on an appliance

Parameters:

paths (list of str) – The list of files to clear.

Returns:

The response from verify identity access.

Success can be checked by examining the response.success boolean attribute

Return type:

Response

delete_application_logs(paths=[]) Response

Delete one or more log files on an appliance

Parameters:

paths (list of str) – The list of files to be removed.

Returns:

The response from verify identity access.

Success can be checked by examining the response.success boolean attribute

Return type:

Response

get_application_log(path) Response

Download a log file from an applaince

Parameters:

path (str) – The relative path of the file to be retrieved.

Returns:

The response from verify identity access.

Success can be checked by examining the response.success boolean attribute

If the request is successful the file contents is returned as JSON and can be accessed from the response.json attribute

Return type:

Response

Remote Syslog

class pyivia.core.analysis.remotesyslog.RemoteSyslog(base_url, username, password)
add_server(server=None, port=None, debug=None, protocol=None, format=None, keyfile=None, ca_certificate=None, client_certificate=None, permitted_peers=None, sources=[]) Response

Add a Remote Syslog configuration.

Parameters:
  • server – (str): The IP address or host name of the remote syslog server.

  • port (int) – The port on which the remote syslog server is listening.

  • debug (bool) – Whether the forwarder process will be started in debug mode. All trace messages will be sent to the log file of the remote syslog forwarder.

  • protocol (str) – The protocol which will be used when communicating with the remote syslog server. Valid options include udp, tcp or tls.

  • format (str, optional) – The format of the messages which are forwarded to the rsyslog server. Valid options include rfc-3164 or rfc-5424.

  • keyfile (str, optional) – The name of the key file which contains the SSL certificates used when communicating with the remote syslog server (e.g. pdsrv). This option is required if the protocol is tls.

  • ca_certificate (str, optional) – The label which is used to identify within the SSL key file the CA certificate of the remote syslog server. This option is required if the protocol is tls.

  • client_certificate (str, optional) – The label which is used to identify within the SSL key file the client certificate which will be used during mutual authentication with the remote syslog server.

  • permitted_peers (str, optional) – The subject DN of the remote syslog server. If this policy data is not specified any certificates which have been signed by the CA will be accepted.

  • sources (list dict) –

    The source of the log file entries which will be sent to the remote syslog server. The format of the dictionary is:

    {
         "name": "WebSEAL:default:request.log",
         "tag": "WebSEAL",
         "facility": "local0",
         "severity": "debug"
     }
    

Returns:

The response from verify identity access.

Success can be checked by examining the response.success boolean attribute.

Return type:

Response

delete_policy(uuid) Response

Delete a remote syslog server policy.

Parameters:

uuid – (str): The UUID of the remote syslog server policy to delete.

Returns:

The response from verify identity access.

Success can be checked by examining the response.success boolean attribute.

Return type:

Response

get(source=None)

Get the configuration for the given Remote Syslog source.

Parameters:

source (str) – The name of the log source. It can be either webseal, azn_server, policy_server or runtime_logs.

Returns:

The response from verify identity access.

Success can be checked by examining the response.success boolean attribute.

If the request is successful the remote system logger properties is returned as JSON and can be accessed from the response.json attribute

Return type:

Response

get_facility_names() Response

Get the list of facilities that can be forwarded to a remote server.

Returns:

The response from verify identity access.

Success can be checked by examining the response.success boolean attribute.

Return type:

Response

get_policy(uuid) Response

Get a remote syslog server policy.

Parameters:

uuid – (str): The UUID of the remote syslog server policy to get.

Returns:

The response from verify identity access.

Success can be checked by examining the response.success boolean attribute.

Return type:

Response

list() Response

List the Remote Syslog configuration.

Returns:

The response from verify identity access.

Success can be checked by examining the response.success boolean attribute.

If the request is successful the remote system logger properties are returned as JSON and can be accessed from the response.json attribute

Return type:

Response

update(servers=[]) Response

Update the Remote Syslog configuration.

Parameters:

servers – (list of str): The remote server configuration to use.

Returns:

The response from verify identity access.

Success can be checked by examining the response.success boolean attribute.

Return type:

Response

update_policy(uuid, server=None, port=None, debug=None, protocol=None, format=None, keyfile=None, ca_certificate=None, client_certificate=None, permitted_peers=None, sources=[]) Response

Update a remote syslog forwarding policy.

Parameters:
  • uuid (str) – The unique identifier of the policy to update.

  • server (str) – The remote syslog server address.

  • port (int) – The remote syslog server port.

  • debug (bool) – Whether the forwarder process will be started in debug mode.

  • protocol (str) – The protocol to use for the syslog connection. Valid options include udp, tcp or tls.

  • format (str) – The format of the syslog messages. Valid options include rfc3164, rfc5424 or rfc6587.

  • keyfile (str) – The name of the key file which contains the SSL certificates used when communicating with the remote syslog server

  • ca_certificate (str) – The label which is used to identify within the SSL key file the CA certificate of the remote syslog server.

  • client_certificate (str) – The label which is used to identify within the SSL key file the client certificate which will be used during mutual authentication with the remote syslog server.

  • permitted_peers (list) – The subject DN of the remote syslog server. If this policy data is not specified any certificates which have been signed by the CA will be accepted.

  • sources (list) – The source of the log file entries which will be sent to the remote syslog server.

  • Returns

    Response: The response from verify identity access.

    Success can be checked by examining the response.success boolean attribute.