I'm looking for a way to store a database password on the working machine so that my own application can read it (in order to connect to the database) but a user without administration rights cannot read it. It must be possible for an administrator to change the password, preferably automatically.
What I have in mind is something like the .pgpass file for PostgreSQL in a Linux environment. Is this possible in a Windows environment as well?
I think the password file can be made accessible for administrators only. But can a program, which is executable for the user, access this file as well? Further, is it possible with the help of group policies to distribute such a file via the network?
Other solutions that I'm thinking about (probably with more effort):
- Encrypt the password file. Only the application and the administrators have the valid keys to decrypt and change / read the file.
- Retrieve the password from a network resource, presumably encrypted as well.