Re: [gentoo-user] apache blocking access based country

2020-12-09 Thread Michael
On Wednesday, 9 December 2020 07:03:17 GMT Remco Rijnders wrote: > On Tue, Dec 08, 2020 at 11:18:49PM -0700, thelma wrote in > > <94662af9-b159-65ca-371d-1521ab4fa...@sys-concept.com>: > >Steve, suggested a good alternative database of IP's with two letter > >country beside them. It can be sorted

Re: [gentoo-user] apache blocking access based country

2020-12-08 Thread Remco Rijnders
On Tue, Dec 08, 2020 at 11:18:49PM -0700, thelma wrote in <94662af9-b159-65ca-371d-1521ab4fa...@sys-concept.com>: Steve, suggested a good alternative database of IP's with two letter country beside them. It can be sorted by country in a spreadsheet. This 16MB file would seem like an ideal

Re: [gentoo-user] apache blocking access based country

2020-12-08 Thread thelma
On 12/08/2020 05:25 PM, Steve Wilson wrote: > > On 09/12/2020 00:01, Grant Taylor wrote: >> On 12/8/20 4:44 PM, Steve Wilson wrote: >>> I use this as the first step to limit ssh access to one of my >>> servers: `iptables -A INPUT -p tcp -m tcp --dport 22 -m geoip ! >>> --src-cc GB -m comment

Re: [gentoo-user] apache blocking access based country

2020-12-08 Thread Grant Taylor
P.S. You might also be interested in some of the feeds that Team Cymru has to offer. I think they are more friendly to scripted querying. Link - IP to ASN Mapping Service - https://team-cymru.com/community-services/ip-asn-mapping/ -- Grant. . . . unix || die

Re: [gentoo-user] apache blocking access based country

2020-12-08 Thread Grant Taylor
On 12/8/20 9:59 PM, the...@sys-concept.com wrote: I'll write a script to check, all the IP's from at text file with "whois" and write the output out to another file, just to be sure. I don't know how long will it take, the file contains 26611-entries (IP addresses). ProTip: Don't parse the

Re: [gentoo-user] apache blocking access based country

2020-12-08 Thread Grant Taylor
On 12/8/20 8:50 PM, the...@sys-concept.com wrote: Creating ACL based on those internet sources eg. https://www.countryipblocks.net/acl.php is not reliable. I pulled a list of Russian and Ukrainian IPs from the above link and checking some of them, I found these two (and possibly more) are

Re: [gentoo-user] apache blocking access based country

2020-12-08 Thread thelma
On 12/08/2020 08:50 PM, the...@sys-concept.com wrote: [snip] > Creating ACL based on those internet sources eg. > https://www.countryipblocks.net/acl.php > is not reliable. I pulled a list of Russian and Ukrainian IPs from the > above link and checking some of them, I found these two (and

Re: [gentoo-user] apache blocking access based country

2020-12-08 Thread Grant Taylor
On 12/8/20 6:17 PM, the...@sys-concept.com wrote: so it might be easier to for apache, am I correct? Apache vs iptables is somewhat a preference. Though with Apache, chances are good that you would need to ban in multiple locations, possibly multiple VHOSTs or server wide. (See more

Re: [gentoo-user] apache blocking access based country

2020-12-08 Thread thelma
On 12/08/2020 05:25 PM, Steve Wilson wrote: > > On 09/12/2020 00:01, Grant Taylor wrote: >> On 12/8/20 4:44 PM, Steve Wilson wrote: >>> I use this as the first step to limit ssh access to one of my >>> servers: `iptables -A INPUT -p tcp -m tcp --dport 22 -m geoip ! >>> --src-cc GB -m comment

Re: [gentoo-user] apache blocking access based country

2020-12-08 Thread thelma
On 12/08/2020 05:25 PM, Steve Wilson wrote: > > On 09/12/2020 00:01, Grant Taylor wrote: >> On 12/8/20 4:44 PM, Steve Wilson wrote: >>> I use this as the first step to limit ssh access to one of my >>> servers: `iptables -A INPUT -p tcp -m tcp --dport 22 -m geoip ! >>> --src-cc GB -m comment

Re: [gentoo-user] apache blocking access based country

2020-12-08 Thread Steve Wilson
On 09/12/2020 00:01, Grant Taylor wrote: On 12/8/20 4:44 PM, Steve Wilson wrote: I use this as the first step to limit ssh access to one of my servers: `iptables -A INPUT -p tcp -m tcp --dport 22 -m geoip ! --src-cc GB -m comment --comment "Drop SSH from outside GB" -j DROP` Has the geoip

Re: [gentoo-user] apache blocking access based country

2020-12-08 Thread Grant Taylor
On 12/8/20 4:44 PM, Steve Wilson wrote: I use this as the first step to limit ssh access to one of my servers: `iptables -A INPUT -p tcp -m tcp --dport 22 -m geoip ! --src-cc GB -m comment --comment "Drop SSH from outside GB" -j DROP` Has the geoip match extension been updated to take into

Re: [gentoo-user] apache blocking access based country

2020-12-08 Thread Steve Wilson
On 08/12/2020 22:55, the...@sys-concept.com wrote: What are my options apache blocking access based on country? So fare I run onto something "geoip" or ACL (long list of IP's provided by eg:) https://www.ip2location.com/free/visitor-blocker We geoip I think I will need to install some module

Re: [gentoo-user] apache blocking access based country

2020-12-08 Thread thelma
On 12/08/2020 03:55 PM, the...@sys-concept.com wrote: > What are my options apache blocking access based on country? > So fare I run onto something "geoip" or ACL (long list of IP's provided by > eg:) > https://www.ip2location.com/free/visitor-blocker > > We geoip I think I will need to install

Re: [gentoo-user] apache blocking access based country

2020-12-08 Thread Grant Taylor
On 12/8/20 3:55 PM, the...@sys-concept.com wrote: What are my options apache blocking access based on country? Do you want to block connections to /just/ Apache and /nothing/ else on the system? Or do you want to block connections from specified sources to anything and everything on the

[gentoo-user] apache blocking access based country

2020-12-08 Thread thelma
What are my options apache blocking access based on country? So fare I run onto something "geoip" or ACL (long list of IP's provided by eg:) https://www.ip2location.com/free/visitor-blocker We geoip I think I will need to install some module for apache (apache 2.2). It is using geoip.dat so it