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

Retention policy #27

Open
LadyMikea opened this issue Jun 12, 2023 · 11 comments
Open

Retention policy #27

LadyMikea opened this issue Jun 12, 2023 · 11 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed next
Milestone

Comments

@LadyMikea
Copy link

LadyMikea commented Jun 12, 2023

Looking for convert my scripts to Npbackup, only three things are missing: retention policy, deleting a snapshots and prune option. As I understand, currently they are not directly available? I suppose "post-exec" command may be used for this purpose.

@deajan
Copy link
Contributor

deajan commented Jun 13, 2023

ATM, I use NPbackup with append-only rest-server so I didn't implement the gui, although the delete command already exists in CLI.

I'll have retention/prune/deletion implemented in 2.3 which should come next month.

Post-exec commands don't have access to environment variables for security reasons.

@deajan deajan added the enhancement New feature or request label Jun 13, 2023
@deajan deajan added this to the 2.3 milestone Jun 13, 2023
@deajan deajan self-assigned this Jun 13, 2023
@LadyMikea
Copy link
Author

I see, right, there's "--forget" command. Thanks for info.

@deajan
Copy link
Contributor

deajan commented Aug 31, 2023

Retention policies are being developped in v2.3.
As of now, I will allow setting --keep-X or -keep-within-X variables for hours, days, weeks, months and years.
Any special requests ?

@deajan deajan added the next label Aug 31, 2023
@deajan
Copy link
Contributor

deajan commented Aug 31, 2023

Also, I'm developping a multi repository version, in order to have that privileged client that can check/forget/prune.

I'll happily take requests. Of course the gui is ugly for now as in dev :)

image

@LadyMikea
Copy link
Author

Thank you! Multi repository version looks very useful. I have multiple usb backup destinations with multiple sources path: usb-X, usb-X/music, usb-X/pictures, usb-X/etc (each source directory has own sets of rules, has own npbackup.cmd script). I understand, multi repository version allows grouping together all sources under one repository (usb-X) and each source can retain own tags and sets of rules?

@deajan
Copy link
Contributor

deajan commented Sep 12, 2023

The idea of multi repository version is double:

  • Have a special privileged client (the only one with delete permissions) that can handle retention strategies for multiple repositories
  • Have a standard client with default settings, and repositories which inherit from default settings when no specific overrides are set

Willing to take comments and ideas at this stage ;)
Currently developping the settings inheritance.

@deajan
Copy link
Contributor

deajan commented Dec 6, 2023

Customer request: Have another client that doesn't have restore privileges.
That makes alot of different clients for each privilege level:

  • backup only
  • backup, restore and check repo health
  • backup, restore, check repo health and retention policies

Now the question is, how to bake the privileges into the client, without being overridable just by editing the config file.
An easy way to do so would be to bake the privileges directly into the repo URI.
This way, when a malicious user modifies the config file, he will loose access to the repo.

The tricky part is the encryption algorithm. One that has access to the source code of NPBackup, can use it to decrypt the config file, thus getting the required privileges.
As of today, I resolve this by using private builds with non public symmetric AES encryption keys.
Using asymmetric encryption like RSA won't help here, since the client still needs to decrypt the repo URI & passwords.

Possible solutions:

  • load encryption key from alternate file (supposes the client's integrity is safe)
  • load encryption key from key server (makes it really harder to get the key, but backups won't work without internet access, which is quite lame for a backup program)
  • Limit client's permissions server side (via rest-server or s3): can be sufficent for deletion / retention policy permissions, but not for restoration / health check since this only requires read permissions
  • Use a magica unicorn

I'm all out of unicorn magic.
I think the best way is a hybrid solution where the server limits deletion permissions, and the client has repo URI baked-in restore/check permissions, which are less secure, but then again, if you get restore permissions to any data that you already own, unless you dedup alot of different clients into the same repo, which is specifically the case I'd like to address here.

Any better magic unicorns are welcome ;)

@deajan deajan added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Dec 6, 2023
@LadyMikea
Copy link
Author

Well, I am just a home user using couple of usb drivers, so all those multi user encryption grade stuff is well above my pay-grade ;) Dunno, maybe some simple "no-so-secure" path for home user would be helpful, while maintaining options for advances users like admins and/or multi users environments.

@deajan
Copy link
Contributor

deajan commented Dec 6, 2023

Well, I am just a home user using couple of usb drivers, so all those multi user encryption grade stuff is well above my pay-grade ;) Dunno, maybe some simple "no-so-secure" path for home user would be helpful, while maintaining options for advances users like admins and/or multi users environments.

Sorry, I used this issue as "idea notepad" ;)

May I ask, do you use a remote server ? If so, which kind ?
Also, do you want your backup client to be able to modify the remote repo or not ?

@LadyMikea
Copy link
Author

No problem! No, I do not use a remote server for now. Just a few usb drivers acts as a local storage. So, every thing is "on the site". In the future maybe I'll use a proper NAS, so ability to control remote repository will be handy.

@deajan
Copy link
Contributor

deajan commented Dec 6, 2023

Thanks for your answer ;)

@deajan deajan mentioned this issue May 10, 2024
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed next
Projects
None yet
Development

No branches or pull requests

2 participants