Menu ▾ ▴

#135 [Feature]: Restore an environment to an earlier point in time

open
nobody
2026-10-23
2026-10-23
Anonymous
No

Originally created by: thomijasir

Feature description

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.

Current behavior

[#33] adds per-secret history and rollback. Each key rolls back on its own, and deleting a key removes its history.

Why we need this

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.

Proposed direction

  • Group the version rows from one write (a single set, an import, or a rollback) into a change set with an ID, actor, and time.
  • 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.
  • Keep a tombstone for deleted keys so they can be restored instead of purging their history.
  • Show change sets in the web UI with a per-key diff (values masked) before confirming.

Out of scope

Rolling back across environments or projects.

Dependencies

Requires [#33].

Related

Tickets: #136
Tickets: #33

Discussion

  • Anonymous

    Anonymous - 2026-10-23

    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:

    1. 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.

    2. 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.

    3. 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: #119
    Tickets: #33


Log in to post a comment.