Stronghold writes audit events as individual JSON objects separated by newlines. Audit log records contain both shared attributes that apply to all API calls and request or response fields that depend on the specific operation.
Audit log records represent:
- API requests received by Stronghold;
- API responses returned by Stronghold.
You can correlate a response record with its matching request by using request.id, which appears in both records.
Top-level record structure
Regardless of record type, the following top-level fields are typically used:
| Attribute | Type | Description |
|---|---|---|
auth | object | Authentication object describing the subject that performed the API call. |
error | string | Error text if the operation failed. Usually omitted for successful requests. |
forwarded_from | string | Host and port of the node that forwarded the request. Present only in matching scenarios. |
request | object | Request object describing request details. |
response | object | Response object. Present in response records. |
time | string | Event time in ISO 8601 format. |
type | string | Record type: request or response. |
Example request record
{
"type": "request",
"time": "2025-06-05T16:10:22.292517Z",
"request": {
"id": "6e3d8a4a-1c4b-4f7e-8d91-9b0df2c7a111"
},
"auth": {
"client_token": "hmac-sha256:..."
},
"error": "..."
}Example response record
{
"type": "response",
"time": "2025-06-05T16:10:22.292639Z",
"request": {
"id": "6e3d8a4a-1c4b-4f7e-8d91-9b0df2c7a111"
},
"response": {
"data": {}
},
"auth": {
"client_token": "hmac-sha256:..."
}
}The auth object
Stronghold includes only relevant authentication attributes in the auth object. For example, unauthenticated requests do not include client_token or accessor, and metadata is omitted if the token has no metadata.
In practice, the auth object most often contains:
accessorclient_tokendisplay_nametoken_typetoken_issue_timetoken_ttlmetadataentity_idpoliciesidentity_policiestoken_policiespolicy_results
These fields help explain which subject executed the request, under which authentication context, and which policies led to the request being allowed.
The request object
The request object describes the technical details of the incoming call. The most important fields are:
idfor the unique request identifier;operationfor the type of operation:create,read,update,delete,list;namespacefor namespace ID and path;pathfor the API path that handled the request;request_urifor the original request URI when it differs frompath;mount_accessor,mount_point,mount_typefor mount metadata;mount_running_version,mount_running_sha256,mount_is_external_pluginfor plugin or builtin engine details;remote_address,remote_portfor client network information;headersfor request headers, if configured for logging;client_id,client_token,client_token_accessorfor client and token identifiers;datafor the request payload;wrap_ttlwhen response wrapping is requested.
A simplified example:
{
"id": "",
"operation": "",
"namespace": {
"id": "",
"path": ""
},
"path": "",
"mount_point": "",
"mount_type": "",
"remote_address": "",
"remote_port": 1234,
"headers": {},
"data": {}
}The response object
The response object describes the result of the API request. It can contain:
authwhen the operation returns a token;headersfor response headers;redirectfor auth backend redirects;warningsfor API warnings;datafor the response payload;secretfor leased secret metadata;wrap_infofor wrapping token properties;mount_class,mount_accessor,mount_point,mount_typefor mount details;mount_running_plugin_version,mount_running_sha256,mount_is_external_pluginfor plugin details.
A simplified example:
{
"data": {},
"headers": {},
"mount_point": "",
"mount_type": "",
"warnings": [""],
"secret": {
"lease_id": ""
},
"wrap_info": {
"token": "",
"ttl": 60
}
}Protection of sensitive data
By default, Stronghold does not store most sensitive string values in plaintext. Instead, they are hashed using HMAC-SHA256 and a salt specific to the audit device.
This means:
- secrets are not written to the log in plaintext;
- values can still be verified later through the audit hash mechanism;
- once an audit device is disabled, its salt is no longer available, so old values can no longer be matched through that device.
Keep in mind that hashing primarily applies to string values received in JSON or returned in JSON. Other types, such as integers and booleans, may still be stored in plaintext.
Practical notes
- The complete audit trail should be built from the union of all enabled audit devices.
- If
filterandexcludeare enabled, a given device stores the already filtered or modified version of the record. - For most engineering tasks, understanding the top-level structure and the
auth,request, andresponseobjects is enough.