Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: add Host-level access control #248

Closed
mirabilos opened this issue Jul 17, 2023 · 6 comments
Closed

FR: add Host-level access control #248

mirabilos opened this issue Jul 17, 2023 · 6 comments

Comments

@mirabilos
Copy link

Output of rest-server --version

rest-server version rest-server 0.11.0 compiled with go1.17.6 on linux/amd64

What should rest-server do differently?

Add per-user Host-level access control: for each HTTP-level user, add the ability to provide a whitelist of Hosts they may see (to back up to, restore, inspect, etc).

What are you trying to do? What is your use case?

I have multiple servers backing up to the same repository to use deduplication, but not all of them are (yet) full-disc-encrypted. Since I need to use the same repository password to make use of deduplication, a root breach on one can be used to access all others’ data.

(On that topic, once this is implemented and/or once I will have converted all servers to FDE, how do I change it to achieve a secure state?)

Did rest-server help you today? Did it make you happy in any way?

I was very sceptical at first, especially because these things are implemented in issue9, but I’ve begun using it once I had more than one GNU/Linux box under me. I’ll have to find a solution for my BSD boxen for which there’s no issue9 port but even manually-triggered backups there are better than none (just rsync copies of actual user data), especially to save system re-setup time.

So, yes, it does help me (restic + rest-server). Danke, fd0!

@wojas
Copy link
Contributor

wojas commented Jul 19, 2023

Add per-user Host-level access control: for each HTTP-level user, add the ability to provide a whitelist of Hosts they may see (to back up to, restore, inspect, etc).

I would recommend always running production-level rest-server instance behind an HTTP server like nginx or caddy, which offer all kinds of extra features, including the ability to block by remote IP address.

I have multiple servers backing up to the same repository to use deduplication, but not all of them are (yet) full-disc-encrypted. Since I need to use the same repository password to make use of deduplication, a root breach on one can be used to access all others’ data.

If individual servers are not allowed to read data from other servers, do not give them access to the same repository.

Disk encryption will only help if someone steals the physical servers or manages to somehow get a copy of the disk images. Your IP blocking may help mitigate the impact in this specific scenario.

It does not protect you, however, if someone manages to gain remote access to one of the servers. In this case the attacker can access all data from all servers anyway.

PR #140 adds the ability to use multiple users to access the same repo. It has been open for a while, I guess I should update it. It would probably be a prerequisite for any non-global IP restrictions anyway.

@mirabilos
Copy link
Author

mirabilos commented Jul 19, 2023 via email

@MichaelEischer
Copy link
Member

Add per-user Host-level access control: for each HTTP-level user, add the ability to provide a whitelist of Hosts they may see (to back up to, restore, inspect, etc).

The Host concept from within a restic snapshot is not visible at all to the rest-server.

Since I need to use the same repository password to make use of deduplication, a root breach on one can be used to access all others’ data.

That's a fundamental limitation that cannot be solved at all at the rest-server side. Either the rest-server would have to become able to manage individual blobs uploaded by the clients (which would require a server-side that's somewhat related to that used by borgbackup and massive changes to restic) or restic would have to implement restic/restic#187 together with some way to share blobs across different clients/encryption keys (no idea how that could be implemented, even more complex than the first option).

On that topic, once this is implemented and/or once I will have converted all servers to FDE, how do I change it to achieve a secure state?

In place reencryption is not supported. Thus, you'd have to create a new repository and copy the snapshots over. Or assume that the key files haven't been compromised and just change their password.

I was very sceptical at first, especially because these things are implemented in [...]

@mirabilos I'd like to remind you of #184 (comment) .

@MichaelEischer MichaelEischer closed this as not planned Won't fix, can't repro, duplicate, stale Jul 22, 2023
@mirabilos
Copy link
Author

mirabilos commented Jul 23, 2023 via email

@MichaelEischer
Copy link
Member

The 070_encryption page mentions it’s possible to add a key. But if I add one, it’s not usable to decrypt any existing snapshot, because it’s a separate encryption key, not a keyslot to the same encryption key like in LUKS?

All keys in a repository contain the same masterkey, similar to the keyslots in LUKS. That is the password you pass to restic is used to decrypt the matching keyfile. A new key will therefore provide access to all snapshots.

@mirabilos
Copy link
Author

mirabilos commented Jul 23, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants