Data handling¶
Where original values exist while Privyx runs, and for how long. The threat model says why each matters.
In transit¶
- Request and reply bodies are processed in memory and never written to disk, unless you turn on the session tap.
- On a masking route, the values the detector finds and the policy selects are replaced before the request is forwarded. Values no detector finds, and fields Privyx leaves alone, reach the provider as sent; see Limitations.
- The provider sees the replacements and the rest of the request. The
partialoperator leaves part of each value visible on purpose.
At rest¶
- Session mappings, which hold the original values, are kept in the vault.
The default
memoryvault keeps nothing across a restart;sqliteandrediskeep the mappings until they expire or are pruned, so protect them like the data itself. Theencryptoperator stores ciphertext instead. - On POSIX, the SQLite vault file, with its
-waland-shmfiles, and the audit log are made readable by their owner only (0600) whenever Privyx opens them. A newprivyx mask --mapfile is created owner-only; an existing one keeps its mode, sochmod 600it. ~/.privyx, which holds the anchor key, the configprivyx config setwrites, and the list of trusted config files, is created with mode0700, as is every directory Privyx creates on the way to the vault or the audit log.privyx doctorfails when others can write to one of them.- The session tap (
proxy.tap, off by default) writes requests and replies, with their original values, toproxy.tap_dir. The directory is created with mode0700and each file with0600.
Logs and the audit trail¶
- Privyx's own log lines never contain request or reply text. They go to
standard output as text or JSON lines (
log.format: textorjson). - A
log.fileatlog.level: debugalso receives the logs of third-party libraries, which can include vault rows with original values. A new file is created with mode0600; on POSIX, an existing file with broader permissions or another owner is refused before anything is written. - The audit trail is a separate file (
features.audit.path, default~/.privyx/audit.log), one JSON object per line. It records event names, entity types, and counts, never matched text, original values, or tokens, and for an error only the exception's class name, since its message could quote the request. Events aresession.*(created, transform, restore, deleted),proxy.*(request, passthrough, blocked, response, error), andrun.*(unproxied, budget_exceeded); see Audit events and metrics. - Turn the trail off with
features.audit: falseorPRIVYX_AUDIT_ENABLED=false.
How long sessions are kept¶
- A session holds a mapping only for the values that were actually masked.
- The default
ephemeralsessions never reach the vault. Each lives in the proxy's memory for one request and is dropped when the reply is complete or the client disconnects;session.deletedrecords it. - Sessions chosen by a header, or by the
clientandconversationstrategies, are kept so that the next request can use them. Limit their lifetime withvault.ttlorprivyx session prune. vault.ttlexpires a session after that many seconds without a request, on every backend. Redis expires the key itself; thememoryandsqlitevaults stop returning an expired session at once and delete it the next time a session is created. Expiry writes no audit event.privyx session prune --older-than 7ddeletes idle sessions on demand and records each assession.deletedwithreason: prune.