Oh boy, I was really tired yesterday when I replied to your question.
I had spent the day looking a logs that when you said your script logged onto a database, I just took it as if what you needed was to write log info, hence the insert permissions on a single table.
Having DB credentials spread around is a natural concern, and as others already said, there is no absolute truth about hidding them on your scripts.
To that concern, I'm still of the opinion that part of the solution is on the DB side.
Depending on the work that the script is supposed to do, the user it uses to log into the DB should have strict access policies.
So, if it has to read information, it should have access only to views to the information. If it needs to write, it should talk to some stored procedures that actually work on the affected tables.
This would make things safer, as that user has limited possibilities of messing around with the DB.
This will not be possible on all databases, but where possible, you have an alternative or second level of protection if used together with the other solutions.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.