CAVEAT: This is mostly an intellectual exercise, since in case my user would get compromised, there is an entire cascade of events that could make this protection mechanism totally useless. Nevertheless, I think it's an intriguing case.
Because of the recent ransomware news, I got curious about fine-grain management of file permissions on Linux for my workstations. Microsoft recently announced that future versions of Windows will have a permission protection mechanism that will prevent all applications to be able to access all the files independently from the specific user permissions.
That got me thinking if it's already possible to implement this kind of mechanism in Linux by using ACL.
Say, I have machine with an external hardisk used for backups, which gets mounted every night at 2AM, before the backup starts. My user has writing permissions on that disk, and the files written there belong to me. Therefore, if my user would get infected by a ransomware which would run after 2AM, it will be able to see and encrypt the backup disk.
One trivial solution that I thought of would be to execute the backup with a dedicated user (e.g., backup), which can read my files. The backup program will then create backups (i.e., keeping my original ownership) inside a directory for which my user doesn't have permissions. The basic Unix permission scheme will prevent my user to access any files inside a directory for which I don't have permissions, though this doesn't look that elegant.
Would it be possible, for example, set specific ACL permissions that would prevent a user to read files owned by him/her?
Or is there a totally different approach that's even better than this? (no cheating with remote ssh/sftp backups :)