> For the complete documentation index, see [llms.txt](https://wiki.datadike.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.datadike.com/pam/administration/sessions/recording.md).

# Session recording

Configure what is captured during a session and where it is kept — the object storage backend for replays, the separate store for commands, watermarking, and how retention of metadata differs from ret

## What this is and when to use it

Every session the solution brokers is recorded, for every protocol, with no per-session switch to forget. This page is about **configuring** that: what is captured for each protocol, where the files are written, what the watermark says, and how long any of it survives.

Finding and replaying a recording afterwards is a different job, on a different screen — see [Session recordings](https://wiki.datadike.com/pam/administration/audit/recordings.md).

### Two stores, not one

The distinction matters as soon as you start configuring, because the two are configured separately and can live in different places:

| Store               | Holds                                                                                      | Default location                |
| ------------------- | ------------------------------------------------------------------------------------------ | ------------------------------- |
| **Object storage**  | The replay itself — screen video for graphical sessions, terminal replay for text sessions | The PAM server's own filesystem |
| **Command storage** | The commands typed in terminal and database sessions, as searchable text                   | The PAM database                |

### What each protocol leaves behind

| Protocol                        | Replay                | Searchable commands                                     |
| ------------------------------- | --------------------- | ------------------------------------------------------- |
| SSH, Telnet                     | Terminal replay       | Yes                                                     |
| RDP, VNC, RemoteApp, VirtualApp | Screen video          | No                                                      |
| Database                        | Replay of the session | Yes — the queries executed                              |
| SFTP and file transfer          | —                     | Not commands, but a retrievable copy of each file moved |

{% hint style="info" %}
Replays are compressed and optimized before they are stored, in local storage and in an external backend alike, so the disk figures are lower than raw screen capture would suggest. Graphical sessions still consume far more space than terminal sessions — size your storage from the RDP traffic, not the SSH traffic.
{% endhint %}

## Before you start

* The **SYSADMIN** profile.
* A decision on where recordings will live, made **before** you go to production. Sessions recorded to the local disk are not migrated when you later add an external backend.
* If you are pointing at an object store: the bucket or container, credentials scoped to it, and TLS available on the endpoint.
* A retention decision for the files, separate from the retention setting in the console. See the warning under Retention.

## Configuring where replays are stored

1. Open **System settings › Storage › Object storage**. Two entries exist and neither can be deleted:
   * **default** — type **Server**, the local filesystem of the PAM server. This is the active default after installation.
   * **null** — type **Null**, described as *Do not save*. It discards recordings instead of storing them.
2. Click **Create** and choose the backend type. The supported types are **S3** (Amazon S3 and any S3-compatible service such as MinIO or Wasabi), **Ceph**, **Swift**, **OSS**, **Azure**, **OBS**, **COS**, **SFTP**, **Server**, and **Null**.
3. Fill in the endpoint, bucket, and credentials for the backend, and give it a **Description** that says which sessions it is meant to hold.
4. Set the new backend as **Default**. Only one backend is the default at a time, and it is the one new recordings are written to.

{% hint style="danger" %}
Do not leave the **default** local backend in place in production. It has no redundancy, it fills the PAM server's own disk, and it does not scale. Move to an external object store as early as you can, and give the bucket server-side encryption and a policy that admits the solution only — `GetObject`, `PutObject`, `DeleteObject`, `ListBucket`, nothing wider.
{% endhint %}

To deliberately **not** record a class of sessions — a lab environment, for instance — the mechanism is the **null** backend rather than a per-session toggle. Be explicit about that decision: a session recorded to `null` still produces a session record, so the audit list shows an entry with no replay behind it, which is indistinguishable at a glance from a recording that failed.

## Configuring where commands are stored

1. Open **System settings › Storage › Command storage**.
2. The list is **empty by default**, and that is not a misconfiguration: with no backend defined, commands are stored in the solution's own database.
3. Add a backend — Elasticsearch, for example — when command search has become slow. At high session volumes an external index is markedly faster to search than the database, and it takes the command history off the database's growth curve.

## Configuring the watermark

The watermark overlays identity onto the session and into its recording, so a screenshot or a phone photograph carries the identity of whoever took it.

1. Open **System settings › Security › Sessions**.
2. **Watermark** is enabled by default. It applies to sessions in the browser and to the stored recording.
3. Edit **Watermark session content** to control what the overlay says, using the variables below. They are substituted with real session data at connection time.

| Variable          | Substituted with      |
| ----------------- | --------------------- |
| `${userId}`       | User ID               |
| `${name}`         | User's full name      |
| `${userName}`     | User's login name     |
| `${assetId}`      | Asset ID              |
| `${assetName}`    | Asset name            |
| `${assetAddress}` | Asset address         |
| `${currentTime}`  | Current date and time |

Some usable templates:

```
${name} (${userName})
${assetName} ${assetAddress}
User: ${name} (${userId}) accessing ${assetName}
Access recorded on ${currentTime} by ${name}
${assetName} - address: ${assetAddress} - viewed by ${userName}
```

{% hint style="warning" %}
The watermark is drawn by the connector that brokers the session. It is reliable for SSH and Telnet and for graphical sessions in the browser, but a watermark on an RDP session **does not always reach a native RDP client**. If the watermark is a compliance control rather than a deterrent, keep those users on the browser session — see [Connection methods](https://wiki.datadike.com/pam/administration/sessions/connection-methods.md) for how to remove the client option.
{% endhint %}

## Recording does not depend on where the asset is

The recording happens at the connection broker, not on the target. Everything the user does passes through it, so what gets recorded is the same whether the asset sits on the same network as the solution or somewhere the solution cannot reach directly.

| Where the asset is            | How the session is reached                                                                                                                                                       | What is recorded                  |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
| Same network                  | Direct                                                                                                                                                                           | Full session, commands, transfers |
| Segmented network             | Through a [gateway](https://wiki.datadike.com/pam/administration/connectivity/gateways.md) in a [proxy](https://wiki.datadike.com/pam/administration/connectivity/proxy.md) zone | The same                          |
| Remote site, no inbound route | Through a [broker](https://wiki.datadike.com/pam/administration/connectivity/broker.md), where the remote side dials out                                                         | The same                          |
| A single isolated machine     | Through a [connector](https://wiki.datadike.com/pam/administration/connectivity/connectors.md) that dials out from the machine itself                                            | The same                          |

This matters for two cases that are otherwise hard to audit:

* **A supplier working on a system in their own network.** The session is brokered and recorded like any other. There is no agent on the target and no inbound firewall rule to the supplier's side.
* **A branch or a remote site.** Nothing has to be deployed per site beyond the component that dials out, and the recordings all arrive in the same store, under the same retention.

The user's own network position changes nothing either. A session opened from the web terminal is recorded identically to one opened with a native client through the broker.

## Retention

**System settings › Retention › Log record** holds the retention windows the nightly cleanup jobs enforce:

| Field                      | Default | Covers                                                                    |
| -------------------------- | ------- | ------------------------------------------------------------------------- |
| Session log retention days | 200     | Session metadata: user, asset, account, start and end, duration, protocol |
| FTP log retention days     | 180     | File transfer records                                                     |

{% hint style="danger" %}
**Session log retention days controls metadata in the database, not the recording files.** Raising it does not keep replays longer, and lowering it does not reclaim storage. The lifecycle of the actual files is set on the bucket or container itself. Configure both, or you will end up with either orphaned files nobody can find or session records whose evidence has already expired.
{% endhint %}

## How to verify it worked

Prove the pipeline on sessions you create for the purpose — one per protocol you care about, because what is captured differs by protocol.

1. Open an SSH session, type an identifiable command, and disconnect.
2. Open an RDP session, do something visually identifiable, and disconnect.
3. In **Audit › Sessions › Historical sessions**, confirm both sessions offer **Replay**, and play each one back.
4. Confirm the watermark is visible **in the replay**, not merely on screen during the session.
5. Confirm the SSH session has a command list and the RDP session does not — that is the expected asymmetry, not a fault.
6. If you have just switched to an external backend, look in the bucket and confirm new objects arrived for these sessions. This is the step that catches wrong credentials and a wrong endpoint: the console reports the backend as configured while recordings keep going to the old default.
7. Watch the PAM server's own disk usage for a few days after the switch. It should stop growing at the rate it did before.

## Common errors

| Symptom                                                               | Cause                                                               | Fix                                                                                                   |
| --------------------------------------------------------------------- | ------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| The PAM server's disk fills up                                        | Recordings are still going to the local **default** backend         | Configure an external object storage backend and set it as default                                    |
| Retention was reduced but storage never shrinks                       | The retention setting covers metadata only                          | Set a lifecycle policy on the bucket or container                                                     |
| A session record exists with no replay                                | The session was routed to the **null** backend, or recording failed | Check which backend is default; a `null` destination looks identical to a failure from the audit list |
| The watermark is missing in a session opened with a native RDP client | The overlay does not always reach a native client                   | Route those users to the browser session                                                              |
| No command list for an RDP or VNC session                             | Graphical protocols produce no command record at all                | Use the replay; there is nothing textual to search                                                    |
| **Replay** greyed out on a very short session                         | The session was too short to count as a successful connection       | Expected; nothing to recover                                                                          |
| Command search is slow at scale                                       | Commands are in the solution's database                             | Add an external Command storage backend such as Elasticsearch                                         |
| Storage grows far faster than expected                                | Graphical sessions dominate the volume                              | Size and alert on the bucket from RDP and VNC usage, not from SSH                                     |

## Related pages

* [Session recordings](https://wiki.datadike.com/pam/administration/audit/recordings.md) — finding, replaying, and downloading a recording
* [Audit trail](https://wiki.datadike.com/pam/administration/audit/audit-trail.md) — the records kept alongside the replay
* [Live monitoring](https://wiki.datadike.com/pam/administration/sessions/live-monitoring.md) — watching a session while it is still running
* [RDP sessions](https://wiki.datadike.com/pam/administration/sessions/rdp.md) — why a graphical session has no command list
* [File transfer](https://wiki.datadike.com/pam/administration/sessions/file-transfer.md) — the copies kept of files that moved during a session
