# Audit logging

Ripple Custody (Wallet) can stream audit records of API and console requests, and of transaction and wallet lifecycle events, to an **AWS Data Firehose** delivery stream for compliance reporting, incident investigation, and access review. Owners and administrators configure the Firehose connection and manage audit log delivery. AWS Firehose is currently the only supported delivery target; customers on other clouds must ingest from Firehose into their own platform.

This page explains what audit logs capture and how to set up delivery. For IAM policy JSON, the record schema, decode examples, and example payloads, see the [Firehose audit log reference](/pt-br/products/wallet/integrations-and-monitoring/audit-logging/firehose-audit-log-reference).

## What audit logs capture

Audit logs record authenticated requests to the API and the console, plus lifecycle events for transactions and wallets. They include:

- Authenticated API calls, with request details and the response status code and length
- Web console requests, such as setting changes and approvals. Sign-ins aren't recorded, only the authenticated requests that follow.
- Transaction lifecycle events: each step from request through policy check and approvals, signing, and publishing, plus the final outcome (confirmed, failed, or rejected)
- Administrative actions (user management, device management, quorum operations)
- Timestamps, and the identity of the user or API credential that made each request. Requests that Ripple support makes during a support session in your organization are recorded without a user ID. On transaction and wallet lifecycle records, the user is the one who created the transaction or wallet, not the one who caused the status change.
- Wallet lifecycle events: wallet and key provisioning, and whether each attempt succeeded or failed


Requests that fail authentication or are rate limited, and the credential token exchange request, aren't recorded. If Ripple Custody (Wallet) can't publish an access record, it loses that record.

Ripple Custody (Wallet) captures request bodies up to 10 MiB and stores them base64-encoded inside the payload. A record must stay below 1,000,000 bytes, so Ripple Custody (Wallet) delivers an oversize access record with `request.body` cleared. It never logs the `Authorization` header or response bodies: records carry a truncated hash of the `Authorization` value and the response body's length instead.

## How it works

Ripple Custody (Wallet) streams audit log events to an **AWS Data Firehose delivery stream** in your AWS account. From there, you route the logs to your preferred destination:

- **Amazon S3** — for long-term storage and compliance archiving
- **Splunk, Datadog, or another SIEM** — for real-time monitoring and alerting
- **Amazon Redshift or Elasticsearch** — for search and analysis


Ripple Custody (Wallet) checks for new logs every 15 seconds and delivers them in batches. Delivery is at least once: after a failed batch, Ripple Custody (Wallet) re-sends from its last checkpoint, so deduplicate records by `id`.

## Prerequisites

Before you begin, set up the following in your AWS account:

- An **AWS Data Firehose delivery stream** configured with your preferred destination (S3, Splunk, etc.)
- An **IAM role** that Ripple can assume to write to the Firehose stream


## Configure the Firehose connection via the console

**Required role:** Owner or Administrator.

1. Go to **Settings** > **Audit logs**. The **Audit log configuration** page opens.
2. Enter the **Stream name** — the exact name of your Firehose delivery stream (up to 64 characters).
3. Enter the **ARN ID** — the IAM role ARN that Ripple assumes to write to Firehose. The ARN must be in the standard `aws` partition and have the form `arn:aws:iam::<account-id>:role/<role-name>`, with no path in the role name. You can't use an AWS GovCloud (US) or China role, even though the **AWS Region** list includes those Regions.
4. Select the **AWS Region** that contains your Firehose stream.
5. Select **Save**.


Each organization has one Firehose configuration. If you save again, Ripple Custody (Wallet) replaces the stream name, AWS Region, and role ARN instead of adding a destination.

### IAM role setup

Create an IAM role with:

- A **trust policy** that allows Ripple's AWS account to assume the role. Ripple Custody (Wallet) doesn't send an external ID, so the trust policy can't require an `sts:ExternalId` condition.
- A **permission policy** that grants `firehose:PutRecordBatch` on your delivery stream. Ripple Custody (Wallet) also calls `sts:GetCallerIdentity`, but AWS requires no permission for it.


See [Firehose audit log reference](/pt-br/products/wallet/integrations-and-monitoring/audit-logging/firehose-audit-log-reference) for the full IAM trust and permission policy JSON, including the Ripple AWS account IDs.

## Enable and disable audit logging via the console

**Required role:** Owner or Administrator.

Saving the Firehose connection starts streaming. Ripple Custody (Wallet) validates the configuration by sending a test record to your stream, sets its status to **Pending**, and changes it to **Enabled** after the first successful delivery. If Ripple Custody (Wallet) can't deliver the test record, the save fails and it stores nothing, so create the IAM role and trust policy first. See the [Firehose audit log reference](/pt-br/products/wallet/integrations-and-monitoring/audit-logging/firehose-audit-log-reference#how-it-works). The first time you save, Ripple Custody (Wallet) delivers your organization's entire stored audit history, 500 records at a time, not only events from that point on.

To temporarily stop streaming, go to **Settings** > **Audit logs**, open the actions menu on the audit log configuration, and select **Disable**. Ripple Custody (Wallet) preserves the configuration so you can re-enable it at any time. To resume streaming, select **Enable** from the same menu. The menu offers **Disable** only for an enabled configuration and **Enable** only for a disabled one. A configuration that is still **Pending** offers only **Edit**.

If delivery fails on 10 consecutive cycles, Ripple Custody (Wallet) disables the configuration automatically. It tries once every 15 seconds, so an outage or throttling of about 2.5 minutes is enough. For example, this happens when the IAM role stops granting access or the delivery stream no longer exists. Fix the stream or IAM role, and then select **Enable** to resume streaming. When you re-enable the configuration, Ripple Custody (Wallet) validates the stream and role again, as it does when you save, and enabling fails if either is no longer valid. It then resumes from the last record it uploaded, so it delivers the events it recorded while the configuration was off. You can't fix one case yourself: a record that exceeds the size limit even after truncation. Re-enabling doesn't help in that case, so contact support.

## Log structure

Each audit log entry is a JSON record with a fixed envelope and a compressed payload.

The envelope carries event metadata (`id`, `type`, `source`, `receivedAt`, `createdAt`), actor information (`userId`, `deviceId`, `requestId`), and your `orgId`. The `type` field identifies the record: `1` for access events, `3` for transaction lifecycle events, and `4` for wallet lifecycle events.

The payload — request and response details for access events, or the changed entity for lifecycle events — travels in `compressedJsonData` as base64-encoded, Brotli-compressed JSON. Your consumer base64-decodes and decompresses that field to read the event. Each record also carries the size and SHA-256 checksum of the uncompressed payload, so you can confirm that decoding recovered every byte.

Deprecated: jsonData
Ripple has **deprecated** the older uncompressed `jsonData` field. Ripple Custody (Wallet) emits it on every access record, and only on access records. Read `compressedJsonData` instead. No removal date is set: Ripple removes `jsonData` no sooner than 30 days after publishing the deprecation notice, and only after known consumers have migrated. See [Transaction and wallet audit records, compressed payloads, and `jsonData` deprecation](/pt-br/products/wallet/changelogs/firehose-audit-payload-compression).

See [Firehose audit log reference](/pt-br/products/wallet/integrations-and-monitoring/audit-logging/firehose-audit-log-reference) for the full field reference, decode examples, and example payloads.

## Best practices

- **Route logs to a SIEM** — tools like Splunk, Datadog, or Elastic SIEM let you search, alert on, and visualize audit events in real time.
- **Set retention policies** — configure retention on your Firehose destination (S3 lifecycle rules, Splunk index policies) to meet your compliance requirements.
- **Monitor Firehose delivery** — use AWS CloudWatch metrics for your Firehose stream to detect delivery failures or throttling.
- **Use audit logs for access reviews** — periodically review who is accessing what, which credentials are active, and whether access patterns match expectations.
- **Correlate with freeze and approval events** — cross-reference audit logs with [transaction freeze](/pt-br/products/wallet/compliance/transaction-freeze) and [approval flow](/pt-br/products/wallet/governance-and-controls/approvals/configure-approval-flows) activity for complete compliance reporting.
- **Separate sandbox and production** — use different Firehose streams and destinations for each environment.


## Limitations

- Ripple Custody (Wallet) delivers audit logs every 15 seconds, so they can lag by that long, and longer while it catches up on a backlog. They aren't suitable for real-time blocking or inline security decisions.
- Log delivery depends on your Firehose stream being available. If AWS throttles the stream or the stream becomes unavailable, Ripple Custody (Wallet) keeps the undelivered logs and retries every 15 seconds. After 10 consecutive failed cycles, it disables the configuration, and you must re-enable it.
- A single record must stay below 1,000,000 encoded bytes. When an access record exceeds that, Ripple Custody (Wallet) clears `request.body` from the payload and marks the record with `legacyJsonDataTruncated`.


## Related topics

- [Firehose audit log reference](/pt-br/products/wallet/integrations-and-monitoring/audit-logging/firehose-audit-log-reference) — Full technical reference with IAM policies, log schema, and example payloads
- [Backup and recovery](/pt-br/products/wallet/signing-and-key-management/backup-and-recovery) — Set up AWS infrastructure for backups (similar IAM patterns)
- [Webhooks overview](/pt-br/products/wallet/integrations-and-monitoring/webhooks#webhooks-vs-audit-logging) — Compare webhooks with audit logging