Apache Filter: blocking logins after failed attempts.
A coworker asked me this one first, but I'm stumped, so I turn to the hive mind.
He's running a pretty vanilla Apache on FreeBSD to serve a website that has a /members section protected by htaccess. He administers passwords and such fine, and he's happy with the security and reliability and such, but he's starting to have a problem with scripts/robots hammering his login pages with web-based brute force attacks, trying user names (aaron, adam, arthur, axel...) and common passwords.
This isn't a huge security problem but it's proving to be a heck of a drag on his web server, and it's poisoning his traffic data. Apparently "something like 90 percent" of his traffic last weekend was just that kind of noise. I first suggested just blocking the offending IPs within the .htaccess itself, but the source IPs change every couple of hours, and some are from identifiably dynamic IPs like ADSL users, so temporary blocks are definitely the right way, here.
Obviously, he'd rather not reengineer a whole new authentication scheme, and that's probably beyond his ken anyway. So is there an Apache module or middleware script he could use as an add-on or (pre?)login, to provide temporary lockouts for given user names or IP numbers? The goal is something like the typical bank login response: "Too many failed logins, please try again in (1 hour)." where that (hour) is configurable.
Captchas on login might work, but that strikes me as too strange and cruel, I think, to impose on every login.
It's a straight HTML website right now, nothing fancy at all (he uploads members documents by FTP and uses some web-front end CGI from his ISP for adding/removing htaccess users) and he's not comfortable with Perl or PHP beyond install-and-forget. That said, I could probably lend a couple hours of my own help to implement something one-time, as long as it "just works" after that.
Suggestions, geek-hive?
If you use mod_auth_pam to make Apache interface with the system PAM libraries for authentication, you can configure the login_limit PAM module to automatically lock out brute force attempts.
This does require not only admin level access to the Apache installation, but also access to change the system PAM configuration, and a sufficient understanding of how that works that you can assess the security complexities this might introduce (for example, you probably don't want all those Apache users to be able to log in as shell users on the machine) and understand how to prevent undesired outcomes.
posted by standbythree at 8:38 AM on June 12