Audit | Java SDK
The audit API is designed for recording a trail of application-based user activity in a scalable, tamper-proof log.
Log an entry
log(cloud.pangeacyber.pangea.audit.models.IEvent, cloud.pangeacyber.pangea.audit.models.LogConfig)Create a log entry in the Secure Audit Log.
StandardEvent event = new StandardEvent
.Builder("Hello, World!")
.action("Login")
.actor("Terminal")
.build();
LogConfig config = new LogConfig.Builder().build();
LogResponse response = client.log(event, config);
Log multiple entries
logBulk(cloud.pangeacyber.pangea.audit.models.IEvent[], cloud.pangeacyber.pangea.audit.models.LogConfig)Create multiple log entries in the Secure Audit Log.
StandardEvent event = new StandardEvent
.Builder("Hello, World!")
.action("Login")
.actor("Terminal")
.build();
StandardEvent[] events = {event};
LogConfig config = new LogConfig.Builder().build();
LogBulkResponse response = client.logBulk(events, config);
Log multiple entries asynchronously
logBulkAsync(cloud.pangeacyber.pangea.audit.models.IEvent[], cloud.pangeacyber.pangea.audit.models.LogConfig)Asynchronously create multiple log entries in the Secure Audit Log.
StandardEvent event = new StandardEvent
.Builder("Hello, World!")
.action("Login")
.actor("Terminal")
.build();
StandardEvent[] events = {event};
LogConfig config = new LogConfig.Builder().build();
LogBulkResponse response = client.logBulkAsync(events, config);
Get last root
getRoot()Get last root from Pangea Server
RootResponse response = client.getRoot();
Tamperproof verification
getRoot(int)Returns current root hash and consistency proof.
RootResponse response = client.getRoot(treeSize);
Search
search(cloud.pangeacyber.pangea.audit.requests.SearchRequest, cloud.pangeacyber.pangea.audit.models.SearchConfig)Perform a search of logs according to input param. By default verify logs consistency and events hash and signature.
SearchRequest searchRequest = new SearchRequest
.Builder("message:\"\"").limit(10).build();
SearchConfig searchConfig = new SearchConfig.Builder().build();
SearchResponse response = client.search(searchRequest, searchConfig);
Results of a search
results(cloud.pangeacyber.pangea.audit.requests.ResultRequest, cloud.pangeacyber.pangea.audit.models.SearchConfig)Fetch paginated results of a previously executed search. By default: verifyEvents
is true and verifyConsistency
is false.
ResultRequest request = new ResultRequest
.Builder("pas_sqilrhruwu54uggihqj3aie24wrctakr")
.limit(3)
.offset(0)
.build();
SearchConfig searchConfig = new SearchConfig.Builder().build();
ResultsResponse response = client.results(request, searchConfig);