Every now and then, I'm reminded off this little dilemma, as did a recent posting on the monastery: securing your scripts/passwords.
The use of databases in conjunction with Perl (or whatever language for this matter) to generate dynamic content websites increases, and usually you need an account (username/password) to connect to the database daemon.
As I explained in my reply to the before mentioned posting, the problem comes in when there are other users on a server (and a lot of us can't afford our own dedicated machine ... I think). Since Apache (or whatever http daemon) needs to be able to read the script and passwords, so can almost every other user on the system.
I once had an account on a webhosting company's machine and just used a few shell commands to grep through some files in the other users' "web directories". Shockingly (or not), I got close to all users' passwords to the databases, which -how bad- were identical to their shell accounts (please note: I had the company's OK on this little test). A few users with some clue disabled reading permissions in their "web directory" making the quest a little harder, but a less /path/to/specific/dir/index.cgi did wonders (you can read what files are included from there on).
How to prevent such horrible people (like myself) to snoop the passwords, or better yet, how to make the damage as little as possible? I've heard that RSBAC on Linux machines could possibly help, but how many people are going to persuade a company to implement this (and succeed)?
So far, I have thought of the following things that could shoo clueless scriptkiddies away:
So far, I think the last option is the best (don't store passwords for updating accounts at all, but prompt for them), but I'm curious about other "solutions".
In reply to Securing your scripts on webhoster's server by b10m
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |