To:
linux-security@redhat.com
I am the Firewall-1 administrator where I work and it has a very nice
GUI tool for defining objects (can be hosts, networks, DNS domains,
groups of hosts, etc.) and a straightforward way of building a
rulebase.
At home I use the LRP with a mini-qmail daemon forwarding the e-mail
via qmqp to the real mailhost, and sshd for remote admin. It has
ipautofw, ipportfw and masquerading.
I really can't think of anything I can do with the Firewall-1 machine
that I can't do with this LRP machine. The whole OS used to fit on a
floppy until I added the mini-qmail and sshd packages. Now it boots
off a small HD and runs only on ramdisks. Except for the GUI and the
price, I'd say they are about equal in terms of power and protection.
I've looked into TIS but never used it. It involved running proxy
daemons on the firewall for telnet ftp and snmp. I like the LRP much
better.
(for those that don't know, LRP is the Linux Router Project. see
http://www.linuxrouter.org )
# /etc/hosts/deny
#
# deny all, send an alert email to root...
ALL : ALL : \
banners /etc/banners/deny : \
spawn ( \
/bin/echo -e "\n\
TCP Wrappers\: Connection Refused\n\
By\: $(uname -n)\n\
Process\: %d (pid %p)\n\
\n\
User\: %u\n\
Host\: %c\n\
Date\: $(date)\n\
" | /bin/mail -s "$(uname -n) wrappers\: %d refused for %c" \
root@localhost ) &
====8<------ end of cut --------------------------
This will deny access to anyone not specifically allowed (from
/etc/hosts.allow), give banners message (specific for the daemon being
called - see the man pages), and generate a very informative mail message
sent to root. (You can add other recipients to that line, btw).
We have found this to be VERY useful here...
[mod: Some remarked that things like "%u" are "client controlled" and
could be used to exploit Tony's system. The manual however claims:
Characters in % expansions that may confuse the shell
are replaced by underscores.
so that should be OK. -- REW]
send
mail - .
ipfILTER ?
ipf -z -f my_ipfilter_rules_file
1. ssh-1.2.26 (!)
2. ssh-2.x.x
3. "sshd2_config" ( ):
Ssh1Compatibility yes
Sshd1Path /usr/sbin/sshd1
4. "ssh2_config" ( ):
Ssh1Compatibility yes
Ssh1Path /usr/bin/ssh1
ssh2 , -
inetd.conf TCP-wrappera hosts.allow/hosts.deny
/etc/inetd.conf
ssh2 stream tcp nowait root /usr/sbin/tcpd sshd2 -i
/etc/hosts.allow
sshd2 : 123.232.175.0/255.255.255.0, 127.0.0.0/255.0.0.0, 234.567.890.12
Linux ,
sshd, ssh.
Dec 6 11:03:11 artur sshd[2177]: Invalid user test from 193.220.141.151
Dec 6 11:03:11 artur sshd[2177]: Failed password for invalid user test from 193.220.141.151 port 46079 ssh2
Dec 6 11:03:15 artur sshd[2180]: Failed password for root from 193.220.141.151 port 46144 ssh2
- .
"".
IP recent .
iptables -A INPUT -p tcp -m state --state NEW --dport 22 -m recent --update --seconds 20 -j DROP
iptables -A INPUT -p tcp -m state --state NEW --dport 22 -m recent --set -j ACCEPT
# iptables -F INPUT
# iptables -A INPUT -m state -state EASTABLISHED,RELATED -j ACCEPT
# iptables -A INPUT -i lo -j ACCEPT
# iptables -P INPUT DROP
# iptables -F FORWARD
# iptables -P FORWARD ACCEPT
# iptables -t nat -F
# iptables -t nat -A POSTROUTING -o { } -j SNAT to { IP}
# ip
# iptables -t nat -A POSTROUTING -o { } -j MASQUERADE
Last-modified: Sun, 08 Jan 2006 12:19:38 GMT