# Activity findings
Source: https://shld.app/docs/activity-findings · Updated 2026-11-24 · Synced from shld f6c77924

> Inspect the process, connection, persistence, file-permission, reverse-shell, and decoy signals that shld records on its local tape.


This page lists the activity signals shld collects and the evidence each signal can support. It also shows how to place a decoy and verify the local record.

## Processes and connections

The supplied systemd service runs `shld run --interval 5s`, so it polls every 5 seconds. On Linux, `shld run --proc /proc` enables process collection, and an empty `--proc` value disables it.

During a poll, the agent examines visible process metadata, file descriptors, and socket tables under `/proc`. It can record process execution metadata, listeners, and established connections with remote endpoints. The agent correlates a socket descriptor with the process that holds it.

Collection scope has two separate parts. The filesystem `--root` selects the inventory tree, but it does not confine procfs observation to that tree. The agent account's permissions and network namespace determine which processes and sockets it can see. The supplied `DynamicUser` unit can have limited visibility into other users' processes.

## Persistence paths

The collector watches changes to cron and systemd unit locations when they fall within the selected inventory scope. It also watches `.bashrc`, `.profile`, `/etc/rc.local`, and `/etc/ld.so.preload`.

A change at one of these paths can produce a `persistence-change` finding. Review it against deployments and administrator work.

## SUID and world-writable files

shld records findings for SUID and world-writable files, with available path and mode metadata.

Stock SUID files can trigger this rule, and trusted package ownership does not suppress them. An administrator can define a pinned privileged-file policy for approved cases. `sudo shld doctor` reports when no policy is configured and can print a manual permission-change command for review. shld never runs that command.

## Reverse-shell signs

Two observations can indicate a reverse shell:

| Signal | What the agent observes |
| --- | --- |
| `reverse-shell` | A shell with reverse-shell metadata |
| `socket-stdio` | The same established TCP socket attached to a process's standard input and standard output |

The socket correlation can match legitimate services. An established socket does not prove connection direction or malicious intent.

The `sensitive-egress` and `canary-egress` findings link file and socket evidence for investigation. The documented canary example uses a 120-second window. The correlation does not prove data transfer.

## Decoy files placed by hand

Create a new decoy at a dedicated path inside the approved watched folder:

```sh
sudo shld canary --root /srv/application --path config/.aws/credentials
```

The path above is an example: pick your own, and do not copy it. A decoy works only while an intruder cannot tell it from a real file, so give it a name that fits your application, and avoid a folder name such as `decoys` that says what it is. Choose a path that does not exist. shld refuses to replace an existing file and writes generated decoy data. Do not reuse a real credential path.

The collector records path and process metadata when a process holds the decoy open during a poll. Backup and inventory tools can be legitimate readers. A default installation has no decoys until an administrator creates them.

## The hash-chained tape

The agent writes events and findings to `<state>/events.jsonl`. Each record has a sequence and a hash link to the preceding record. shld validates the chain before resuming a state directory.

The in-memory index holds at most 1,024 sparse checkpoints. Replay and scans stream verified records from disk instead of retaining the full tape in that index. Each appended record is limited to 60 KiB. The current release puts no total size cap on the tape file and never prunes it.

Before appends and scans, shld checks the tape's file identity, size, modification time, and change time. It refuses changes made outside the process and preserves the state for recovery.

Verify an existing tape with:

```sh
sudo shld verify --state /var/lib/private/shld
```

Success returns JSON with `valid`, `sequence`, and `head`. Exit 0 means the chain is valid, exit 1 means validation or state checks failed, and exit 2 means the tape is absent. The command takes the writer lock and can create `tape.lock` for an existing tape. Use `sudo shld doctor` for a read-only check beside a running writer.

## Limits

Polling can miss short-lived processes, connections, descriptor opens, and file changes. An open descriptor proves an open file, not a read or transfer. The tape provides tamper evidence for retained records, and a local root attacker can replace both the agent and tape.

## Related

- [SSH logins in observe mode](/docs/ssh-logins)
- [What leaves your server](/docs/data-handling)
- [CLI reference](/docs/cli)
- [Limits and coverage](/limits)
