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

Allow for user signup and secure storage of user secrets in DB #26

Closed
trello-issues-app bot opened this issue Feb 6, 2025 · 2 comments
Closed
Labels
trello This issue was auto-created by Trello

Comments

@trello-issues-app
Copy link

Note

This issue was auto-created by a Trello x GitHub integration

Original Link: Allow for user signup and secure storage of user secrets in DB

Card Contents:

  • Create users in database. Templates can be stored per-user and can be made public
  • Provider secrets will be stored in DB. Maybe encrypt with PBKDF2?
  • Admin user can provision networks and add VPNs
  • User accounts can view docs/network diagram/download VPNs
    • Need to figure out how users will be shared to range
@trello-issues-app trello-issues-app bot added the trello This issue was auto-created by Trello label Feb 6, 2025
@Adamkadaban
Copy link
Member

Setting up DB + Encryption

  1. On user registration, PBKDF2/Argon2 (the latter seems to be better nowadays) will be used to create an encryption key (MK) for the user.

  2. A RSA public/private key pair will also be generated

  3. Public key is stored in DB as-is. Private key is stored encrypted with the MK from step one.

  4. When a user wants to add new AWS/Azure secrets, it can easily be encrypted with the public key in the database.

  5. When deploy endpoint is called (ie. when the secrets need to be decrypted), the private key will be decrypted and the private key will be used to decrypt the secrets.

How step 5 will get the MK:
How will the frontend/CLI store the master key once a user logs in?.

  1. On login, the API will generate the MK and send it back in a response to be stored in an http-only secure cookie.
  2. Cookie from step 1 will be attached with every request. It will only be stored in-memory for API endpoints that need them.

@Adamkadaban
Copy link
Member

Solved in #56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
trello This issue was auto-created by Trello
Projects
None yet
Development

No branches or pull requests

1 participant