Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: DBI & CGI Security

by sunadmn (Curate)
on Jun 03, 2004 at 16:24 UTC ( #360248=note: print w/ replies, xml ) Need Help??


in reply to Re: DBI & CGI Security
in thread DBI & CGI Security

Well the auth on the server side is not a real issue I can hendle that via .htaccess but the security I was and am looking for is more or less for the DBI connect I want to hide that so as to take more of the risk out the DB being compromised, Does that make more sense?

SUNADMN USE PERL


Comment on Re^2: DBI & CGI Security
Re^3: DBI & CGI Security
by Plankton (Priest) on Jun 03, 2004 at 16:47 UTC
    I assume you don't want the users to supply the password for the DBI connect string, right? If that is the case you could store the password in a file (encrypted with some sort of PKI possibly). Just a suggestion, hopefully some monk will give a better one. Also you might want to poke around the Monastery some more. I've seen this issue discussed before here. I asked a simiular question a while back and got many good suggestions.

    Plankton: 1% Evil, 99% Hot Gas.
      You should consider if this is what you're looking for. More convenient would be to make a module doing the SQL connect, and make it chmod 0600.
      ---
      Berik
Re^3: DBI & CGI Security
by samtregar (Abbot) on Jun 03, 2004 at 16:54 UTC
    What kind of attack are you trying to prevent? Are you trying to make it so that an attacker could get into the web server but not be able to get into the database? That's an unusual requirement...

    I'm not sure what the best way to do it would be. Maybe encrypt the DB password and store it on disk. Then require the admin to enter the decryption password whenever the server is started. The server would load the decrypted password into memory and use it to connect to the DB. It's still vulnerable to a root compromise since the plaintext password will exist in memory, but it would keep the password unreadable on disk. You'd still be vulnerable to key-loggers and the like, of course.

    Ultimately it's hard to create a system that can do a given job but won't let an attacker do the same job if they break in.

    -sam

Re^3: DBI & CGI Security
by CountZero (Bishop) on Jun 03, 2004 at 22:20 UTC
    The solution I used on our company's website is to have all the connection done with a module which is outside of the htdocs-tree and hence not easily reachable for web-users.

    Of course (before anyone else says so) if the machine on which your web-server runs is compromised, all bets are off, but then I fear that it is already too late to do much.

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://360248]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2014-10-01 20:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (38 votes), past polls