Article View: bit.listserv.openbsd-pf
Article #231Block Google search after 17k requests in 24h
From: p.atmatzidis
Date: Wed, 31 Oct 2012 20:01
Date: Wed, 31 Oct 2012 20:01
25 lines
2865 bytes
2865 bytes
Hello, I'm trying to block access 'Google Search' from a specific host running PF after it has reached 17k requests in 24h. The threshold is below the one defined by google API. To achieve I'd like to use PF. I came up with this rule: -- pass out on $net proto tcp from any to 'www.google.com' port www flags S/SA keep state (max-src-conn 200, max-src-conn-rate 17500/86400) -- However, PF knows that 'google' resolved in 5 IPs (load balancing, speed optimization, etc) so my 'pfctl -sr' shows: -- pass out on vte0 inet proto tcp from any to 173.194.44.81 port = http flags S/SA keep state (source-track rule, max-src-conn 200, max-src-conn-rate 17500/86400, src.track 86400) pass out on vte0 inet proto tcp from any to 173.194.44.82 port = http flags S/SA keep state (source-track rule, max-src-conn 200, max-src-conn-rate 17500/86400, src.track 86400) pass out on vte0 inet proto tcp from any to 173.194.44.83 port = http flags S/SA keep state (source-track rule, max-src-conn 200, max-src-conn-rate 17500/86400, src.track 86400) pass out on vte0 inet proto tcp from any to 173.194.44.80 port = http flags S/SA keep state (source-track rule, max-src-conn 200, max-src-conn-rate 17500/86400, src.track 86400) pass out on vte0 inet proto tcp from any to 173.194.44.84 port = http flags S/SA keep state (source-track rule, max-src-conn 200, max-src-conn-rate 17500/86400, src.track 86400) -- However, each of these IP addresses now has a set of 17500/86400. That's not exactly what I want. I need keep track of all requests made to each and every one of these IP addresses. I know that PF supports "source-track global" , but as I understand the option it was not meant to be used like that. Any thoughts or ideas are welcome!
Technical Details
Message-ID:
<77505a1e-cfd4-4430-b6cc-74e54cf63ce7@googlegroups.com>Path:
arc1-ca.pugleaf.net!gf5ni7629245qab.0!nntp.google.com!c7no1194019qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: bffa70e3,17875096796c9a0b,start
X-Google-Attributes: gidbffa70e3,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.224.105.205 with SMTP id u13mr12192498qao.6.1351713698895;
Wed, 31 Oct 2012 13:01:38 -0700 (PDT)
Received: by 10.52.20.51 with SMTP id k19mr7032859vde.4.1351713698870; Wed, 31
Oct 2012 13:01:38 -0700 (PDT)
Path: arc1-ca.pugleaf.net!gf5ni7629245qab.0!nntp.google.com!c7no1194019qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: bit.listserv.openbsd-pf
Date: Wed, 31 Oct 2012 13:01:38 -0700 (PDT)
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=88.100.116.191;
posting-account=YcLGYgoAAAA1MRmAHDdqdP95X6vDcICA
NNTP-Posting-Host: 88.100.116.191
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <77505a1e-cfd4-4430-b6cc-74e54cf63ce7@googlegroups.com>
Subject: Block Google search after 17k requests in 24h
From: p.atmatzidis@gmail.com
Injection-Date: Wed, 31 Oct 2012 20:01:38 +0000
Content-Type: text/plain; charset=ISO-8859-1