feat: Retrieve ENCRYPTION_KEY from backup server - #363
Open
adskyiproger wants to merge 1 commit into
Open
Conversation
adskyiproger
force-pushed
the
ocrvs-10927
branch
from
August 10, 2026 12:29
f8da364 to
e4da406
Compare
adskyiproger
force-pushed
the
ocrvs-10927
branch
from
August 10, 2026 14:36
e94ed15 to
75fd2a4
Compare
euanmillar
reviewed
Aug 14, 2026
| disk_encryption_key: ${{ secrets.ENCRYPTION_KEY }} | ||
| repository: ${{ github.repository }} | ||
| backup_encryption_passphrase: ${{ secrets.BACKUP_ENCRYPTION_PASSPHRASE }} | ||
| backup_server_user: ${{ secrets.BACKUP_SERVER_USER }} |
Contributor
There was a problem hiding this comment.
@adskyiproger do we need to amend the environment:init script to add / update these new secrets?
Contributor
Author
There was a problem hiding this comment.
We don't introduce new secrets to environment:init, we will reuse existing secrets. There is no need to update anything there.
euanmillar
reviewed
Aug 14, 2026
| # Disk Encryption key location as an example (in production use a hardware security module) | ||
| # Disk Encryption key location: | ||
| # On single server deployments, the disk encryption key is stored on the same server as encrypted data. | ||
| disk_encryption_key_path: /root/disk-encryption-key.txt |
Contributor
There was a problem hiding this comment.
@adskyiproger there seems little point in encrypting any single server that doesnt have a a backup, as that would be a QA environment right? Every production or staging server has a backup.
Contributor
Author
There was a problem hiding this comment.
Single server environments will continue to work by existing way. We are making assumption that development and QA environments don't have PII data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related issue: opencrvs/opencrvs-core#10927
This PR adds a more secure decrypt-on-boot flow for environments using OpenCRVS disk encryption. The goal is to help protect citizens’ data in the event of physical intrusion into a data centre, especially for countries that do not already have hardware-backed or platform-level disk encryption in place.
Backup server is always required for staging and production environments.
For environments with a dedicated backup server, the disk encryption key can now be stored remotely in encrypted form and retrieved during boot only when needed. For environments without a backup server, the existing local key-file flow is preserved.
Testing
Provision on existing environment: https://github.com/opencrvs/opencrvs-testland-infrastructure/actions/runs/31385870887
Provision artifacts:
Kubernetes master has

backup-encryption-passphrase.txtBackup server:
Reboot test (all conditions are good)
Encrypted partition successfully mounted:

Kubernetes is up:

Reboot test (backup server is not available)
No mount point for encrypted partition:

Kubernetes is not running:

Login on broken system:
