public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] preventing some IP's from from being logged in apache
@ 2021-01-11 23:05 thelma
  2021-01-11 23:41 ` Michael
  0 siblings, 1 reply; 10+ messages in thread
From: thelma @ 2021-01-11 23:05 UTC (permalink / raw
  To: Gentoo mailing list

I've one persistent user (Russian IP) that is populating my apache log files.

I tried 00_mod_log_config.conf

SetEnvIf Remote_Addr "45\.93\.201\.104" dontlog
CustomLog /var/log/apache2/deflate_log deflate env=!dontlog
CustomLog /var/log/apache2/access_log common env=!dontlog

But I still see this IP in my access_log.  




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] preventing some IP's from from being logged in apache
  2021-01-11 23:05 [gentoo-user] preventing some IP's from from being logged in apache thelma
@ 2021-01-11 23:41 ` Michael
  2021-01-12  0:00   ` thelma
  0 siblings, 1 reply; 10+ messages in thread
From: Michael @ 2021-01-11 23:41 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 685 bytes --]

On Monday, 11 January 2021 23:05:55 GMT thelma@sys-concept.com wrote:
> I've one persistent user (Russian IP) that is populating my apache log
> files.
> 
> I tried 00_mod_log_config.conf
> 
> SetEnvIf Remote_Addr "45\.93\.201\.104" dontlog
> CustomLog /var/log/apache2/deflate_log deflate env=!dontlog
> CustomLog /var/log/apache2/access_log common env=!dontlog
> 
> But I still see this IP in my access_log.

If it is the same IP address persistently attacking the server, I would be 
tempted to block it, or the whole /24 subnet it belongs to, at the perimeter 
firewall.  Of course, persistent actors will hop off another IP address, so 
there are diminishing returns in this game.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] preventing some IP's from from being logged in apache
  2021-01-11 23:41 ` Michael
@ 2021-01-12  0:00   ` thelma
  2021-01-12  0:09     ` thelma
  0 siblings, 1 reply; 10+ messages in thread
From: thelma @ 2021-01-12  0:00 UTC (permalink / raw
  To: gentoo-user

On 1/11/21 4:41 PM, Michael wrote:
> On Monday, 11 January 2021 23:05:55 GMT thelma@sys-concept.com wrote:
>> I've one persistent user (Russian IP) that is populating my apache log
>> files.
>>
>> I tried 00_mod_log_config.conf
>>
>> SetEnvIf Remote_Addr "45\.93\.201\.104" dontlog
>> CustomLog /var/log/apache2/deflate_log deflate env=!dontlog
>> CustomLog /var/log/apache2/access_log common env=!dontlog
>>
>> But I still see this IP in my access_log.
> 
> If it is the same IP address persistently attacking the server, I would be 
> tempted to block it, or the whole /24 subnet it belongs to, at the perimeter 
> firewall.  Of course, persistent actors will hop off another IP address, so 
> there are diminishing returns in this game.

I did block this IP and it is working 
Require not ip 45.93.201.0/24

I hardly resolve to blocking IP from log files, but if they try to ping/access your network 4 or 5 per second your log files will tend to grow. 
SetEnvIf Remote_Addr "45\.93\.201\.104" dontlog
didn't work.
 
Just today from about 7am to 4pm about 96K pings from this IP.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] preventing some IP's from from being logged in apache
  2021-01-12  0:00   ` thelma
@ 2021-01-12  0:09     ` thelma
  2021-01-12  4:15       ` mad.scientist.at.large
  0 siblings, 1 reply; 10+ messages in thread
From: thelma @ 2021-01-12  0:09 UTC (permalink / raw
  To: gentoo-user

On 1/11/21 5:00 PM, thelma@sys-concept.com wrote:
> On 1/11/21 4:41 PM, Michael wrote:
>> On Monday, 11 January 2021 23:05:55 GMT thelma@sys-concept.com wrote:
>>> I've one persistent user (Russian IP) that is populating my apache log
>>> files.
>>>
>>> I tried 00_mod_log_config.conf
>>>
>>> SetEnvIf Remote_Addr "45\.93\.201\.104" dontlog
>>> CustomLog /var/log/apache2/deflate_log deflate env=!dontlog
>>> CustomLog /var/log/apache2/access_log common env=!dontlog
>>>
>>> But I still see this IP in my access_log.
>>
>> If it is the same IP address persistently attacking the server, I would be 
>> tempted to block it, or the whole /24 subnet it belongs to, at the perimeter 
>> firewall.  Of course, persistent actors will hop off another IP address, so 
>> there are diminishing returns in this game.
> 
> I did block this IP and it is working 
> Require not ip 45.93.201.0/24
> 
> I hardly resolve to blocking IP from log files, but if they try to ping/access your network 4 or 5 per second your log files will tend to grow. 
> SetEnvIf Remote_Addr "45\.93\.201\.104" dontlog
> didn't work.
>  
> Just today from about 7am to 4pm about 96K pings from this IP.

I forgot to mention, my firewall doesn't have any capabilities to enter any configuration in IP tables.  
Maybe I'll look for one that does. 
 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] preventing some IP's from from being logged in apache
  2021-01-12  0:09     ` thelma
@ 2021-01-12  4:15       ` mad.scientist.at.large
  2021-01-12  4:22         ` thelma
  0 siblings, 1 reply; 10+ messages in thread
From: mad.scientist.at.large @ 2021-01-12  4:15 UTC (permalink / raw
  To: Gentoo User



--"Fascism begins the moment a ruling class, fearing the people may use their political democracy to gain economic democracy, begins to destroy political democracy in order to retain its power of exploitation and special privilege." Tommy Douglas




Jan 11, 2021, 17:09 by thelma@sys-concept.com:

> On 1/11/21 5:00 PM, thelma@sys-concept.com wrote:
>
>> On 1/11/21 4:41 PM, Michael wrote:
>>
>>> On Monday, 11 January 2021 23:05:55 GMT thelma@sys-concept.com wrote:
>>>
>>>> I've one persistent user (Russian IP) that is populating my apache log
>>>> files.
>>>>
>>>> I tried 00_mod_log_config.conf
>>>>
>>>> SetEnvIf Remote_Addr "45\.93\.201\.104" dontlog
>>>> CustomLog /var/log/apache2/deflate_log deflate env=!dontlog
>>>> CustomLog /var/log/apache2/access_log common env=!dontlog
>>>>
>>>> But I still see this IP in my access_log.
>>>>
>>>
>>> If it is the same IP address persistently attacking the server, I would be 
>>> tempted to block it, or the whole /24 subnet it belongs to, at the perimeter 
>>> firewall.  Of course, persistent actors will hop off another IP address, so 
>>> there are diminishing returns in this game.
>>>
>>
>> I did block this IP and it is working 
>> Require not ip 45.93.201.0/24
>>
>> I hardly resolve to blocking IP from log files, but if they try to ping/access your network 4 or 5 per second your log files will tend to grow. 
>> SetEnvIf Remote_Addr "45\.93\.201\.104" dontlog
>> didn't work.
>>  
>> Just today from about 7am to 4pm about 96K pings from this IP.
>>
>
> I forgot to mention, my firewall doesn't have any capabilities to enter any configuration in IP tables. 
> Maybe I'll look for one that does. 
>
That would be the thing to do.  You want everything logged, so you know what is happening.  If you blocked the logging how would you know if they made progress.  You want to know when people are trying to break in, and you want to know when their tactics change.  Not logging it is like plugging your' ears and closing your' eyes while the battering ram is pounding your' door...


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] preventing some IP's from from being logged in apache
  2021-01-12  4:15       ` mad.scientist.at.large
@ 2021-01-12  4:22         ` thelma
  2021-01-12  6:32           ` J. Roeleveld
  0 siblings, 1 reply; 10+ messages in thread
From: thelma @ 2021-01-12  4:22 UTC (permalink / raw
  To: gentoo-user


On 1/11/21 9:15 PM, mad.scientist.at.large@tutanota.com wrote:
> 
> 
> --"Fascism begins the moment a ruling class, fearing the people may use their political democracy to gain economic democracy, begins to destroy political democracy in order to retain its power of exploitation and special privilege." Tommy Douglas
> 
> 
[snip]

>> I forgot to mention, my firewall doesn't have any capabilities to enter any configuration in IP tables. 
>> Maybe I'll look for one that does. 
>>
> That would be the thing to do.  You want everything logged, so you know what is happening.  If you blocked the logging how would you know if they made progress.  You want to know when people are trying to break in, and you want to know when their tactics change.  Not logging it is like plugging your' ears and closing your' eyes while the battering ram is pounding your' door...
> 

If I blocked the IP already, why would I want to log anything about that IP; they will will be denied access regardless.  
 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] preventing some IP's from from being logged in apache
  2021-01-12  4:22         ` thelma
@ 2021-01-12  6:32           ` J. Roeleveld
  2021-01-12 17:11             ` thelma
  0 siblings, 1 reply; 10+ messages in thread
From: J. Roeleveld @ 2021-01-12  6:32 UTC (permalink / raw
  To: gentoo-user

On Tuesday, January 12, 2021 5:22:20 AM CET thelma@sys-concept.com wrote:
> On 1/11/21 9:15 PM, mad.scientist.at.large@tutanota.com wrote:
> > --"Fascism begins the moment a ruling class, fearing the people may use
> > their political democracy to gain economic democracy, begins to destroy
> > political democracy in order to retain its power of exploitation and
> > special privilege." Tommy Douglas
> [snip]
> 
> >> I forgot to mention, my firewall doesn't have any capabilities to enter
> >> any configuration in IP tables. Maybe I'll look for one that does.
> > 
> > That would be the thing to do.  You want everything logged, so you know
> > what is happening.  If you blocked the logging how would you know if they
> > made progress.  You want to know when people are trying to break in, and
> > you want to know when their tactics change.  Not logging it is like
> > plugging your' ears and closing your' eyes while the battering ram is
> > pounding your' door...
> If I blocked the IP already, why would I want to log anything about that IP;
> they will will be denied access regardless.

If you blocked the IP in the firewall, it shouldn't show in the log.

Add iptables to the webserver and block that IP.
Personally, I would block the whole range (45.93.201.0/24), which is either 
linked to Cyprus or Russia (according to whois)

Any block in the apache-config might fail due to a bug or new configuration.

--
Joost




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] preventing some IP's from from being logged in apache
  2021-01-12  6:32           ` J. Roeleveld
@ 2021-01-12 17:11             ` thelma
  2021-01-12 17:26               ` J. Roeleveld
  2021-01-12 18:51               ` antlists
  0 siblings, 2 replies; 10+ messages in thread
From: thelma @ 2021-01-12 17:11 UTC (permalink / raw
  To: gentoo-user

On 1/11/21 11:32 PM, J. Roeleveld wrote:
[snip]
> If you blocked the IP in the firewall, it shouldn't show in the log.
> 
> Add iptables to the webserver and block that IP.
> Personally, I would block the whole range (45.93.201.0/24), which is either 
> linked to Cyprus or Russia (according to whois)
> 
> Any block in the apache-config might fail due to a bug or new configuration.
> 
> --
> Joost

Asus routers don't have capabilities to block external IP's (I need to find a better router).
Blocking that IP range in apache works, all the IPs I blocked are getting 403 error (regardless what they type) 
but you might be right, apache 2.4 
 SetEnvIf Remote_Addr "45\.93\.201\.104" dontlog  (does not work). 

I wish they design blocking by country easier. 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] preventing some IP's from from being logged in apache
  2021-01-12 17:11             ` thelma
@ 2021-01-12 17:26               ` J. Roeleveld
  2021-01-12 18:51               ` antlists
  1 sibling, 0 replies; 10+ messages in thread
From: J. Roeleveld @ 2021-01-12 17:26 UTC (permalink / raw
  To: gentoo-user

On 12 January 2021 18:11:34 CET, thelma@sys-concept.com wrote:
>On 1/11/21 11:32 PM, J. Roeleveld wrote:
>[snip]
>> If you blocked the IP in the firewall, it shouldn't show in the log.
>> 
>> Add iptables to the webserver and block that IP.
>> Personally, I would block the whole range (45.93.201.0/24), which is
>either 
>> linked to Cyprus or Russia (according to whois)
>> 
>> Any block in the apache-config might fail due to a bug or new
>configuration.
>> 
>> --
>> Joost
>
>Asus routers don't have capabilities to block external IP's (I need to
>find a better router).
>Blocking that IP range in apache works, all the IPs I blocked are
>getting 403 error (regardless what they type) 
>but you might be right, apache 2.4 
> SetEnvIf Remote_Addr "45\.93\.201\.104" dontlog  (does not work). 
>
>I wish they design blocking by country easier. 

Asus routers do allow blocking IPs, but it might be less than ideal.

I would add a firewall to your webserver and block the full ranges using that. Any bug in apaches blocking WILL leave you open to a hack.

--
Joost
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] preventing some IP's from from being logged in apache
  2021-01-12 17:11             ` thelma
  2021-01-12 17:26               ` J. Roeleveld
@ 2021-01-12 18:51               ` antlists
  1 sibling, 0 replies; 10+ messages in thread
From: antlists @ 2021-01-12 18:51 UTC (permalink / raw
  To: gentoo-user

On 12/01/2021 17:11, thelma@sys-concept.com wrote:
> I wish they design blocking by country easier.

Unfortunately, IPv4 in particular, blocking by country is pretty much 
impossible because - due  to demand pressure - addresses are scattered 
pretty much randomly.

Especially with class A or B addresses, they might belong to a 
multi-national and be scattered all over the world, subnets might have 
been sold off, the rich world has bought a lot of addresses from the 
poor world, hacks might originate in country A but be carried out from a 
hijacked system in country B. Etc etc.

All these protocols etc originated in a much kinder era, and aren't 
designed to withstand abuse.

Cheers,
Wol


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-01-12 18:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-11 23:05 [gentoo-user] preventing some IP's from from being logged in apache thelma
2021-01-11 23:41 ` Michael
2021-01-12  0:00   ` thelma
2021-01-12  0:09     ` thelma
2021-01-12  4:15       ` mad.scientist.at.large
2021-01-12  4:22         ` thelma
2021-01-12  6:32           ` J. Roeleveld
2021-01-12 17:11             ` thelma
2021-01-12 17:26               ` J. Roeleveld
2021-01-12 18:51               ` antlists

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox