ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] Как лучше закрыть сервер снаружи
@ 2008-10-03 14:55 Vitalik Salomatin
  2008-10-03 15:22 ` Dmitriy Kruglikov
  0 siblings, 1 reply; 2+ messages in thread
From: Vitalik Salomatin @ 2008-10-03 14:55 UTC (permalink / raw)
  To: community

Сервер eth0 и eth1 смотрит наружу под разными ip - адресами.
Как максимально надежно закрыть сервер снаружи по eth0
оставив только доступ по 80 порту
Все остальное вообще закрыть

знаю способ 

# iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
# iptables -A INPUT -i eth0 -p tcp -m tcp --tcp-flags FIN,SYN,ACK SYN -j REJECT --reject-with icmp-port-unreachable
# iptables -A FORWARD -o eth0 -p tcp -j DROP

достаточен ли он?

А как закрыть от ping  или дос атаки?

Что сейчас считается надежным способом прикрыть сервер максимально?

Спасибо.


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

* Re: [Comm] Как лучше закрыть сервер снаружи
  2008-10-03 14:55 [Comm] Как лучше закрыть сервер снаружи Vitalik Salomatin
@ 2008-10-03 15:22 ` Dmitriy Kruglikov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitriy Kruglikov @ 2008-10-03 15:22 UTC (permalink / raw)
  To: Vitalik Salomatin, ALT Linux Community general discussions

3 октября 2008 г. 17:55 пользователь Vitalik Salomatin написал:
>
> Что сейчас считается надежным способом прикрыть сервер максимально?
>

Надежнее всего - не выставлять в сеть ...

К вашему способу могу добавиьт только правило по умолчанию выставить в DROP ...
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]

Разрешить исходящие чтоб сервер мог, как минимум, за DNSом сходить и
время себе обновить ...
Открыть только один порт, который нужен, и на него повесить счетчик
пакетов в минуту ...
Чтоб при превышении разумного минимума все последующие соединения с
адреса источника дропались ...
Что-то вроде такого:

-A INPUT -i inet -p tcp -m state --state NEW --dport 22 -m recent
--name sshattack --set
-A INPUT -i inet -p tcp -m state --state ESTABLISHED --tcp-flags
FIN,ACK FIN,ACK --dport 22 -m recent --name sshattack --set
-A INPUT -i inet -p tcp -m state --state ESTABLISHED --tcp-flags RST
RST --dport 22 -m recent --name sshattack --set
-A INPUT -i inet --dport 22 -m recent --name sshattack --update
--seconds 60 --hitcount 4 -m limit --limit 4/minute -j LOG
--log-prefix SSH_attack:_
-A INPUT -i inet --dport 22 -m recent --name sshattack --update
--seconds 60 --hitcount 4 -j DROP

И не забыть бы
-A INPUT -i lo -j ACCEPT
А то всякое бывает ... :)

-- 
Как правильно задавать вопросы:
http://maddog.sitengine.ru/smart-question-ru.html

Помогает:
http://search.altlinux.org

Best regards,
 Dmitriy L. Kruglikov
 Dmitriy.Kruglikov_at_gmail_dot_com
 DKR6-RIPE
 DKR6-UANIC
 XMPP: Dmitriy.Kruglikov_at_gmail_dot_com

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

end of thread, other threads:[~2008-10-03 15:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-03 14:55 [Comm] Как лучше закрыть сервер снаружи Vitalik Salomatin
2008-10-03 15:22 ` Dmitriy Kruglikov

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git