In my case the 10 sec delay acceptable. This limits a dictionary attack to 6 times a minute instead of how ever may times the webserver can respond in the same minute. Actually, I guess the webserver will still be responding as fast as it can, only 1 crack attempt will be allowed through every 10 seconds, the rest will be thrown away. If the script can be served 100 times a second, then only 1 in 1000 crack attempts will actually be tried. The cracker will work his way through the entire dictionary with only a tiny percent actually making it through. (granted, it only takes one success to mess you up)

But that's just my code, which is still a work in progress. You could easily keep count the number of attempts made during the 10 second timeout and permanently add the address to another table or extend the timeout indefinitely if a threshold is reached (like say more than 2 attempts). The 10 second rule doesn't have to be temporary, it's just an arbitrary timeout.

Others rely on Apache to provide the security and I guess that's ok for them. Myself, I've never been keen on leaving it to the webserver. If your cgi application needs security, build it into the cgi. You never know (or may not have control over) when the server configuration changes or file permissions may change, and then all your .htaccess rules go out the window. But like I say, that's just me.

In reply to Re^3: A module to deny ip on multiple sketchy http requests, yes, no? by ruzam
in thread A module to deny ip on multiple sketchy http requests, yes, no? by leocharre

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.