The Data Protection key ring is encrypted at rest: with a configured certificate on every platform, or with DPAPI on Windows when none is set #42
Labels
No labels
agent
api-regen
agent
architect
agent
coder
agent
console-coder
agent
docs-writer
agent
mechanic
agent
protocol-coder
agent
storage-coder
area/api
area/ci
area/console
area/dhcp
area/dns
area/docs
area/packaging
area/process
area/storage
area/windows
kind
bug
kind
chore
kind
docs
kind
epic
kind
feature
kind
performance
kind
security
kind
test
priority
high
priority
low
priority
medium
resolution
duplicate
resolution
not-a-bug
resolution
wontfix
status
blocked
status
in-progress
status
needs-decision
status
needs-design
status
ready
theme
ad-samba-dns
theme
alternatives-benchmark
theme
console-toolchain
theme
later
theme
parity-devices
theme
parity-query
theme
post-release-fixes
theme
tracker-setup
theme
valkey
theme
windows-installer
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lantea-one/ninlil#42
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Program.cs:186-189persists the key ring withPersistKeysToFileSystemand noProtectKeysWith*(grep finds none insrc/dotnet/src). On Linux the folder is owner-only(
Program.cs:172-179); on Windows the README tells the operator to restrict it withicacls. Therelease notes list this as an accepted risk (OD-B19-d = a, owner 2026-10-16). The key ring unlocks
TSIG secrets, DNSSEC private keys, TOTP keys, the OIDC client secret, the SMTP password, cloud and
webhook credentials and the ACME account key.
What changes
DataProtectionKeyRingOptions, sectionDataProtection, read inProgram.csbefore the key ring is configured:
CertificatePath(a PFX),CertificatePassword(a secret),and
PreviousCertificatePath/PreviousCertificatePasswordfor a certificate change.ProtectKeysWithCertificate,plus
UnprotectKeysWithAnyCertificatewith the current and previous certificates, so keyswritten under the previous certificate still decrypt while both are configured.
ProtectKeysWithDpapi. Decide and justify the scope (machine orthe service account); the service account is the stricter choice when it is stable across
upgrades.
protected. Check and document what happens on Windows when a certificate is added after DPAPI
was used: DPAPI-protected keys must still decrypt on the same machine and account.
(
Ninlil.Dns.Server.Backup/SystemBackupService.cs:508-515,831) and cluster nodes that share aring. Check what a restore does today when the restored keys cannot be unprotected (DPAPI from
another machine, a missing certificate) and make the error name the cause and the setting.
Windows machine or account; anyone who may restore a backup on another machine should
configure a certificate, on Windows too, and back the certificate up separately from the data
directory. CHANGELOG
Unreleased(the accepted risk is updated).OptionsEnvironmentVariableRegistry(new top-level class), ENVIRONMENT.md rows and totals.Acceptance
plaintext
<masterKey>; a secret stored before the switch still decrypts; a backup restoredon the same host decrypts; with the certificate replaced and the old one set as previous,
old secrets still decrypt.
dotnet test src/dotnet/tests/Ninlil.Dns.Identity.Testspasses.service restarts and reads its secrets; with a certificate configured, the new key file is
certificate-protected, not DPAPI, and a backup restored on another Windows machine with the
same certificate decrypts.
Source
d-design.md:393("protect Data Protection keys at rest (ProtectKeysWith*, OD-B19-d)"),bughunt-plan.md:509,534. Merged from BUG-40 (DEDUPE.md).Owner decision 2026-10-31 (Q-REL-12 = Q-BUG-5): "DPAPI on Windows + optional certificate on Linux".
Owner decision 2026-10-31, round 2 (R2-KEYRING): "certificate preferred on Windows too when set,
DPAPI only as fallback; README advises the certificate for anyone who may restore on another
machine".
Ghost referenced this issue2026-11-05 01:06:37 -05:00
Ghost referenced this issue2026-11-05 21:23:40 -05:00
Ghost referenced this issue2026-11-05 22:09:08 -05:00
Ghost referenced this issue2026-11-06 01:41:02 -05:00