Security concern: --delete option for restic restore? #93
Reference in New Issue
Block a user
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?
Hey together,
because of the nice "little" Wordpress problem recently, we are currently sitting together and are restoring snapshots for wp instances. While thinking about in which ways persistence could be preserved even after a restored backup, i thought about the following scenario:
In php applications, there are often autoload mechanisms for plugins and some other parts of modular code (which for sure is going to be the case also in other applications), and so planting executable code for attackers in these spaces is a common practice.
Now to the problem:
Currently it seems, we are calling the restic restore without the delete parameter, which means, when i did not miss anything, that if a file exists in destination but did not exist in the snapshot, it remains untouched.
Which means, any maybe arbitrary additionally placed php file, will stay in the instance in this case, which would be a concerning security risk.
Is this behavior intentional? I think we should change this that --delete is a default behavior
https://restic.readthedocs.io/en/v0.19.1/050_restore.html seems to support what i am thinking.