Skip to main content

Audit | Java SDK

The audit API is designed for recording a trail of application-based user activity in a scalable, tamper-proof log.

Creates a new Secure Audit Log API client.

AuditClient(Builder builder)

required parameters

Builder

Response Object

void
 final var config = new Config.Builder(token, domain).build();
 final var client = new AuditClient.Builder(config).build();

Log an entry

log(IEvent event, LogConfig config)

Create a log entry in the Secure Audit Log.

required parameters

IEvent

event to log

LogConfig

Response Object

LogResponse

LogResponse

 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[] events, LogConfig config)

Create multiple log entries in the Secure Audit Log.

required parameters

cloud.pangeacyber.pangea.audit.models.IEvent[]

events to log

LogConfig

Response Object

LogBulkResponse

LogBulkResponse

 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[] events, LogConfig config)

Asynchronously create multiple log entries in the Secure Audit Log.

required parameters

cloud.pangeacyber.pangea.audit.models.IEvent[]

events to log

LogConfig

Response Object

LogBulkResponse

LogBulkResponse

 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

Response Object

RootResponse

RootResponse

 RootResponse response = client.getRoot();

Tamperproof verification

getRoot(int treeSize)

Returns current root hash and consistency proof.

required parameters

int

tree size to get root

Response Object

RootResponse

RootResponse

 RootResponse response = client.getRoot(treeSize);

Download search results

downloadResults(DownloadRequest request)

Get all search results as a compressed (gzip) CSV file.

required parameters

DownloadRequest

Request parameters.

Response Object

DownloadResponse

URL where search results can be downloaded.

 var response = client.downloadResults(
     new DownloadRequest.Builder("pas_[...]")
         .format(DownloadFormat.CSV)
         .build()
 );

Log streaming endpoint

logStream(BaseRequest request)

This API allows 3rd party vendors (like Auth0) to stream events to this endpoint where the structure of the payload varies across different vendors.

required parameters

BaseRequest

Event data. The exact schema of this will vary by vendor.

Response Object

Response

A Pangea response.

 // Extend `BaseRequest` and model what the streaming data looks like.
 public final class LogStreamRequest extends BaseRequest {
 	@JsonProperty("logs")
 	private List<LogStreamEvent> logs;
 }

 // Then later on, log it like so:
 final var input = new LogStreamRequest();
 final var response = await client.logStream(input);
search(SearchRequest request, SearchConfig config)

Perform a search of logs according to input param. By default verify logs consistency and events hash and signature.

required parameters

SearchRequest
SearchConfig

Response Object

SearchResponse

SearchResponse

 SearchRequest searchRequest = new SearchRequest
 	.Builder("message:\"\"").limit(10).build();
 SearchConfig searchConfig = new SearchConfig.Builder().build();

 SearchResponse response = client.search(searchRequest, searchConfig);
results(ResultRequest request, SearchConfig config)

Fetch paginated results of a previously executed search. By default: verifyEvents is true and verifyConsistency is false.

required parameters

ResultRequest
SearchConfig

Response Object

ResultsResponse

ResultsResponse

 ResultRequest request = new ResultRequest
 	.Builder("pas_sqilrhruwu54uggihqj3aie24wrctakr")
 	.limit(3)
 	.offset(0)
 	.build();
 SearchConfig searchConfig = new SearchConfig.Builder().build();

 ResultsResponse response = client.results(request, searchConfig);

Export from the audit log

export(ExportRequest request)

Bulk export of data from the Secure Audit Log, with optional filtering.

required parameters

ExportRequest

Request parameters.

Response Object

Response
 var response = client.export(ExportRequest.builder().verbose(true).build());