Let’s say you have access to a remote machine and use it to copy backups occasionally, eg with rsync. Your local machine has credentials stored that allow write access on the remote machine, however if the local account was compromised that could also allow access to the remote machine and the data stored there.
How can you grant access to an account to write remotely, but also protect the data from this account? One possibility could be to change the permissions on the data after it is copied to prevent deletion/interference, although I’m just making this up. Is there a standard practise for this?
Do pull backups instead of push backups: Backup server connects to local machine.
That’s an interesting idea
What’s the rationale for this? Genuinely curious.
The reasoning is that your backup server should be more secure than production. Production has to have a bunch of stuff open in order to be useful and convenient. The backup server does not. It can be basically fully locked down.
To add - by doing pulls the backup server uses different credentials to run than the credentials used to perform pulls.
Backup server has it’s own credentials database, machines being backed up have their own database. Backup service in backup server uses appropriate credentials from machine being backed up to access the data there (shares, etc). So credentials from compromised machine are unrelated to credentials for backup server.
And if backups are done properly (full on a schedule, daily incrementals, or something similar) you should be able to revert to a known-good state with minimal data loss.
If the main site gets compromised the credentials there must be considered lost and known to che attackers.
with a pull backup that’s not an issue because the main site has no access to the remote system; it is a process on the remote site that has credentials to access the main site and not the other way around.
the remote system may
receiveretrieve a compromised copy of the data, but the attacker cannot tamper with previous backups so recovery is still possible.That makes sense. I use NFS, so there are other controls for security because “offsite” is another building on my property, but still in the same pool of subnets…
This is the main reason I had in my head about pull backups. Thanks for the explanation.
Why downvote this?
The suggestion I have heard is to have the remote machine connect to the machine on a schedule and pull the backups onto itself. Then your local machine doesn’t have direct access to the backups, making it harder to compromise the backups if hacked. But this also assumes the backup machine is locked down and isolated so it is lower risk than the local machine.
Append only mode.
Just a small sidenote: If you do not trust your local machine you should think about why and how to change that.
Well I think she amount of caution is still appropriate no matter how much you manage to secure the local machine
Of course, of course :)
A system like proxmox backup server can do this scurely. There you can create a user that can only add new backups and read the existing ones, but cannot delete any or read anything else on the remote host.
Otherwise if you only care to protect the remote machine, then something like an ssh chroot jail would also work.
Scheduled snapshots (btrfs or zfs). If the compromised account deletes or modifies files, they’re still there in the past snapshots
Filesystem-level snapshots are quite space-efficient because they don’t make copies of all the files or even whole files; just the blocks that changed.
Append only, like others are saying.
I have solved that by giving the distant machine the credentials to connect to the local machine. And the distant machine can’t be accessed from the outside.
Yes that sounds like pull backups, which is worth exploring
Personally as some extra spice as I worry about ransomeare, I have a few key files I check across my array that should never change. If any of their hashes are off, I abort immediately.
Yep offline backups are useful, although it does require remembering & making the effort to do it each time
Certainly sounds relevant, although overall it is quite a different approach than in currently using
For doing snapshots did that means the local system identifies the changes? Or it all gets copied each time?
Yes that seems like one way to go. Although I am using rsync so maybe keeping the files in place and changing owner could be an option
Are you connecting to the victim to push a backup into storage? If so, there’s SO much you should improve on that.
Go on.
What are the vulnerabilities that you’re afraid of? Can you answer this purely from the info OP gave, i.e. without making assumptions about what the server authorizes the phone to do? OP’s post does not indicate that they’re violating the principle of least privilege in any way.
OP’s post does not indicate that they’re violating the principle of least privilege in any way.
If I wasn’t sure whether that was a risk, I would have asked whether that’s what was going on. Oh, wait: I did, right? I used a question mark and everything.
Encrypt before send, and if you want to have protection against deletions of the data have a cold backup offline other than during the copy.





