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

Encrypt private key in database #81

Closed
humphd opened this issue Feb 1, 2023 · 5 comments
Closed

Encrypt private key in database #81

humphd opened this issue Feb 1, 2023 · 5 comments
Assignees
Labels
area: functionality Back end microservices that contribute to our main functionality category: certificates Creating certificates, encryption category: data Anything related to data management and structure discussion Please tell us what you think!

Comments

@humphd
Copy link
Contributor

humphd commented Feb 1, 2023

For a user's certificates, we're going to store both the certificate and private key. The latter we need to encrypt. We need a solution for doing this.

As I understand it, we have 3 options:

We should evaluate these options (and maybe others?) and implement a solution.

@sirinoks sirinoks added category: certificates Creating certificates, encryption area: functionality Back end microservices that contribute to our main functionality category: data Anything related to data management and structure discussion Please tell us what you think! labels Feb 13, 2023
@cychu42 cychu42 self-assigned this Mar 9, 2023
@cychu42
Copy link
Contributor

cychu42 commented Mar 14, 2023

For option 1, it seems possible to do automatic encryption on MySQL side by setting triggers to run AES_ENCRYPT() on each update and insert.
https://stackoverflow.com/questions/50348954/safely-auto-encrypt-mysql-column-using-a-trigger-with-a-key-string

Although I do wonder where would the encryption key be stored in such case. Some research suggests it's safer to store on a separate machine, then the question would be how would the database get the key.

@humphd
Copy link
Contributor Author

humphd commented Mar 15, 2023

Thank you for researching. I wonder if we should abandon this. We can add it post 1.0 if that's important to ITS.

@cychu42
Copy link
Contributor

cychu42 commented Mar 15, 2023

I think it would make sense to ask ITS how they want to handle it, before we do anything, especially option 1 is essentially leaving it up to ITS to encrypt data and possible store that key.

@humphd
Copy link
Contributor Author

humphd commented Mar 15, 2023

I think it would make sense to ask ITS how they want to handle it, before we do anything, especially option 1 is essentially leaving it up to ITS to encrypt data and possible store that key.

I asked ITS as you requested, and they agree to simplify it by keeping it in plain text in the DB for now. Closing.

@humphd humphd closed this as completed Mar 15, 2023
@cychu42
Copy link
Contributor

cychu42 commented Mar 15, 2023

OK, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: functionality Back end microservices that contribute to our main functionality category: certificates Creating certificates, encryption category: data Anything related to data management and structure discussion Please tell us what you think!
Projects
None yet
Development

No branches or pull requests

3 participants