[Feature]: Restore an environment to an earlier point in time
Self-hosted secrets manager that keeps .env secrets from AI agents
Brought to you by:
dopbase
Originally created by: thomijasir
Restore every secret in an environment to how it was at an earlier point, the way Doppler rolls back a config change. This includes bringing back secrets that were deleted.
[#33] adds per-secret history and rollback. Each key rolls back on its own, and deleting a key removes its history.
A bad import or bulk edit can change many keys at once. Rolling them back one by one is slow and easy to get wrong.
dopbase environment history ENVIRONMENT lists change sets. dopbase environment rollback ENVIRONMENT CHANGE_SET restores the environment to the state after that change set, as new versions.Rolling back across environments or projects.
Requires [#33].
Originally posted by: bosd
Checked this against the compliance direction from [#119] (audit evidence, retention, tamper evidence, auditor role). The direction fits: one-step recovery from a bad import or bulk edit is a recovery control, change sets carry actor and time, rollback writes new versions instead of editing history, and diffs stay masked. Three things to settle before implementation:
Bound tombstone retention. Today deleting a key removes its history (#33). With tombstones, a deleted secret's ciphertext would be kept indefinitely, which conflicts with the archive-then-delete retention from [#119] and leaves operators no way to really remove a leaked credential. Suggest a configurable period after which a tombstone loses its ciphertext (metadata stays), plus an explicit, audited purge for immediate removal.
Access control and audit events. Environment rollback has a larger blast radius than per-key rollback, so it should need the same as [#33]: project manager, recent authentication for browser sessions, the CSRF header, and runner/service-account/agent tokens refused. It needs its own audit event (e.g.
environment.rolled_back) naming the target change set and the affected keys, never values. Please also state what the auditor role can see: change-set metadata yes, masked diffs or values no.Atomicity with pruned versions. [#33] drops ciphertext beyond the newest N versions per key. An environment rollback that needs any expired version (or an expired tombstone) should be rejected as a whole and write nothing, rather than restoring part of the environment.
Smaller: master key rekeying and backup restore must cover tombstones, as [#33] requires for
secret_versions.Related
Tickets:
#119Tickets:
#33