SearchEngines.bg

Това е примерно съобщение за гост. Регистрирайте безплатен акаунт днес, за да станете потребител на SearchEngines.bg! След като влезете, ще можете да участвате в този сайт, като добавите свои собствени теми и публикации, както и да се свържете с други членове чрез вашата лична входяща кутия! Благодарим ви!

Скорост на Гугъл-бот и CSF (DDoS) настройка ?

exoexo

New member
Здравейте,

Time: Mon Apr 4 03:03:17 2011 -0400
IP: 192.138.57.36 (US/United States/bamc-cache.amedd.army.mil)
Connections: 65
Blocked: Temporary Block

root@host [~]# grep 192.138.57.36 /var/log/lfd.log
Apr 4 03:03:17 host lfd[5463]: (CT) IP 192.138.57.36 (US/United States/bamc-cache.amedd.army.mil) found to have 65 connections - *Blocked in csf* for 600 secs [CT_LIMIT]
Apr 4 03:13:18 host lfd[31879]: Incoming IP 192.138.57.36 temporary block removed
Apr 4 03:13:18 host lfd[31879]: Outgoing IP 192.138.57.36 temporary block removed

...
Apr 3 22:26:11 host lfd[1562]: (CT) IP 140.32.16.101 (US/United States/puma.edu.usafa.hpc.mil) found to have 63 connections - *Blocked in csf* for 600 secs [CT_LIMIT]
(Въобще тез .mil нещо са луднали днес и копаят яко из сайтовете ми :D)

Седя и си гледам днес логовете от CSF-а за евентуалните DDoS и блокирани IP-та и човъркам настройките на сървъра и се сетих, че евентуално може това да ми направи лоша шега и с Гугъл-бота като реши да индексира страниците на сайтовете ми. Че гледам някои хора се оплакват че ботчето на Гугъл е доста настойчиво.

Та някой знае ли колко бързо наистина обхожда Гугъл-бот, колко конекции прави за определен интервал?

Сложил съм csf да блокира ИП с повече от 50 конекции за 10 секунди (10 мин бан). Реално нормален посетител няма как да направи тлкова конекции, освен ак не пусне някакъв софт да ми сваля сайта за офлайн, но пък и аз не искам да правят тов - вънка от чадъра! Обаче колко конекции прави Гугъл? Да не ритна и него и да ми замине индексирането на страниците?

Та казвайте вие какви настройки ползвате за безпроблемен Гугъл и ако знаете конекциите му.

Ето и част моите настройки в момента:
# Enable SYN Flood Protection. This option configures iptables to offer some
# protection from tcp SYN packet DOS attempts. You should set the RATE so that
# false-positives are kept to a minimum otherwise visitors may see connection
# issues (check /var/log/messages for *SYNFLOOD Blocked*). See the iptables
# man page for the correct --limit rate syntax
SYNFLOOD = "1"
SYNFLOOD_RATE = "25/s"
SYNFLOOD_BURST = "50"

...

# Limit the number of IP's kept in the /etc/csf/csf.deny file. This can be
# important as a large number of IP addresses create a large number of iptables
# rules (4 times the number of IP's) which can cause problems on some systems
# where either the the number of iptables entries has been limited (esp VPS's)
# or where resources are limited. This can result in slow network performance,
# or, in the case of iptables entry limits, can prevent your server from
# booting as not all the required iptables chain settings will be correctly
# configured. The value set here is the maximum number of IPs/CIDRs allowed
# if the limit is reached, the entries will be rotated so that the oldest
# entries (i.e. the ones at the top) will be removed and the latest is added.
# The limit is only checked when using csf -d (which is what lfd also uses)
# Set to 0 to disable limiting
DENY_IP_LIMIT = "1000"

# Limit the number of IP's kept in the temprary IP ban list. If the limit is
# reached the oldest IP's in the ban list will be removed and allowed
# regardless of the amount of time remaining for the block
# Set to 0 to disable limiting
DENY_TEMP_IP_LIMIT = "1000"

...

# Temporary to Permanent IP blocking. The following enables this feature to
# permanently block IP addresses that have been temporarily blocked more than
# LF_PERMBLOCK_COUNT times in the last LF_PERMBLOCK_INTERVAL seconds. Set
# LF_PERMBLOCK to "1" to enable this feature
#
# Care needs to be taken when setting LF_PERMBLOCK_INTERVAL as it needs to be
# at least LF_PERMBLOCK_COUNT multiplied by the longest temporary time setting
# (TTL) for blocked IPs, to be effective
#
# Set LF_PERMBLOCK to "0" to disable this feature
LF_PERMBLOCK = "1"
LF_PERMBLOCK_INTERVAL = "86400"
LF_PERMBLOCK_COUNT = "4"

# Permanently block IPs by network class. The following enables this feature
# to permanently block classes of IP address where individual IP addresses
# within the same class LF_NETBLOCK_CLASS have already been blocked more than
# LF_NETBLOCK_COUNT times in the last LF_NETBLOCK_INTERVAL seconds. Set
# LF_NETBLOCK to "1" to enable this feature
#
# This can be an affective way of blocking DDOS attacks launched from within
# the same networ class
#
# Valid settings for LF_NETBLOCK_CLASS are "A", "B" and "C", care and
# consideration is required when blocking network classes A or B
#
# Set LF_NETBLOCK to "0" to disable this feature
LF_NETBLOCK = "1"
LF_NETBLOCK_INTERVAL = "86400"
LF_NETBLOCK_COUNT = "4"
LF_NETBLOCK_CLASS = "C"

...

# Connection Tracking. This option enables tracking of all connections from IP
# addresses to the server. If the total number of connections is greater than
# this value then the offending IP address is blocked. This can be used to help
# prevent some types of DOS attack.
#
# Care should be taken with this option. It's entirely possible that you will
# see false-positives. Some protocols can be connection hungry, e.g. FTP, IMAPD
# and HTTP so it could be quite easy to trigger, especially with a lot of
# closed connections in TIME_WAIT. However, for a server that is prone to DOS
# attacks this may be very useful. A reasonable setting for this option might
# be around 300.
#
# To disable this feature, set this to 0
CT_LIMIT = "50"

# Connection Tracking interval. Set this to the the number of seconds between
# connection tracking scans
CT_INTERVAL = "10"

# If you want to make IP blocks permanent then set this to 1, otherwise blocks
# will be temporary and will be cleared after CT_BLOCK_TIME seconds
CT_PERMANENT = "0"

# If you opt for temporary IP blocks for CT, then the following is the interval
# in seconds that the IP will remained blocked for (e.g. 1800 = 30 mins)
CT_BLOCK_TIME = "600"

Резултата днес:
lfd_hour.gif
 
Последно редактирано:
Re: Скорост на Гугъл-бот и CSF (DDoS) настройка ?

А защо не вкараш в списъка с изключения мрежите на гугъл ?
Ако го има този списък някъде ... ? Понеже не знам кои са им мрежи, ИП-та, нищо. Имат ли ги гугъл някъде на сайта си дадени, че не ги намирам?
 
Re: Скорост на Гугъл-бот и CSF (DDoS) настройка ?

Това е добро начало. Но все пак 20-May-2008

http://www.iplists.com/

:)


О предостатъчно е можеш само преди това да направиш един whois на въпросните мрежи и съответно да excludvash цялата мрежа собственост на въпросната компания, защото не вярвам някой от гугъл или яху да тръдне да те хаква.
 
Re: Скорост на Гугъл-бот и CSF (DDoS) настройка ?

Това е добро начало. Но все пак 20-May-2008

http://www.iplists.com/

:)
И аз този лист го видях, но датата му ме спря. А и май те си сменят/добавят доста ИП-та.

Затова си мислех дали нямат някакъв лимит на кънекциите, примерно четох сега из международни форуми че правят по не повече от 1 конекция на секунда. ако е така, то това са не повече от 10 конекции за 10 секунди, при положение че аз съм задал 50 за 10сек няма шанс да блокирам гугъла. И вероятно май ще е така, понеже следя сега и прегледах изцяло логовете и даже когато беше 50 кънекции за 30 секунди пак нямам блокирано ИП от гугъл (поне тези с ресолв и които бих могъл да позная).

А и искрено се надявам гугъл да не са толкова нагли да правят по 5-10 И повече къндкции в секунда и да побъркват на хората с много страници за индексиране хостинга (CPU/RAM,bandwidth...).
 
Re: Скорост на Гугъл-бот и CSF (DDoS) настройка ?

ОК,
поразрових се и решението е обратния DNS. CSF си има опция за това:

/etc/csf/csf.rignore

Там е описано как и се задава кое да бъде игнорирано и да не получава бан
# The following is a list of domains and partial domain that lfd process
# tracking will ignore based on reverse and forward DNS lookups. An example of
# its use is to prevent web crawlers from being blocked by lfd, e.g.
# .googlebot.com and .crawl.yahoo.net
#
# You must use either a Fully Qualified Domain Name (FQDN) or a unique ending
# subset of the domain name which must begin with a dot (wildcards are NOT
# otherwise permitted)
#
# For example, the following are all valid entries:
# www.configserver.com
# .configserver.com
# .configserver.co.uk
# .googlebot.com
# .crawl.yahoo.net
#
# The following are NOT valid entries:
# *.configserver.com
# *google.com
# google.com (unless the lookup is EXACTLY google.com with no subdomain
#
# When a candidate IP address is inspected a reverse DNS lookup is performed on
# the IP address. A forward DNS lookup is then performed on the result from the
# reverse DNS lookup. The IP address will only be ignored if:
#
# 1. The results of the final lookup matches the original IP address
# AND
# 2a. The results of the rDNS lookup matches the FQDN
# OR
# 2b. The results of the rDNS lookup matches the partial subset of the domain

Така че добавяйки .googlebot.com към /etc/csf/csf.rignore проблема е решен интелигентно. Ест може и добре е да се добавят там и yahoo, msn ...
 
Re: Скорост на Гугъл-бот и CSF (DDoS) настройка ?

Не бих казал, че е най-интелигентното решение. Поставяйки такъв запис системата генерира трафик при всеки некеширан пакет и ако днс сървъра ти се забави с отговора то тогава се забавя и пакета. Освен това след като веднъж кешира някакъв запис и то той бъде променен след това пак гориш ...
 
Re: Скорост на Гугъл-бот и CSF (DDoS) настройка ?

Не мисля, че е проблем. DNS-а не се вика всеки път, а само когато е вече налице вероятен DDoS (IP-то е над зададените заявки). Едва тогава преди да му постави бан се вика DNS-а и прави проверката. Т.е. евентуалното забавяне ще е само при евентуалното банване на ИП (което е около 10-20 пъти на ден засега). А с кеширането - нали има TTL и той не е толкова дълъг период, че "веднъж кешира някакъв запис и то той бъде променен след това пак гориш". Така мисля. А и по-рационално решение не виждам. Едва ли предложеното по-горе описване на ИП-тата на търсачките е по-добър вариянт, при положение, че няма пълен списък с техните ИП-та и второ те се променят и добавят нови често. Остава ДНС-а ...
 

Горе