11.5 Security model
This page summarizes how PDC-Backup protects data and access: which component trusts which, how connections and stored secrets are encrypted, what passphrases and the recovery kit mean, and with which privileges the server and agents run.
Trust boundaries
The server holds all secrets (storage credentials, repository passphrases, master key, keys of the internal CA) and decides what agents may do.
Agents are trusted only for the data of their own machine. A compromised agent should reach neither the server's keys nor other machines' snapshots, retention decisions, or other agents' credentials.
Web users act within their role (see section 11.1 Users and roles).
In normal operation the server opens no connections to clients: agents dial in to the server. The exceptions are push installation (SSH, WinRM, SMB) and Wake-on-LAN packets.
Encryption in transit
Internal CA: On first start the server creates its own certificate authority (ECDSA P-256). It issues the server's TLS certificate and the client certificates of all agents. The web interface also uses the internal CA by default, or an uploaded certificate (PEM or PFX); agents trust only the internal CA.
Mutual TLS (mTLS): Agents and server authenticate with certificates. The certificate lifetimes are in
server.toml:server_cert_days(default 90) andagent_cert_days(default 30). Agent certificates renew automatically after two thirds of their lifetime. A revocation is a catalog entry checked on every connection.Key pinning: The server keeps its TLS key across certificate renewals. Agents store the fingerprint of this key (
server.pins) and accept only a server certificate that belongs to the internal CA and carries this key. For a key change there arepdc-server server-key prepareandpdc-server server-key rotate;pdc-server server-key showshows the valid fingerprints.Enrollment: An agent creates its key pair locally; only the certificate request travels to the server. The enrollment token is valid once (default 15 minutes,
enrollment_token_minutes) and contains the fingerprint of the CA, so an agent cannot be redirected to a rogue server.Data path: Agents talk to repositories only through the server (REST endpoint on the same port 8444 with the same mTLS). Access is append-only: only the agent's own lock files can be deleted, nothing is overwritten, uploads are checked against their hash, and the agent sees only the repositories that a job of its own (or a restore assigned to it) needs. Deleting and cleaning up (forget, prune) is done by the server.
Encryption at rest
Repositories: The data is encrypted on the agent with the restic key scheme before it leaves it. The storage (disk, share, S3) sees only ciphertext.
Key per agent: The repository passphrase (the primary key) stays on the server. Each agent gets its own key file per repository with a random password, which arrives with each job over the secured connection and stays in the agent's memory for that job only. The agent stores neither passphrases nor storage credentials.
Secrets in the catalog: Credentials for S3, databases, push, notification channels, and repository passwords are encrypted with XChaCha20-Poly1305 under a master key (
secret.key). On Windows DPAPI protects the master key, on Linux a file with mode 0600. The private keys inpki/(CA, server, deploy CA, package signing) are encrypted with the master key. Push credentials are used once by default; storing them is optional.Passwords: Accounts store Argon2id hashes. API tokens, metrics tokens, and sessions are stored only as hashes.
Configuration backup: Backups of the server (catalog, CA, certificates, settings) go to repositories that no agent can reach. The master key in them is wrapped with the DR passphrase, which the server never stores. Whoever knows only the repository passphrase gets the catalog, but not the server's secrets.
Passphrases and recovery kit
Secret | Purpose | What happens on loss |
|---|---|---|
Repository passphrase | Encrypts all data of a repository. Generated at creation and cannot be recovered. | The backups are lost for good, even if the storage is still running. |
Recovery kit | Text file with storage location, repository ID, passphrase, and instructions for restoring the server. Downloading it is logged. Keep it offline, printed or on a USB stick. | After a total loss of the server there is no way to open the backups. |
DR passphrase | Wraps the master key in the configuration backups. An admin sets it; it is shown once and not stored (see section 11.3 Four-eyes approval). | The server cannot be restored from the configuration backup. |
Creating repositories is described in chapter 08 Repositories and Storage.
Isolation between machines
All keys of a repository unlock the same master key. Isolation therefore depends on the mode a repository gets at creation:
Mode | What agents get | Machines read each other's data | Cost |
|---|---|---|---|
| the whole index, every pack | yes | none |
| own blobs only | no | the server checks every uploaded pack; deduplication across machines only at maintenance |
| no key and no storage access | no | experimental, file backups only, behind |
In a shared repository an agent can read every blob of the index and therefore file names and contents of other machines; only separate repositories or the mode per_machine_index separate machines from each other. Snapshots from other sources count as foreign (event foreign_snapshot, see section 10.4 Notifications) and are neither restored nor considered by retention.
Web interface and API
Sign-in with Argon2id passwords, optional TOTP and optional OIDC; lockout after failed attempts (see section 11.2 Sign-in and OIDC).
Session cookie
HttpOnly; Secure; SameSite=Strict, plus a CSRF token for state-changing requests. API tokens are exempt and never have more rights than their owner.Every API route requires a role. The web interface sets a strict content security policy, HSTS, and further protective headers.
All administrative changes are in the audit log (see section 11.4 Audit log). Dangerous actions can be placed under four-eyes approval.
Linux service account and hardening
The Linux server runs as the system user pdc-backup (group pdc-backup, home directory /var/lib/pdc-backup, shell nologin) and needs neither root nor capabilities for any function. The packages (.deb, .rpm) create the user and hand over the data directory once on an upgrade from a root version. apt remove and apt purge keep the data directory because it contains the catalog, the CA, and the master key.
Setting of the systemd unit | Effect |
|---|---|
| Data directory only for the service account, new files not readable by others. |
| No capability can be gained or inherited. |
| The file system is read-only except where allowed below; no device nodes. |
| Writable are the data directory and the usual places for repositories. This grants no permissions: the service account also needs them on the folders. |
| Only TCP and UDP over IPv4 and IPv6, and Unix sockets. |
| Further restrictions the server does not need. |
More operating notes:
Ports below 1024: The default ports 8443 and 8444 need no privileges. For 443, create a drop-in with
AmbientCapabilities=CAP_NET_BIND_SERVICEandCapabilityBoundingSet=CAP_NET_BIND_SERVICE(systemctl edit pdc-server) and setweb_listen = "0.0.0.0:443"inserver.toml.Other repository locations: Create a drop-in with
ReadWritePaths=andRequiresMountsFor=for the folders. Create local folders withinstall -d -m 0700 -o pdc-backup -g pdc-backup <path>. Mount SMB shares through the system (cifswithuid=pdc-backup,gid=pdc-backup), because on Linux the server never mounts anything itself.Commands as the service account: Run commands such as
pdc-server --data-dir /var/lib/pdc-backup infoorserver-key showassudo -u pdc-backupso that no files owned by root are created.dr restorerun as root hands the restored files to the owner of the data directory.Server updates: The server does not update itself; updates come through the package manager.
Agent privileges
On Windows the agent runs as LocalSystem (service PDCBackupAgent), on Linux as root (systemd unit). It needs outgoing connections to the server and write access to its state folder (C:\ProgramData\PDC-Backup\agent or /var/lib/pdc-agent; key files with mode 0600). Installing the agent needs administrator or root rights once.
Task | Windows | Linux |
|---|---|---|
Read all files |
|
|
Consistent snapshot | Administrators or LocalSystem for VSS | root for LVM, btrfs, and ZFS. Without these the job falls back to a live backup with a warning ( |
Save permissions | Owner, group, DACL without extra rights; SACL needs | Mode, owner, group, and extended attributes with normal access |
Restore files | Write access to the target; | Write access to the target; root to set owners (otherwise the files belong to the agent user) |
Images | LocalSystem: raw access to disks and VSS devices | root: read block devices, LVM and ZFS tools |
Scripts before and after jobs | run with the agent's privileges, so only admins can change them | as on Windows |
The agent never stores repository passphrases or storage credentials and verifies the server's key. A reduced-rights mode for file-only agents (Windows: virtual service account with SeBackupPrivilege; Linux: dedicated user with CAP_DAC_READ_SEARCH, CAP_FOWNER, CAP_CHOWN) works for live backups but not for snapshots; the installers do not set it up.
For databases the agent connects with the account stored in the job. The passwords are job credentials: encrypted in the server's secret store, sent with each run over the secured session, kept only in the agent's memory, and handed to the tools through environment variables, never on a command line. The account needs read rights on the database for a backup and create/write rights on the target for a restore. Self-service by local users on the machines is off by default and checks the permissions stored in the backup.