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

Can we avoid plain text passwords for DB connectivity.? We dont want to specify text passwords. #111

Open
reppala opened this issue Nov 22, 2017 · 1 comment

Comments

@reppala
Copy link

reppala commented Nov 22, 2017

# User and password to access the DB server
db_username: <user name to access the db>
db_password: <passwd to access the db>

Encryption or reading passwords from centralized location will help

@raulcf
Copy link
Contributor

raulcf commented Nov 22, 2017

We can add an util to return an encrypted version of the password. Then decrypt it before using it in the connection path. That would fix the issue.

To do that, we can use javax.crypto.Cipher which contains a lot of functionality for this task. This, however, will require a password to decode the encoded password (within the application). The question is then, how do we provide the decipher password? Would giving it as a runtime property ( option -D in the JVM) work? How do people like to handle this?

Another related question is how do we identify whether the password is encrypted or not? Should we have two different fields in the YAML config file (e.g., db_password and also db_password_encrypted?) This would work because we can then check at runtime that at least one has a value and: i) use it directly if not encrypted or; ii) decrypt with the provided decryption password and use.

Does that sound good?

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

No branches or pull requests

2 participants