How X-Road backup encryption protects your Security Server data
GnuPG backup encryption protects backup archives at rest. The harder work is deciding which keys, recovery paths and log data belong inside that protection. A Security Server backup is sensitive because it reflects the working state of a member's exchange endpoint, and if the archive holds signing or TLS key material, a copy exposes that material to anyone who obtains it. X-Road is open-source software published under the MIT license and developed by the Nordic Institute for Interoperability Solutions (NIIS). Each member runs its own Security Server, so each member must make these decisions for its own backup set.
Start by listing every key the backup depends on. X-Road supports hardware security modules through PKCS#11 drivers using the xroad-addon-hwtokens package, with RSA and EC keys. If your Security Server keeps keys in an HSM, confirm whether a file backup captures them at all, because the recovery plan must then cover the HSM and its own key custody. Decide next whether message log data falls inside the same protection and which keys open it, since a backup that encrypts configuration while logs remain readable elsewhere splits your control across two systems. Add recovery public keys only after you know who holds the matching private keys.
Before you enable anything, confirm in the official documentation which items the backup contains, whether the PostgreSQL database is covered or must be backed up separately, and which procedure performs encryption and restore on your version. Then map those duties to people. The Security Server defines five user roles and authenticates admin users through PAM, so decide which role may change recipient keys and which may run a restore, and keep those approvals separate. Finally, test a restore onto a separate host before you rely on the setup. The Security Server user guide covers the roles and admin access, and the supported releases are 7.8.3, 7.7.4 and 7.6.5.
X-Road backup encryption options and when each fits
This table compares the main backup encryption choices for an X-Road Security Server: a single key pair versus extra recovery public keys, message log keys inside or outside backup scope, and hardware security module versus file-based private keys. Read each row for the benefit, the cost to operate it, what happens if the key is lost, and the setups it suits. The main takeaway is that recovery keys and key storage decide whether a backup can be restored, so settle them before the first backup is taken.
| Option | Benefit | Operational cost and key loss risk | When it fits |
|---|---|---|---|
| Single key pair | One key to generate, store and rotate. The simplest path to a working encrypted backup. | If the only private key is lost, existing backups cannot be decrypted. Key custody must be documented and tested. | Small deployments with a tested key custody process and a single accountable keyholder. |
| Single key pair plus extra public keys | Extra recipient public keys let a second party or escrow holder decrypt backups without the primary private key. | Each added key is one more key to protect, distribute and rotate. Every recipient key must be rechecked when staff change. | Teams that must still restore if the primary key holder leaves or the primary key is lost. |
| Message log keys inside backup scope | A restore can bring back the message log and its keys together, so the archive is usable on its own. | Backup files hold more sensitive material. A leaked backup exposes logged message keys as well as configuration. | Teams whose priority is complete restore and whose backup store has strict access control and monitoring. |
| Message log keys outside backup scope | Backup files carry less sensitive material, so a leaked backup exposes less. | Restoring logged messages needs a separate key source. The team must back up and protect that source on its own path. | Teams with a separate, well-controlled key store that can be restored independently of the backup set. |
| Private keys on hardware security modules | Private key material need not be copied into the backup set, and RSA and EC keys are supported through PKCS#11. | Needs a supported PKCS#11 module, xroad-addon-hwtokens setup and a tested recovery path if the module fails. | Organizations with an HSM already in place and a documented module backup and replacement procedure. |
| Private keys in files | No module to buy, configure or replace. Keys back up and restore with the rest of the server. | Key files and backups share one exposure surface, so access control and encryption of the backup store carry more weight. | Smaller estates with a documented, access-controlled key store and no HSM in the design. |
| PostgreSQL database backups | Managed PostgreSQL can add provider-side backups alongside the encrypted files, if the provider offers them. | Provider copies may not be encrypted with your GnuPG keys. Confirm where copies exist and who can read them. | Remote or managed PostgreSQL deployments where the provider's backup features are part of the design. |
X-Road backup encryption setup sequence
This sequence moves an X-Road Security Server backup from plain archives to a tested, encrypted procedure that named people can run and restore. Each step ends with a check you can repeat, so the team can show that the right people can decrypt the backups on a separate host. Work through it on a non-production setup before you change the production backup job.
Inventory what the backup contains
The administrator responsible for the Security Server lists every item the backup job collects, including database contents, configuration files, keys and certificates, and any message log data the job touches. Confirm the exact file set and locations in the official X-Road documentation for your version, because backup paths can change between releases. Mark each item that holds secrets, since those items define the scope the encryption must cover. You are done when a second administrator has reviewed the written list and confirmed that every secret-bearing item is on it.
Generate GnuPG keys for backup encryption
A named key custodian generates the GnuPG key pair on a workstation or a hardware-backed host, so the private key is never created on the machine that holds the live data. Choose an algorithm and key length that your security policy accepts, and set an expiry date that someone is responsible for tracking. Confirm the key settings and keyring location in the official X-Road documentation for your version before you configure the backup job. The check is that the key appears in the keyring and its full fingerprint matches the value written in the custody record.
Store private keys under custody rules
Move the private key into the custody arrangement your key management rules define, such as an offline vault, split custody or an HSM-backed process where your policy allows it. Limit access to named custodians and keep the passphrase stored apart from the key file. Remove any copy of the private key that was ever placed on the Security Server. The check is that only the listed custodians can access the key, and a test decryption of a small sample file succeeds from the custody location.
Add recovery public keys
Import the public keys of the recovery holders, such as a second administrator, an incident response contact and a break-glass key, into the keyring the backup job uses. Public keys can be shared, but confirm each fingerprint through a channel separate from the one that delivered it. Record every recipient, because each added key widens the set of people who can read the backups. The check is that a small test file encrypted to each recipient key can be decrypted with the matching private key.
Configure the encrypted backup job
Point the backup job at the approved recipient list and confirm that it writes encrypted archives. Check where the job writes temporary plaintext files, confirm the setting in the official X-Road documentation for your version, and remove or protect any plaintext output. Confirm that message log keys are inside the backup scope if your version keeps them on the server, so a restore is complete. Restrict write access to the backup destination. The check is that the output is an encrypted file, a search for a known configuration string finds nothing in the archive, and the recipient key IDs listed in the archive match your record.
Run a test backup and encrypted restore
Run the job against a non-production Security Server, then restore the archive to a separate host with a matching X-Road version and operating system. Use the restore steps in the official documentation for your version, with the private key supplied by a custodian. Confirm that the restored server connects to a database it can reach and that its configuration matches the source. The check is that the restored host starts correctly, and that the restore fails when the private key is not available, which shows the encryption is doing its job.
Record the procedure and its owners
Write a runbook that lists the inventory, key IDs and fingerprints, custodians, recipient list, job settings, restore steps and the date of the last successful test. Store the runbook with the custody records, separate from the Security Server, and name an owner who reviews it whenever keys change or X-Road is upgraded. The check is that someone who did not build the setup can follow the runbook to decrypt the test archive on a separate host.
Security controls for protected X-Road backups
A backup of an X-Road Security Server carries the same configuration and trust material as the live server, so protecting it is part of the server's security design. The six controls below cover storage, key custody, admin access, infrastructure placement, logging and restore testing. Each one needs a named owner, an evidence source and a check you can repeat after every change.
Restrict backup and key access
Encrypted backup files are only as protected as the place they sit and the decryption keys that open them. Limit read access to the backup location to the accounts that run backup jobs, and keep the decryption keys where those accounts cannot read them. Check file permissions, bucket or share policies, and any off-site copies, because a copy with looser rules becomes the weak point. Confirm which files and keys your backup process touches before you set these rules.
Separate custodians from operators
The people who run backups should not be the only people who can recover them, and the reverse applies too. Assign key custodians to a small group that does not run backup jobs, and assign backup operation to people who do not hold private key material. Record who holds each recovery key, where its copy is kept and how a custodian is replaced. Confirm how private keys are stored under your PKI or HSM policy before you name custodians.
Protect admin roles that restore
A restore can replace configuration and trust material, so the account that starts one needs the same scrutiny as any administrator account. The Security Server defines five user roles and authenticates admin users through PAM, which can use LDAP via SSSD with LDAP groups mapped to X-Road roles. Map the restore step to the smallest role set your team needs, and confirm in the user guide which role can perform restores.
User guideSeparate backups from database failure
The Security Server stores its state in PostgreSQL, which can run locally or on a managed service such as AWS RDS or Azure Database for PostgreSQL. A backup kept on the same host, disk array, availability zone or database account as the live database can fail with it. Place the backup copy in a separate failure domain, and check that a single credential cannot delete both the database and its backups. Confirm which backup mechanism your database platform provides.
Installation guideLog backup and restore events
A backup that no one can trace is hard to defend in an audit or an incident. Record who created, copied, decrypted and restored each backup, with the time, host and outcome of each step. Store those records where Security Server administrators cannot edit them. Confirm whether the Security Server audit log covers these restore events or whether your backup tooling must produce them, and test that the records reach your central log platform.
Test restores on a schedule
A backup that has never been restored is untested, so schedule restore tests and record the results. Restore into an isolated environment, then verify that the Security Server starts, its certificates and keys load, and a test message exchange succeeds. Include the decryption step with keys held by custodians, so the test also proves that the people and keys can be used together. Run a test after every version upgrade.
What the backup contains and why message log keys matter
The first decision is knowing what a backup actually holds, because a backup is only as useful as the restore it enables. In general terms, a Security Server backup covers the server configuration, the data in its PostgreSQL database, and the key and certificate material the member uses to sign and authenticate exchanges. Whether message log records, audit data and hardware-held keys are included depends on your X-Road version and deployment, so check the backup and restore section of the X-Road Security Server user guide for your exact release. Write an inventory from that check, marking each item as included, excluded or dependent on another system. A restore without the matching keys cannot recover encrypted content, so each key an encrypted item needs must have a documented location outside the failed server.
The message log needs a deliberate scope decision because it holds records of exchanged messages, which may contain personal data and often serve as evidence your organization relies on later. Decide in writing whether message log content is in the backup, how long it is retained, and whether the keys that encrypt it are backed up with it or held separately. If the log is in scope but its keys are not, the restored system may contain data nobody can read. If the log is out of scope, the recovery plan must state where those records come from after a restore and who is accountable for their retention. Keep the backup encryption recipients and the message log keys in the same inventory, because either missing key blocks recovery of that content.
Key custody changes when signing and authentication keys sit in a hardware security module reached through PKCS#11, which X-Road supports for RSA and EC keys through the xroad-addon-hwtokens package. In that setup the private key material typically stays inside the token, so a file-level backup of the Security Server may restore the configuration while signing remains unavailable. Confirm with your HSM vendor and against the installation guide for your version whether keys can be exported, wrapped or re-created, and who holds the PIN or credentials that unlock the token. Recovery then depends on the HSM operator's backup procedure, on key labels matching the restored configuration, and on access to a compatible token at the recovery site. Test the combination in a restore exercise, because a restored server that cannot reach its token has failed to restore, even when every file is present.
Encrypted backups leave the Security Server host only as ciphertext
The flow starts on the Security Server host, where the PostgreSQL database dump and the Security Server configuration are combined into a backup archive. GnuPG encrypts that archive to the operational public key and to each recovery public key before it leaves the host. The encrypted archive then crosses the trust boundary into external storage, which should hold only ciphertext. Restore needs a matching private key held by a custodian, so confirm that someone outside day-to-day operations can use a recovery key. Signing keys may remain in an HSM, so check whether they fall inside the backup scope.
Backup encryption path, with the trust boundary and custodian restore step.
Limits of X-Road backup encryption to confirm
The GnuPG backup procedure depends on details that vary by release, key handling and server role. Treat each card below as an open question to answer with the vendor documentation and a test restore before you rely on encrypted archives.
Backup items in scope
Confirm which items the GnuPG feature encrypts, for example the configuration, the database and the message log. Message log keys are a separate concern, so check whether they fall inside the encrypted set or need their own handling. An item left outside the archive stays in plain text, which matters most for the message log, where exchanged data is kept. Ask the vendor for the exact file list, then compare it with the contents of an archive restored on a test server.
Version the feature applies to
The supported 7.x releases are 7.8.3, 7.7.4 and 7.6.5, and 7.8.0 is the last new-feature release in the 7.x line. Confirm whether the GnuPG procedure behaves the same on all three lines or only on some, and whether it is present at your exact patch level. Record the release of the server that wrote each archive, since a restore on a different line may need extra steps. Do not assume an archive from one line restores cleanly on another without a test.
X-Road releasesHSM-held key coverage
X-Road can hold keys in hardware security modules through PKCS#11 drivers using the xroad-addon-hwtokens package. Keys that never leave an HSM cannot be copied into a file backup, so confirm whether the backup procedure captures HSM-held keys and what your recovery path is if the module fails. Ask your HSM vendor how keys are exported and whether that export fits your key custody policy.
Key rotation and old archives
When GnuPG recipient keys change, earlier archives stay encrypted to the old keys. Confirm whether you must keep the old private keys until every archive written under them has passed its retention period. Test a restore of an archive created before a rotation, performed after the rotation has happened. Record which public key each archive was encrypted to so the team can find the matching private key during an incident.
Central Server backup coverage
The Security Server and the Central Server hold different data, so a procedure verified on one does not automatically cover the other. Confirm whether the GnuPG feature applies to Central Server backups, including its database and any configuration the operator maintains. Where an operator runs the Central Server, agree backup ownership, key custody and restore responsibility in writing before you rely on the procedure. Test a Central Server restore on a separate host.
Lost recovery key consequences
If the only private key for a recovery recipient is lost, archives encrypted to it may be unrecoverable. Confirm whether the vendor documentation describes any way to re-encrypt or recover in that case, and whether the backup job stops when a recipient key is missing. Store a second recovery key in a separate location and test that each key decrypts a sample archive. Document who may approve use of the recovery key, because an unrecoverable archive means lost data.
Questions buyers ask about X-Road backup encryption
What drives the cost of encrypting Security Server backups and who pays?
Cost depends on the written scope, and a quote follows from that scope. DeployOpen does not publish a price list. The main components are the engineering time to enable GnuPG encryption on each Security Server, the work to add recovery public keys, the setup of key custody, and restore testing. Most of this work is one-time. Costs recur only if you add ongoing support, upgrades or continuous testing under a retainer. Three drivers move the price most: the number of Security Servers, since each one has its own backup path to configure and test; the key custody model, such as keys held in a hardware security module or an offline vault; and the restore testing scope, from one restore on a test server to a full rebuild rehearsal across a cluster. Ask the quote to list each server, each key holder and each restore test as separate line items.
How long does it take to encrypt Security Server backups?
The duration depends on the agreed scope, so no fixed figure applies. Timing is driven by the number of Security Servers, whether they run as clustered pairs, how many recovery keys and key holders you need, and whether the key custody model requires your hardware security module or key management team to take part. Restore testing is often the step that sets the pace, because it needs a non-production environment, a recent backup copy and a documented result. A sensible sequence is: change approval, a rehearsal on a non-production server, rollout to production, recovery key exchange, then a restore test. Schedule around your change windows and review cycles, which can set the pace more than the technical work does. Ask any provider to confirm dependencies before committing to dates.
What does our team need to provide for the backup encryption work?
Your team provides access, decisions and a place to test. Typically this includes:
- Administrative access to each Security Server, with a named System Administrator who can make configuration changes.
- A non-production X-Road instance or test server where the change can be rehearsed before production.
- Decisions on key custody: who holds the recovery private keys, where they are stored and who can release them.
- Change approval, maintenance windows and a contact who signs off restore test results.
- Confirmed locations for backup files and PostgreSQL data, with access paths the Security Servers can reach.
If any of these is missing, the schedule usually slips before the technical work starts, so confirm them in the written scope.
Can our own team enable backup encryption without an implementation partner?
Yes, a team with Linux and X-Road operations experience can do the work alone, provided it has time to test before production. Enabling GnuPG encryption, adding extra public keys and proving recovery are configuration changes followed by verification. The deciding factors are whether someone has already restored a Security Server backup, whether the team can rehearse the restore outside production, and whether key custody rules are agreed before the first change. Auditors often ask for evidence of the restore test, so keep dated records of each step. A partner fits best when you want fixed-scope delivery with written deliverables and a retest. Whichever route you choose, confirm the exact steps in the documentation for the version you run, because supported releases are 7.8.3, 7.7.4 and 7.6.5.
How should we store and recover GnuPG keys for backups?
Keep recovery private keys outside the Security Servers they protect, and keep them off the host that stores the backup files. Decide the custody model before enabling encryption. A common pattern is recovery private material held in a hardware security module or an offline vault, with at least two named people able to authorize its use, and written steps for release and return. X-Road supports hardware security modules through PKCS#11 drivers using the xroad-addon-hwtokens package, with RSA and EC keys, but confirm in the documentation whether and how that applies to backup encryption keys. Test every recovery key with a real restore. Record who holds each key, rotate keys when people leave, and review the list of public keys on each server after every change.
What changes for backup encryption after an X-Road upgrade?
Repeat the backup and restore test after every upgrade, because an upgrade changes the server software and can change the files and configuration you back up. Confirm that encryption settings survive the upgrade, that the recovery public keys are still present, and that a restore on the new version succeeds. Supported releases are 7.8.3, 7.7.4 and 7.6.5. X-Road 7.8.0 is the last new-feature release of the 7 line, and NIIS intends to maintain 7 with bug fixes and security patches beyond 2026, although the length of that period is not decided. X-Road 8 is in beta as 8.0.0 Beta 2, with production scheduled for December 2026, so plan a separate backup design if you move to it. Put the restore test in the upgrade change record.
What to do when an X-Road backup leaks
The first task is to establish exactly what the leaked archive contained, because every later decision depends on it. Open a copy in an isolated location and list its contents: the PostgreSQL data, the server configuration, any key material, and whether message log data or its encryption keys were included. Then work out which keys protect it. Identify each GnuPG recipient key the backup was encrypted to, including any extra public keys added for recovery, and check whether the matching private keys or passphrases were stored on the same server or in the same account as the backup. If they were, treat the encryption as compromised along with the archive. Confirm whether the Security Server's signing and authentication keys sit in a hardware security module through the xroad-addon-hwtokens package, because the backup may then hold only references to keys that remain in the module. Finally, confirm which of these keys are still active on live systems, since a retired key is a much smaller risk than one that still signs or decrypts.
Next, rotate everything the archive exposed. For backup encryption, generate a new keypair, remove the compromised recovery keys from the recipient set, and re-encrypt or destroy retained backups that depend on the old keys, following your retention policy. For the server, rotate the Security Server authentication and signing keys and their certificates only after agreeing the sequence with the X-Road operator and the certification authority, since certificate changes affect how other members see your server. Also rotate database credentials, LDAP or PAM service account passwords, TLS keys for the admin UI and information system connections, and any management API keys the archive contained. Message log keys need separate planning: if they were in the archive, rotate them in a way that keeps existing log evidence readable to the people who must review it.
Then review who could use the server. Check the accounts mapped to the five Security Server roles, the LDAP groups or PAM accounts behind them, and any SSH keys on the host, and remove access that no longer has a clear owner. The sibling topics on separating administrator roles and managing management API keys give detailed checklists for these reviews. Check the admin UI login history and API key usage for the period the archive could have been taken from, and confirm that the allowed-hostnames setting and account locking from the hardening guide are still in place. Start a dated incident record now, covering when the leak was found, what was confirmed, who was told internally, and which external notices may apply. Legal and regulatory notification duties depend on your jurisdiction and sector, so ask counsel to confirm them before the technical work is well underway.
How DeployOpen scopes and delivers X-Road backup encryption
DeployOpen treats X-Road backup encryption as a bounded piece of work inside the infrastructure you already run for your Security Server. We agree the scope in writing, build the GnuPG encryption, recovery key handling and message log key treatment in your environment, and document what your operators need to run it.
How we scope
- The written scope lists which Security Servers, backup jobs and GnuPG keys are in scope before any change is made.
- Scope also records who holds each private key, and which recovery keys must be added for your recovery procedure.
- Engagements are fixed-scope, so deliverables and timelines are agreed in writing before work starts.
How we build
- Enable GnuPG backup encryption on each Security Server in a test environment, then repeat the change in production.
- Add the extra public keys for recovery and confirm a restore works with a key held by the recovery party.
- Check that message log keys are inside the backup scope and document how the team verifies it after each change.
How we hand over
- Written runbook covering enabling encryption, adding and removing keys, and restore steps for your operators.
- A leaked-backup response procedure, so your team knows who rotates keys and who notifies internally.
- Evidence records of the configuration and test results, prepared for your compliance team to review.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover.
- Retainers can cover re-checking backup encryption after X-Road upgrades or changes to your key holders.
- Confirm with us which parts of the backup job, key custody and restore testing your team keeps in house.

