From: Antony Stone <Antony@Soft-Solutions.co.uk>
To: netfilter <netfilter@lists.netfilter.org>
Subject: Re: ssh
Date: Wed, 14 Jul 2004 16:42:31 +0100 [thread overview]
Message-ID: <200407141642.31591.Antony@Soft-Solutions.co.uk> (raw)
In-Reply-To: <2E314DE03538984BA5634F12115B3A4E62E89F@email1.mitretek.org>
On Wednesday 14 July 2004 4:26 pm, Piszcz, Justin Michael wrote:
> Should all incoming ports that relate to a service such as SSH, FTP use
> -m state --state NEW?
It doesn't really matter, IMHO.
> What are the security implications (if any) of not using -m state
> --state NEW?
Well, there are two types of packets - ones that are NEW, and ones that
aren't. If you use "-m state --state NEW" as a match on the rule to allow
the first packet in (because it's only the first one which will be NEW
anyway), then you must have some other rule which allows the second and
subsequent packets in (which are no longer NEW; they are ESTABLISHED). In
my opinion it makes no difference whether the rule for the first packet would
*only* let in the NEW packet, or if it would let in the later ones as well.
Remember that the efficient order to place your rules in the FORWARD chain is:
1. Allow ESTABLISHED & RELATED packets through the firewall.
2. Allow the first packets of selected connection types.
Therefore any ESTABLISHED packets aren't going to get beyond rule 1 anyway, so
it dosn't much matter whether the rules at (2) allow them or not.
The only other type of packet which you might want to think about is INVALID
packets, however whether you consider these to be a security risk or not is
moot, I think. Even if an INVALID packet were to be allowed through your
firewall to an internal host, any response would not get back out again
because it's not part of an ESTABLISHED connection, so unless the INVALID
packet can actually do some harm all on its own, it seems to me that allowing
NEW, or allowing all, packets in makes little difference (for a given service
and destination).
If someone wants to send you an INVALID packet anyway, all they need to do is
send you a SYN packet to a listening port/address first - that will set up an
ESTABLISHED connection tracking table entry, and then any further packets
from the same source IP/port will be FORWARDED through the traditional Rule
1.
Just my 2c - I will be interested to see any other opinions on the topic.
Regards,
Antony.
> -----Original Message-----
> From: netfilter-admin@lists.netfilter.org
> [mailto:netfilter-admin@lists.netfilter.org] On Behalf Of Koyama Mituru
> Sent: Wednesday, July 14, 2004 10:26 AM
> To: netfilter@lists.netfilter.org
> Subject: Re: ssh
>
> From: "IT Clown" <iptables@mailbox.co.za>
> Subject: ssh
> Date: Wed, 14 Jul 2004 16:15:22 +0200
>
> > How do i allow ssh in from the internet, thanks?
>
> iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j ACCEPT
--
It is also possible that putting the birds in a laboratory setting
inadvertently renders them relatively incompetent.
- Daniel C Dennet
Please reply to the list;
please don't CC me.
next prev parent reply other threads:[~2004-07-14 15:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-14 15:26 ssh Piszcz, Justin Michael
2004-07-14 15:42 ` Antony Stone [this message]
2004-07-14 15:57 ` ssh Koyama Mituru
2004-07-14 16:07 ` ssh Antony Stone
-- strict thread matches above, loose matches on Subject: below --
2004-07-14 14:15 ssh IT Clown
2004-07-14 14:25 ` ssh Koyama Mituru
2003-01-14 21:28 ssh Simpson, Doug
2003-01-15 12:09 ` ssh Zander
2003-01-15 18:44 ` ssh MAB
2003-01-14 19:59 ssh Simpson, Doug
2002-06-24 12:23 ssh Daniel Sercaianu
2002-06-24 13:31 ` ssh Antony Stone
2002-06-24 13:47 ` ssh Maciej Soltysiak
2002-06-24 13:56 ` ssh Ramin Alidousti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200407141642.31591.Antony@Soft-Solutions.co.uk \
--to=antony@soft-solutions.co.uk \
--cc=netfilter@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox