A way to add some security is with an IP filtering PerlAccessHandler. A simple demo follows. I don't think this is truly secure though unless you're on a VPN or something where you can trust the calling IP's validity. Someone will correct me if that's not right.

package Apache::IPfilter; use Apache::Constants qw(:common); sub handler { my $r = shift; return DECLINED unless $r->is_initial_req(); my $calling_ip = $r->get_remote_host(); for my $ip ( $r->dir_config->get('allowed_ip') ) { return OK if $ip eq $calling_ip; } warn( 'Denied access to, ', $r->uri(), ', by caller ', $calling_ip, " not in access list.\n" ); return FORBIDDEN; } 1;

Then in your httpd.conf something like this containing the IPs your trusted admins use to visit your server:

PerlAccessHandler Apache::IPfilter PerlSetVar allowed_ip 127.0.0.1 PerlAddVar allowed_ip 205.196.208.198

In reply to Re: Writing a secure Apache Module mysql DB interface by Your Mother
in thread Writing a secure Apache Module mysql DB interface by shiza

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.