Any ideas? Is passing a password as argument to a process nothing to worry about?first result https://docs.oracle.com/javadb/10.8.3.0/adminguide/cadminsslclient.html shows setting the password as system property right before making your first database connection.
If some java appliation is supposed to use a trustStore, then apparently
all hits on google for the obvious words will suggest to start the application
with an option "-Djavax.net.ssl.trustStorePassword=..." passed to the java executable...
Assuming I do not want everyone on the machine to see the password in clear text in the "ps -ef" output, what would be "safer" alternatives?
The most obvious one might be to set the property from my own code, (after reading the pw from a file that not everyone on the machine has access to) but my code comes too late: some beans already got initialized and didn't
see the property, before the program gets to set the properties. --
I'm not a master of beans... maybe I could just add another bean that
would do the "setProperty" as a sideeffect just in time before the other
bean needs the property... haven't thought this through, yet.
Maybe I'm still in the stone-age, and there is already some new property that would allow me to just specify another file holding the relevant passwords, or something else?
Any ideas? Is passing a password as argument to a process nothing to worry about?
Any ideas? Is passing a password as argument to a process nothing to worry >> about?first result https://docs.oracle.com/javadb/10.8.3.0/adminguide/cadminsslclient.html
shows setting the password as system property right before making
your first database connection. How and when are you making your
database connection?
I normally make database connections using datasource in the tomcat
config files with the password in the config as an encrypted string
and reference a decryption jar.
On 1/26/2023 1:59 PM, Andreas Leitgeb wrote:
Any ideas? Is passing a password as argument to a process nothing to worry >> about?A password in visible plain text is at least a potential problem.
You have some code that are not yours that use this property.
Your regular code that runs later cannot change that property when needed. You need to get some code to run before the code using this property.
Startup servlet may be too unreliable timing wise.
Some googling indicate that a ServletContextListener and doing
it in contextInitialized may be better.
That sounds like a promising solution...
Could I set them e.g. in the server.xml ?
If some java appliation is supposed to use a trustStore, then apparently
all hits on google for the obvious words will suggest to start the application
with an option "-Djavax.net.ssl.trustStorePassword=..." passed to the java executable...
Assuming I do not want everyone on the machine to see the password in clear text in the "ps -ef" output, what would be "safer" alternatives?
The most obvious one might be to set the property from my own code, (after reading the pw from a file that not everyone on the machine has access to) but my code comes too late: some beans already got initialized and didn't
see the property, before the program gets to set the properties. --
I'm not a master of beans... maybe I could just add another bean that
would do the "setProperty" as a sideeffect just in time before the other
bean needs the property... haven't thought this through, yet.
Maybe I'm still in the stone-age, and there is already some new property that would allow me to just specify another file holding the relevant passwords, or something else?
Any ideas? Is passing a password as argument to a process nothing to worry about?
The tomcat-config is already readable only by the user running it,
which would be a huge advantage to current state where the password
shows up in process list visible even for other users.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 26:50:53 |
Calls: | 10,390 |
Calls today: | 1 |
Files: | 14,064 |
Messages: | 6,417,061 |