Skip to content

Log archive and privacy

Archive

With Archive on, each finished day (older than yesterday, so late lines of devices that were offline are included) is exported to a storage target of Settings, Backup (S3 compatible including AWS, Hetzner and MinIO, Backblaze B2, also WebDAV, SFTP or a local directory). Credentials are the target's, sealed like the backup target secrets; S3 and B2 are always reached over TLS.

Layout under the target's prefix:

logs/t<tenant>/<device>/<YYYY-MM-DD>.ndjson.gz.enc
logs/t<tenant>/manifests/<YYYY-MM-DD>.json
  • Objects: one per tenant, device and day, gzip compressed NDJSON (one line per log line with time, device, source, unit, priority, host, message, fields and the dedup key), encrypted before upload.
  • Manifest per tenant and day: the key ID, and every object with its line count, size and SHA-256. The manifest's own SHA-256 is kept in the database.
  • Verify: every object and the manifest is read back after the upload and its SHA-256 compared. Only then the day counts as archived; a partition is never dropped before.
  • A day that received lines after it was archived (a device came back online) is archived again before its partition is dropped.
  • Archive retention: archived days older than Keep archives (days) are deleted from the target (0 keeps them). With S3 Object Lock or a B2 file lock on the target the provider refuses early deletes; such days stay listed until the lock ends.

Encryption

  • Format LIMDMLG2: a header with the key ID, a random 32 byte salt and the object name (logs/t<tenant>/<device>/<day>...), then chunks of 64 KiB sealed with AES-256-GCM. Every object has its own key, HKDF-SHA256 of the tenant's data key and the salt, so the chunk number is a unique nonce under that key and no nonce repeats across objects. The additional data binds the header (tenant, device and day) and marks the last chunk, so changed, reordered, removed or appended chunks and objects moved to another name fail to open. Objects of the first format LIMDMLG1 (0.21.0: one random 4 byte nonce prefix per object under the data key) stay readable; new archives are always written as version 2.
  • Each tenant has its own random 256 bit data key, stored in the database with its ID (lk-<tenant>-<random>), wrapped (AES-256-GCM) with a key encryption key of the server key management: the key kind logs (Log archive key), an Ed25519 key in the CA directory or in the HSM (PKCS#11), the same root as the CA and command keys. It is independent of LIMDM_SESSION_KEY: a session key rotation or a leaked session key does not touch the archive. The key encryption key ID is stored with every data key.
  • Data keys are not in the bucket: whoever holds the bucket alone cannot read the logs.
  • Rotation of data keys: Rotate keys (Settings, Logs) gives every tenant a new active data key; older archives keep naming their key and stay readable.
  • Rotation of the key encryption key: Settings, Keys, logs (or limdm-server keys rotate logs). After the restart every data key is wrapped again with the new key; then finish removes the old one. Archived days stay readable throughout.
  • Decrypting an archive needs the database (or its backup, for the data keys) and the CA directory or HSM (for the key encryption key).

Restore

Console: Settings, Logs, Archive, Restore on a day. The objects are downloaded, checked against the manifest, decrypted and loaded into the day's partition. The day is searchable on the Logs page for Keep restored days (hours) (default 24), then dropped again. Every restore is audited (logs.restore).

Command line, for example when the console is not available:

limdm-server logs -env /etc/limdm-server/server.env status                    # archived days
limdm-server logs -env /etc/limdm-server/server.env archive                   # archive finished days now
limdm-server logs -env /etc/limdm-server/server.env restore -day 2026-11-20   # all tenants of a day
limdm-server logs -env /etc/limdm-server/server.env restore -day 2026-11-20 -tenant 2

Privacy

Logs contain personal data (user names, addresses, mail addresses in Postfix lines).

  • Off by default; enable it per blueprint and only for the sources you need.
  • Masking and filters run on the device, before anything leaves it.
  • Personal devices are refused unless the item allows them.
  • Short retention on the server (7 days by default); archives are encrypted per tenant and deleted after their retention.
  • Access is limited to admins and auditors, the helpdesk only per device when allowed; exports and restores are audited.