Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Re: Obscuring sensitive data in Perl code?

by Anonymous Monk
on Mar 09, 2001 at 22:20 UTC ( [id://63396]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: Re: Obscuring sensitive data in Perl code?
in thread Obscuring sensitive data in Perl code?

To spell it out more explicitly...

Make your program setgid and make it owned by a new group such as "wwwpass". Hide your database username/password combo in a separate file which can only be read by the group "wwwpass".

Now only your program can read the file. Before it does, have your program authenticate the user somehow. If this authentication fails, just terminate the program. If it passes, go ahead and read the sensitive data from that external file.

This way, even if a user finds out where the sensitive data is hidden, he can't read it unless he uses your program and passes your authentication test.

You can use setuid instead of setgid if you must, but I personally feel safer using setgid and using a new group name which is dedicated to this task alone.

The only drawback to all of this is that you must now ensure that your program will pass "taint" checks. But is that really a drawback?

Buckaduck

  • Comment on Re: Re: Re: Obscuring sensitive data in Perl code?

Replies are listed 'Best First'.
Re: Re: Re: Re: Obscuring sensitive data in Perl code?
by larryl (Monk) on Mar 10, 2001 at 18:12 UTC

    Excellent scheme, thanks! Sorry I overlooked it in the first round of replies! I think a combination of this method and DBIx::Password used in the appropriate spots will work very well.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://63396]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.