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

Lagoon-managed BaaS repository keys are not predictably generated #2858

Closed
cdchris12 opened this issue Oct 6, 2021 · 1 comment · Fixed by #2859
Closed

Lagoon-managed BaaS repository keys are not predictably generated #2858

cdchris12 opened this issue Oct 6, 2021 · 1 comment · Fixed by #2859
Labels
2-build-deploy Build & Deploy subsystem

Comments

@cdchris12
Copy link
Contributor

cdchris12 commented Oct 6, 2021

Describe the bug

After rotating some keys internally, we realized that all k8up repo passwords are generated using both the project's name and the lagoons's JWT secret, here:

var projectSecret = crypto.createHash('sha256').update(`${projectName}-${jwtSecret}`).digest('hex');

This means that rotating the JWT will cause the generated value to change, leading to restic passwords which are not generated deterministically. Because these passwords are not the expected value, restic fails to access the backup repository, leading to all operations involving the backup repository to fail (Backups, Prunes, Checks, and Restores)

Expected behavior

Lagoon should generate these repository passwords with a value which can be specified in order to ensure these passwords will not change with every JWT token renewal

@Schnitzel
Copy link
Contributor

my suggestion would be to allow an env variable be injected into the api pods like PROJECT_SECRET_SALT which is used when specified, if not specified the JWTSECRET should be used (like it does today).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2-build-deploy Build & Deploy subsystem
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants