hosts.allow revision 161710
1238384Sjkim# 2238384Sjkim# hosts.allow access control file for "tcp wrapped" applications. 3238384Sjkim# $FreeBSD: head/etc/hosts.allow 161710 2006-08-29 09:20:48Z ru $ 4238384Sjkim# 5238384Sjkim# NOTE: The hosts.deny file is deprecated. 6238384Sjkim# Place both 'allow' and 'deny' rules in the hosts.allow file. 7238384Sjkim# See hosts_options(5) for the format of this file. 8238384Sjkim# hosts_access(5) no longer fully applies. 9238384Sjkim 10238384Sjkim# _____ _ _ 11280304Sjkim# | ____| __ __ __ _ _ __ ___ _ __ | | ___ | | 12280304Sjkim# | _| \ \/ / / _` | | '_ ` _ \ | '_ \ | | / _ \ | | 13280304Sjkim# | |___ > < | (_| | | | | | | | | |_) | | | | __/ |_| 14280304Sjkim# |_____| /_/\_\ \__,_| |_| |_| |_| | .__/ |_| \___| (_) 15280304Sjkim# |_| 16280304Sjkim# !!! This is an example! You will need to modify it for your specific 17280304Sjkim# !!! requirements! 18238384Sjkim 19238384Sjkim 20280304Sjkim# Start by allowing everything (this prevents the rest of the file 21238384Sjkim# from working, so remove it when you need protection). 22238384Sjkim# The rules here work on a "First match wins" basis. 23280304SjkimALL : ALL : allow 24280304Sjkim 25280304Sjkim# Wrapping sshd(8) is not normally a good idea, but if you 26280304Sjkim# need to do it, here's how 27280304Sjkim#sshd : .evil.cracker.example.com : deny 28238384Sjkim 29280304Sjkim# Protect against simple DNS spoofing attacks by checking that the 30238384Sjkim# forward and reverse records for the remote host match. If a mismatch 31280304Sjkim# occurs, access is denied, and any positive ident response within 32238384Sjkim# 20 seconds is logged. No protection is afforded against DNS poisoning, 33238384Sjkim# IP spoofing or more complicated attacks. Hosts with no reverse DNS 34280304Sjkim# pass this rule. 35238384SjkimALL : PARANOID : RFC931 20 : deny 36280304Sjkim 37280304Sjkim# Allow anything from localhost. Note that an IP address (not a host 38280304Sjkim# name) *MUST* be specified for rpcbind(8). 39280304SjkimALL : localhost 127.0.0.1 : allow 40280304Sjkim# Comment out next line if you build libwrap without IPv6 support. 41280304SjkimALL : [::1] : allow 42238384Sjkim#ALL : my.machine.example.com 192.0.2.35 : allow 43280304Sjkim 44238384Sjkim# To use IPv6 addresses you must enclose them in []'s 45238384Sjkim#ALL : [fe80::%fxp0]/10 : allow 46280304Sjkim#ALL : [fe80::]/10 : deny 47280304Sjkim#ALL : [2001:db8:2:1:2:3:4:3fe1] : deny 48238384Sjkim#ALL : [2001:db8:2:1::]/64 : allow 49238384Sjkim 50280304Sjkim# Sendmail can help protect you against spammers and relay-rapers 51238384Sjkimsendmail : localhost : allow 52280304Sjkim#sendmail : .nice.guy.example.com : allow 53280304Sjkim#sendmail : .evil.cracker.example.com : deny 54280304Sjkimsendmail : ALL : allow 55280304Sjkim 56238384Sjkim# Exim is an alternative to sendmail, available in the ports tree 57exim : localhost : allow 58#exim : .nice.guy.example.com : allow 59#exim : .evil.cracker.example.com : deny 60exim : ALL : allow 61 62# Rpcbind is used for all RPC services; protect your NFS! 63# (IP addresses rather than hostnames *MUST* be used here) 64#rpcbind : 192.0.2.32/255.255.255.224 : allow 65#rpcbind : 192.0.2.96/255.255.255.224 : allow 66rpcbind : ALL : deny 67 68# NIS master server. Only local nets should have access 69# (Since this is an RPC service, rpcbind needs to be considered) 70ypserv : localhost : allow 71#ypserv : .unsafe.my.net.example.com : deny 72#ypserv : .my.net.example.com : allow 73ypserv : ALL : deny 74 75# Provide a small amount of protection for ftpd 76ftpd : localhost : allow 77#ftpd : .nice.guy.example.com : allow 78#ftpd : .evil.cracker.example.com : deny 79ftpd : ALL : allow 80 81# You need to be clever with finger; do _not_ backfinger!! You can easily 82# start a "finger war". 83fingerd : ALL \ 84 : spawn (echo Finger. | \ 85 /usr/bin/mail -s "tcpd\: %u@%h[%a] fingered me!" root) & \ 86 : deny 87 88# The rest of the daemons are protected. 89ALL : ALL \ 90 : severity auth.info \ 91 : twist /bin/echo "You are not welcome to use %d from %h." 92