Auditing SPI

Share

Document Services provides an interface to capture events into an external logging system. The external system could be a simple file, a log file dedicated to logging events,  a database, or complex application meant to consume log events. The custom auditing Service Provider can capture both server as well as client events.

For Auditing SP, you will need to do the following:

  1. Implement the AuditProvider interface
  2. Package the class as a DSC, and deploy it
  3. Enable auditing  through a setting on the Rights Management (RM) Administration Console
    • In case you have any third party dependency, you will have to package that as well in the DSC itself.
    • In case the name of the DSC is changed or removed , you will need to restart the server.
    • Once the properties are set, you can redeploy your DSC for your changes to take effect (without having to restart the server)

Implement the AuditProvider Interface

To log client events, implement the following:

  1. startLogClientEvent
    public void startLogClientEvent(EDCContext context, AuditRecordBO[] entries) throws SDKException {...}
  2. logClientEvent: Every‐time a client event is generated, this API is called. This takes in EDCContext and AuditRecordBO.
    public void logClientEvent(EDCContext context, AuditRecordBO[] entries) throws SDKException {...}

    Note: AuditRecordBO is an array containing the data of the clients by whom the events got generated. For example, entries[i]. getClientIPAddress();

  3. endLogClientEventpublic
    void endLogClientEvent(EDCContext context, AuditRecordBO[] entries) throws SDKException {System.out.println("endLogClientEvent");}

To log server events, implement the following:

  1. StartLogServerEvent
    public void startLogServerEvent(EDCContext context, AuditRecordBO entry) throws SDKException {...}
  2. logServerEvent: This is called for logging server events. This takes in EDCContext and AuditRecordBO.
    public void logServerEvent(EDCContext context, AuditRecordBO entry) throws SDKException {...}
  3. endLogServerEvent:
    public void endLogServerEvent(EDCContext context, AuditRecordBO entry) throws SDKException {...}

Sample code to implement the AuditProvider interface is available in the SampleCode-AuditSPI.zip file.

Implement the AuditProvider Interface

Package the class you created as a DSC.  Use Workbench to deploy it on the Document Server.

Enable external auditing through a setting in the RM Administration Console

  1. In the Rights Management Administration Console, navigate to Configuration –> Server Configuration –> Manual Configuration.
  2. Export the config.xml file.
  3. Open the config.xml file in an editor, and in the SeverSettings node, enter the name of the DSC as value for the key ExternalAuditProvider.
  4. Save and import the config.xml file.
  5. Restart the Document Server for the changes to take effect.

Author: Salma Shaikh
Editor: Ivan David Vaseekaran

Share