2

While working a contract for a company that needs data security, I found a python script that a previous person had made which used login details stored in plain-text locally. On a network of roughly 200 users, 7 of which have access to this file, really how dangerous is this practice? Is there any way to make this system secure without making the user type in their login details every time they run the program? Ideally this script runs in the background so long as the computer is on, is there any risk associated with storing the password in memory for that time?

1

Previously when working with automated permissions, I typically would use a controlled group access. With only a handful of people having access to the file, I would say it isn't "dangerous" per se, but it is not good practice. In my past experience letting something like this run amok (plain-text credentials), it will become a pain to update and replace later on when it does become an issue. It would be better to deal with this now than later. Since you mentioned this company needing data security, I would say that this specific case applies and would need to be addressed.

There are a number of ways you could go about this - it depends on what you have access to or what you have already built. Implementing a file that can be imported to the script, which contains usernames as part of specific groups. Then, allowing only appropriate groups permissions to run the file/login. It would depend on the environment/OS you're running this on as well. I would look into Python Keyring as you would be able to implement it in-line with the script.

Obviously going this route, you would be in a similar situation where you would have to lock the permissions file down as well, only allowing key people access to modify said file. An alternative would be using SQL and creating a credential table based on users who should have access, in which permissions would work in a similar way (if these specific people exist in this table, allow access). This could be as simple as usernames/user ID and does not have to include passwords. A comparison to Windows Active Directory could work as well. These are some general examples as I'm not sure what environment you're running on, or if there are any measures that currently exist that would be able to be utilized.

Coming back to your question though, I would recommend implementing a solution. Even something such as creating an encrypted password - anything to get rid of plain-text would be a plus.

0

how dangerous is this practice?

Does the script control the kettle or the missile targeting system?

While encrypting the passwords might seem like it has some benefits, this only means that you need to find a safe place to store the encryption key rather than the password itself.

Is there any way to make this system secure?

It is probably possible to make it more secure - but you've told us nothing about the OS, nor how the password is used. Nor what the threat models are (e.g. do you want to exclude this file from backups). There's permissions, controlled privilege escalation (sudo), file / filesystem encryption, Linux has secrets management facilities, so does MS-Windows. MS-Windows can store credentials securely (and expose ways of invoking the functionality, e.g. via task scheduler). You could go out and buy a Privileged Access management platform like CyberArk. They all have different costs, benefits and shortcomings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.