I am implementing a python application that will connect to our different servers and computers. They all have different logins and passwords. I want to store all these information in the app directly and ask for one master login/password only. How can I store all these sensitive data in the application so that someone who hasn’t the master password will not be able to access our servers and computers?
EDIT: would it be possible to store an encrypted file to store these data?
EDIT2: My app runs under windows for the moment. I will port it to linux and MAC OSX if possible.
EDIT3: for those interested, I used M2secret + M2Crypto to encrypt a text file. When launching the application, the user has to enter a password which is used to decrypt the file and load the needed credentials into the app. Seems to work like that…
Best regards.
This sounds like a very bad idea. You could encrypt the logins and passwords, but anyone who has access to the master password will then have access to all of the individual logins. That means you can guarantee the individual logins won’t remain a secret for long and if they do leak out you’ll have to change them all.
A better solution would be to give each user of your application their own login on each of your servers. Then you application can use the same login/password for every server it accesses and the password doesn’t need to be stored in the application at all. If one user’s password is leaked you just change their password on all their logins and the other users aren’t affected.
Alternatively route all the logins through a single server proxy: the proxy can be on a secured system so none of the users every get near any of the underlying accounts and you can protect access to the proxy by individual user accounts.
I dug through some of my old code and came up with the following from a module I called ‘passwordcache.py’. See if this helps: