I have an existing Java web application running on Linux using embedded Jetty. The application is loaded using jsvc, which runs as root, listens on port 443, and relays requests to the Java app, which is run under a less privileged user "appname" on port 8443.
Currently, the application reads an encryption key from a file we'll call "secrets.properties". It is writable by "root", and readable by "appname" (technically, by members of the "appname" group). My preference, however, would be that the file is only readable by "root", and that jsvc reads the file and passes the contents of that file (or even just a single property) to the application. My goal is that if someone were able to subvert the app and gain system access with the app's "appname" account, that they couldn't retrieve the key.
Is that possible without having the key visible to someone running "ps -ex"?