The proposed implementation of the audit service is to use the existing eventing system, Camel workflow engine, and external triplestore.
The first phase of implementation will be to use the existing event system to emit messages about audit events, process those events with Camel, and creating RDF for events in an external triplestore. The primary goal of this phase is to satisfy the audit service requirements with minimal impact on the repository.
- Make sure that all internal audit events generate JMS messages
- Make sure that generated messages contain enough information to create event RDF
- Create Camel workflow to process messages and create event RDF in an external triplestore
- Propose RDF classes and properties that event RDF should use
- Document recipe for creating event RDF for external events in an external triplestore using SPARQL Update
- Document recipe for disabling deleting event triples from external triplestore
- Document end-to-end recipe for configuring event service
- Verify that all audit service requirements are satisfied
The second phase of the implementation will be to create an optional component for persisting audit information in the repository. The primary goal of this phase is to improve the durability of the audit persistence using the repository.
- Create a REST API endpoint for audit events attached to each resource, which allows creating external events and retrieving all events
- Update the repository to create audit event records in this container for internal events
- Create configurable option to allow or disallow deleting events in the repository
- Make sure that other repository functionality is not impacted by enabling or disabling in-repository audit event persistence
- Document end-to-end recipe for configuring event service with in-repository audit event persistence
Phase 2 Revised
Instead of creating a new REST API, we could simply create a container named, e.g., "audit" within any container. External events could be posted there using the existing LDP API, and we would need to update Fedora 4 to do that automatically for internal events. Much of the machinery needed to do this is already in place as part of the JMS module which currently listens to JCR events emits JMS events for all repository updates. We could either update the JMS module to also create audit nodes, or create a separate module just for listening to JCR events and creating audit nodes.
- A separate module has the advantage of being completely decoupled from the JMS module, which is particularly desirable for an optional module.
- Updating the JMS module has the advantage of being a smaller update to existing code, and making it easier to suppress JMS events related to creating audit nodes.
Following the Audit Service PROV-O vs PREMIS guidelines, a typical event encoded in RDF would look like this:
External events (either directly added to a triplestore or created using the REST API in phase 2), should include the rdf:type audit:ExternalEvent to differentiate them from internal events.
Fixity events will also include the checksum generated: