Products › lamco-dsi-tools › Docs › Sharing a capture

Sharing a capture

What dsitell bundle and dsitell scrub replace, what they keep, and what to read before you post.

A capture taken with lamco-dsi-tools (DSI: Desktop session interfaces) holds what the machine said, so it holds private details: Login names, user and session identifiers, the host name, the machine identifier, home directory paths and more. dsitell bundle writes a redacted copy of one capture, and dsitell scrub redacts a directory of captures as one set. They replace the kinds of value listed below with placeholders. The redaction is a best effort, so read what they write before you post it.

What a capture holds

  • session logind has user names, user ids and session ids.
  • pipewire diagnose has the user name, the host name and process ids.
  • wayland diagnose has a process id and a program path.
  • observe has all of them and the host name.

A capture holds no pixel, no sound, no restore token's text, and no clipboard content: What a watcher or a driver records of a selection is its length and its SHA-256. A fingerprint isn't a secret, since short content can be found from it by trying candidates, and the bundle leaves fingerprints as they are. A capture taken with --keep-content holds the first bytes of each content read or set, and the bundle doesn't remove them. Where they're text it replaces in them what it replaces in any text, and what else they say stays. A clipboard can hold a password.

bundle: One capture

dsitell bundle capture.json --out bundle.json

The bundle is a capture with private values replaced by placeholders, with its health summary and findings appended. Every dsitell command reads it. The command prints what kinds of value were replaced and how many, and what it kept.

What is replaced

KindPlaceholder
Login name<user-ID>
User identifier<uid-ID>
Group identifier<gid-ID>
Host name<host-ID>
Machine identifier<machine-id-ID>
Home directory path<home-ID>
Login session identifier<session-ID>
Bus unique name<bus-ID>
The identifier KWin gives an output<output-id-ID>
MAC address<mac-ID>
IPv4 address<ipv4-ID>
IPv6 address<ipv6-ID>
Mail address<mail-ID>
The titles of the windows a capture taken with --window lists<title-ID>
The titles PipeWire holds of a stream (media.name, media.title, window.title)<media-title-ID>
With --redact-app-ids, and only then, the application identifiers of those windows<app-id-ID>

The toolkit's own two windows keep their titles and identifiers, so a reader sees which window a capture took.

How a value is found

Most kinds are learned first and replaced afterwards. A value is learned from the capture's header, from the fields in which logind, PipeWire and the kernel input dissector put such values, and from shapes in any text: Paths under /home/, /Users/ and /run/user/, the systemd units of a user and of a session, and bus names. A learned value is then replaced wherever it stands as a whole word: In a record's member, in the kind of its resource, and in every key, text value and byte value that is text of its payload.

  • Login and host names are matched without regard to case. The machine identifier is matched in either case, with or without a UUID's dashes.
  • Home directories are /home/<name> and /Users/<name>. A home directory anywhere else is found only by a login name something else in the capture taught.
  • User, group and session identifiers are small numbers, so they're replaced only where something says what they are: Known fields such as uid, gid and session_id, and known shapes such as /run/user/<id> and user@<id>.service. The same number standing alone in a sentence isn't found.
  • Escaped slashes: A text whose slashes are all escaped (\/home\/name\/), as a program's JSON output has them, is read with plain slashes.
  • The superuser is never replaced: The login name root, the user and group identifier 0 and the home directory /root name nobody and stay as they are, so a reader (and the bundle's health summary) can still see what belongs to the superuser, as the owner of /dev/uinput does.
  • The four kinds of address aren't learned. Each is told by its shape wherever it stands, whoever's it is. Where a shape can't tell an address from something else, the text is replaced. Four numbers with dots that read as a version are left.

SECURITY.md states each rule in full, with what it takes that's no address and what it leaves.

What is kept

These are listed as kept in a bundle and in a set's manifest:

  • The boot identifier, which is how two captures are held to one clock.
  • Process identifiers.
  • Program and library paths outside a home directory, and a home directory that isn't under /home or /Users.
  • The superuser's name, identifiers and home.
  • The names of the compositor, of applications and of outputs.
  • What an output interface sent about a monitor: Its make, model, serial number and EDID.
  • Input devices as the kernel lists them (an address in one of them is replaced as an address).
  • A name or serial number that a device, a program or a person put into a name of its own. The redaction knows no person's name.
  • The wall-clock time the capture was closed and each record's time since the machine started, which together give the time the machine was started.
  • The cookie of the PipeWire core, and the locale a program runs in.
  • A stream's title where it stands outside the three fields above.
  • Byte values that aren't text, kept byte for byte, so a private value inside one stays.
  • A value spelled another way than it was learned in: Percent-encoded, in hexadecimal or in base64.
  • A window's identifier, and the application identifiers of other windows unless --redact-app-ids is given.

Anything that isn't one of the kinds replaced is kept as well. A private detail of another kind, in a property some program set or in a message some service sent, stays where it is.

Placeholders and their tags

A placeholder is the kind and a tag, as <user-3fa9c2d1>. The tag is the start of a keyed SHA-256 of the value, so the same real value always becomes the same placeholder and different values different ones, and the structure stays readable. The key is made from the machine identifier, which the redacted copy no longer holds, so a guess at a login name can't be checked against a tag by someone who has only the bundle.

The machine identifier's own tag is keyed with nothing, so one machine reads the same in every bundle, and two machines never read alike. Two consequences follow. Someone who already has a machine's identifier can tell that a bundle came from that machine. And since every other tag's key is made only from the machine identifiers the bundle or set names, someone who has them all can test a guess at a login name, a host name or a title against each tag.

LOOK THESE OVER

A learned name is replaced only where it stands as a whole word. Where one was left inside a longer word, the last line the command prints begins with LOOK THESE OVER and gives the count by kind. A name shorter than three characters is replaced only in a field known to hold one. Treat that line as a list of places to read.

scrub: A set of captures

dsitell scrub captures/ --out publishable/
sha256sum publishable/*.json          # the same digests MANIFEST.json holds

bundle redacts one capture. A set of captures that belong together, the captures of one desktop or of one comparison, is redacted with scrub, which learns the values from every file first. A login name one capture holds in a known field is then replaced where another has it only in passing, the counts are the whole set's, and one real value is one placeholder in every file. A machine's own placeholder is the same whether its captures were bundled one at a time or scrubbed as a set. It takes --redact-app-ids as bundle does.

scrub reads every .json and .jsonl file of the directory that's a capture, and writes each to the output directory under its own file name, with the same replacement applied to the name. A long run's stream is written as one document (soak.jsonl becomes soak.json). Each copy has three more members: redaction, redaction_covers and health. MANIFEST.json lists each file with its size, the SHA-256 of its bytes, its record count and the tool that wrote it, then the redaction counts and how many files weren't taken. Nothing is overwritten: The command stops when a file it would write is already there, when two captures would be written under one name, when the output directory is the source, or when the directory holds no capture.

Before you post

  1. Read the command's output: What was replaced, what was kept, and any LOOK THESE OVER line.
  2. Read the bundle. It's a JSON file. Search it for your login name, your host name and anything else you wouldn't want public.
  3. If you find one, don't post the file. A value that gets past the redaction is a vulnerability. Report it privately, through GitHub's private vulnerability reporting on the repository or by email to office@lamco.io, and say which kind of value it is and where in the file it stands, leaving the value itself out.

The redaction's tests run on invented captures, the fixtures of the repository, and it has had no review from outside the project. Attach a capture to a bug report walks through the steps.