In Understanding Secure File Organization thread, I asked where library code should go and received several useful comments. In trying to implement these ideas, I've tumbled to a new layout that might be better. I'd appreciate some feedback and constructive criticism:
For the sake of the discussion, let's assume that we're dealing with simple *read-only* database applications (a search using SQL SELECT queries, for example).
With this in mind, what do the Monks think of this directory layout?
virtual server home dir\ | + httpd\ # contains the pages accessed by web (nobody) | + cgi\ +- cfg\ # holds functions to return local config values. +- bin\ # scripts executed by forms +- lib\ # application and toolkit libraries +- data\ # data files
When reviewing the above, please keep the following points in mind
The web server maps \cgi-bin to \cgi\bin.
Permissions (assume *nix server and Apache) are set appropriately.
\cgi\bin is the only directory referenced on the HTML forms in httpd\.
\cgi\bin only contains scripts invoked by forms in httpd\.
Other appropriate security measures (those from the man pages and the FAQs) are in places, e.g. tainting, no user supplied filenames, params are verified, caller is verified, path has been massaged, uploads have been disabled, etc.)
\lib only contains the libraries for the application or personal toolkit code. CPAN modules are installed properly (elsewhere).
Does this design layout properly incorporate the advice regarding pulling unnecessary files out of cgi-bin?
Have I missed something? Would another approach be more effective? I'm trying to find a balance between strict security and reasonable portability.
What scares me the most about security concerns is what I *don't* know and can't find in the standard FAQs. I can do all the research I want, but eventually, I need to write code.
Thanks in advance...In reply to Organization Redux by footpad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |