Здравствуйте!
Есть задача отслеживать количество коннектов к серверу с каждого адреса.
Этим хочу предотвратить нездоровую активность. Т.е. например, я знаю что
нормальное количество одновременных tcp коннектов к моему серверу с одного
адреса не должно превышать 100. Если я вижу что откуда-то одновременно
200 сессий, то значит что-то не так.
Все это хочу реализовать на linux'e.
netstat не подходит, т.к. он медленно работает, а я хочу дергать эту
тулзу довольно часто, как плагин nagios'a.
Пробовал парсить /proc/net/ip_conntrack, но какая-то там недостоверная
информация. Я так понимаю, если коннекшн ESTABLISHED, то он все равно
далеко не сразу переходит в состояние ASSURED. Но в тоже время, если
tcp-коннекшн был оборван (если я правильно механизм понимаю), то
коннекшн тоже далеко не сразу переходит в состояние UNREPLIED.
Т.е. по каким критериям парсить - пока не совсем понятно.
Сильно снижать timeout для ESTABLISHED коннектов тоже не хочется, т.к.
тогда можно получить не совсем корректно работающий iptables с
conntrack.
Как лучше всего реализовать такую задачу?
И вообще, кто какие методы применяет для борьбы/предотвращения (Д)ДоС на
сервер? Я понимаю что по-хорошему нужно бороться с ними _до_ сервера, но
все же, если всего одна машина, то что даст относительно неплохой
результат и при этом не будет отжирать львиную долю ресурсов, и есть ли
вообще такое? :)
Спасибо.
--
Alexander Burnos
===================================================================
uanog mailing list.
To Unsubscribe: send mail to majordomo(a)uanog.kiev.ua
with "unsubscribe uanog" in the body of the message