Quickstart
This walks you from an empty directory to a personal-data field that you write,
read back, decrypt through a subject access request, and then cryptographically
erase — five copy-pasteable steps. Everything runs against a standalone
scailog-server: one process, one SQLite file, no other services. You need
Python 3.11+.
1. Install and run the standalone server#
Install the server and CLI, initialize a data directory, then boot in standalone
mode. --init mints and prints the bootstrap key once — it is a full-access
API key, so copy it now; it is never shown again.
1 2 3 4 5 6 | |
Now start the server. SCAILOG_STANDALONE=true embeds the per-host agent so the
server opens the local ingest socket itself; SCAILOG_KEYSTORE_PASSPHRASE
unlocks the on-disk keystore. SCAILOG_SOCKET points the embedded agent (and,
in step 2, the SDK) at a socket path you can write to without root.
1 2 3 4 | |
Leave that running. In a second terminal, point the CLI at the server with the bootstrap key you copied:
1 2 | |
2. Emit a log with a PI field and a subject#
Install the SDK in your service and emit one entry. You wrap the PII value with
pi(value, pi_type) and pass a subject= — PI without a subject is rejected,
because the subject is who the per-subject key belongs to.
1 2 3 4 | |
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
1 | |
The email field is encrypted under usr_8842's per-subject DEK before it hits
storage. The message and the plain method field are stored in the clear and
are full-text searchable; the encrypted PI never enters the search index.
3. Query it back#
Read the entry back with the CLI. Query never decrypts PI — it shows which PI fields an entry carries (by name and type), not their values.
1 | |
You get a row for your entry: the ts, level, service, call_site_id, the
message ("user logged in"), and a pi column listing email. The value stays
encrypted; to read it you run a DSAR.
4. Run a DSAR for the subject#
A Data Subject Access Request (GDPR Article 15) collects every entry for a
subject and decrypts their PI into a signed report. This needs the dpo
capability, which the bootstrap key has.
1 | |
Open dsar.json. It contains entry_count, the call_sites involved, and an
entries array. Your entry's pi_values now shows the decrypted value:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
5. Erase the subject and confirm it is gone#
Erasure (Article 17) destroys the subject's DEK. Because the PI was only ever stored encrypted under that key, destroying it makes the PI unrecoverable — no row-by-row scrubbing required.
1 2 | |
Run the DSAR again. The entry is still present for audit, but its PI can no
longer be decrypted — pi_values comes back empty and the report is flagged
subject_erased: true:
1 | |
1 2 3 4 5 6 7 | |
That is the whole loop: written, searched, decrypted on lawful request, and cryptographically erased — the DEK is destroyed, so the erasure holds everywhere that PI was ever written. Next, read the Guides for the full DSAR, erasure, and policy workflows.