You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refuse an instance backup restored under another archive's name #439
A restore authenticates an instance backup (ADR 0026): its HMAC proves that a server holding the backup key made it. It does not prove that the archive is the one the operator asked for. Someone who can write where archives are kept (an S3 bucket, or a plain HTTP path with SHIPKEEP_BACKUP_S3_ALLOW_HTTP=true) can put an older valid archive of the same installation in the requested one's place. The restore would then bring back an older state.
Today the restore prints the archive's creation time, and INSTALL.md asks the operator to check it (#428).
Proposal
Bind the archive's name into its manifest, under the HMAC:
backup.sh create passes the name it chose to backup.js create, for a local file and for S3;
restore passes the requested name, and the restore refuses an archive whose manifest names another one.
This is a format change (manifest version 2). Version 1 archives are still accepted, with a warning.
Acceptance
Restoring s3:A when the storage serves archive B under that name is refused before anything changes, with a test.
Activity
fix(api): a restore checks the whole archive before it stops anything
fix(api): an instance backup is restored only under the name it was c…