🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: bit.listserv.openbsd-pf
1 messages
1 total messages Started by p.atmatzidis Wed, 31 Oct 2012 20:01
Block Google search after 17k requests in 24h
#231
Author: p.atmatzidis
Date: Wed, 31 Oct 2012 20:01
25 lines
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!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads