API audit - RapturePlatform/Rapture GitHub Wiki
The Audit API provides a way to create special logs that contain permanent records of activity in a Rapture system. Internally Rapture uses a system audit log for recording important events that take place in a Rapture environment. Users (or applications) can create their own custom audit logs for the same purpose.
The API provides a way of creating and removing these logs, along with a simple way of recording log entries. A final API call gives the caller the ability to retrieve log entries.
HttpAuditApi auditApi = new HttpAuditApi(loginApi);
void retVal = auditApi.setup(force);retVal = baseAPI.doAudit_Setup(force);Entitlement: /audit/admin
Sets up anything needed for audit to run properly. This should be called from the _startup.rfx script. This call is used internally by Rapture on startup, and is normally called only for debugging purposes.
| Parameter | Type | Description |
|---|---|---|
| force | boolean |
| Type | Description |
|---|---|
| void |
HttpAuditApi auditApi = new HttpAuditApi(loginApi);
void retVal = auditApi.createAuditLog(name, config);retVal = baseAPI.doAudit_CreateAuditLog(name, config);Entitlement: /audit/admin
This method creates a new audit log, given a name and a config string. The config string defines the implementation to be used to store the audit entries.
| Parameter | Type | Description |
|---|---|---|
| name | String | |
| config | String |
| Type | Description |
|---|---|
| void |
HttpAuditApi auditApi = new HttpAuditApi(loginApi);
boolean retVal = auditApi.doesAuditLogExist(logURI);retVal = baseAPI.doAudit_DoesAuditLogExist(logURI);Entitlement: /audit/main
This method checks whether an audit log exists at the specified URI. The log must have been created using createAuditLog.
| Parameter | Type | Description |
|---|---|---|
| logURI | String |
| Type | Description |
|---|---|
| boolean |
HttpAuditApi auditApi = new HttpAuditApi(loginApi);
List<RaptureFolderInfo> retVal = auditApi.getChildren(prefix);retVal = baseAPI.doAudit_GetChildren(prefix);Entitlement: /audit/main
This method searches for audit logs whose name follows the pattern prefix/anything_else/under/here, where prefix is the argument that is passed in.
| Parameter | Type | Description |
|---|---|---|
| prefix | String |
| Type | Description |
|---|---|
| List |
HttpAuditApi auditApi = new HttpAuditApi(loginApi);
void retVal = auditApi.deleteAuditLog(logURI);retVal = baseAPI.doAudit_DeleteAuditLog(logURI);Entitlement: /audit/admin
This method removes a previously created audit log.
| Parameter | Type | Description |
|---|---|---|
| logURI | String |
| Type | Description |
|---|---|
| void |
HttpAuditApi auditApi = new HttpAuditApi(loginApi);
AuditLogConfig retVal = auditApi.getAuditLog(logURI);retVal = baseAPI.doAudit_GetAuditLog(logURI);Entitlement: /audit/admin
This method retrieves the config information for a previously created audit log.
| Parameter | Type | Description |
|---|---|---|
| logURI | String |
| Type | Description |
|---|---|
| AuditLogConfig |
Stores the config information for an audit log.
| Field | Type |
|---|---|
| name | String |
| config | String |
HttpAuditApi auditApi = new HttpAuditApi(loginApi);
void retVal = auditApi.writeAuditEntry(logURI, category, level, message);retVal = baseAPI.doAudit_WriteAuditEntry(logURI, category, level, message);Entitlement: /audit/admin
This method writes an audit entry to the audit log specified by the URI parameter.
| Parameter | Type | Description |
|---|---|---|
| logURI | String | |
| category | String | |
| level | int | |
| message | String |
| Type | Description |
|---|---|
| void |
HttpAuditApi auditApi = new HttpAuditApi(loginApi);
void retVal = auditApi.writeAuditEntryData(logURI, category, level, message, data);retVal = baseAPI.doAudit_WriteAuditEntryData(logURI, category, level, message, data);Entitlement: /audit/admin
This method writes an audit entry to an audit log.
| Parameter | Type | Description |
|---|---|---|
| logURI | String | |
| category | String | |
| level | int | |
| message | String | |
| data | Map<String,Object> |
| Type | Description |
|---|---|
| void |
HttpAuditApi auditApi = new HttpAuditApi(loginApi);
List<AuditLogEntry> retVal = auditApi.getRecentLogEntries(logURI, count);retVal = baseAPI.doAudit_GetRecentLogEntries(logURI, count);Entitlement: /audit/admin
This method retrieves previously registered log entries, given a maximum number of entries to return.
| Parameter | Type | Description |
|---|---|---|
| logURI | String | |
| count | int |
| Type | Description |
|---|---|
| List |
HttpAuditApi auditApi = new HttpAuditApi(loginApi);
List<AuditLogEntry> retVal = auditApi.getEntriesSince(logURI, when);retVal = baseAPI.doAudit_GetEntriesSince(logURI, when);Entitlement: /audit/main
This method retrieves any entries since a given entry was retrieved. The date of this audit entry is used to determine the start point of the query.
| Parameter | Type | Description |
|---|---|---|
| logURI | String | |
| when | AuditLogEntry |
| Type | Description |
|---|---|
| List |
Defines an audit result to be logged.
| Field | Type |
|---|---|
| category | String |
| entryId | String |
| level | int |
| logId | String |
| message | String |
| source | String |
| user | String |
| when | Date |