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

os-git-backup: Git Backups shouldn't contain secrets #4464

Open
3 tasks
eddster2309 opened this issue Jan 12, 2025 · 2 comments
Open
3 tasks

os-git-backup: Git Backups shouldn't contain secrets #4464

eddster2309 opened this issue Jan 12, 2025 · 2 comments
Labels
support Community support

Comments

@eddster2309
Copy link

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug
Currently Git backups contain many secrets including (at least in my install) Git Private key for the same plugin, and cloudflare secret.

I understand this is a large body of work considering how the current backup and config storage works, so maybe a good stop gap is to add a note to the docs so users are at least aware of the risks.

To Reproduce
Steps to reproduce the behavior:

  1. Configure Git Backup
    
  2. Secrets will be included
    

Expected behavior
Secrets to be removed from config.

Screenshots
N/A

Relevant log files
N/A

Additional context
N/A

Environment
OPNsense 24.7.11_2-amd64
FreeBSD 14.1-RELEASE-p6
OpenSSL 3.0.15

@fichtner
Copy link
Member

What are we trying to avoid? People pushing their configs to a public GitHub repository? Partial backups, especially with arbitrarily removed secrets is not useful to anyone, or at least not for backup purposes.

Cheers,
Franco

@fichtner fichtner added the support Community support label Jan 12, 2025
@Leseratte10
Copy link

Leseratte10 commented Jan 22, 2025

Maybe this change would also be relevant for the other backup methods / plugins?

Looking at a plain configuration export, it looks like your choice is either to download a plaintext config including all passwords, or download a fully encrypted config file that can't really be used in version control.

I guess the use-case could be a semi-public repository. Like if you want multiple people (other members in your household or company or whatever) to be able to view the revision / change history on your OpnSense machine (by giving them read access to the repo) but you don't necessarily trust them with full access to all credentials and secrets.

Routers by AVM, for example, have solved this issue by offering a partially-encrypted configuration backup. When exporting your config file, you get the option to enter a password, and then only things like passwords will be encrypted in the config file, everything else in the config will be plain text.

Everyone with access to the Git repo could then read the commits to check which changes have been done, and they'll be able to see when a password was changed, but they won't be able to access the password without having the backup encryption password. That way the backup would still be useable (as you can restore it when you know the password) and could still be used by plaintext tools like git diff (unlike the current encrypted backup format), but still ensure that you can't just grab all the secrets from it.

The only downside is that there would need to be a list of "secret" attributes somewhere that needs to be maintained so that the backup code knows which fields need to be encrypted with a password prior to pushing the config to a Git repo.

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

No branches or pull requests

3 participants