hosts.allow revision 81890
1132451Sroberto# 2132451Sroberto# hosts.allow access control file for "tcp wrapped" applications. 3132451Sroberto# $FreeBSD: head/etc/hosts.allow 81890 2001-08-18 14:22:52Z dwmalone $ 4132451Sroberto# 5132451Sroberto# NOTE: The hosts.deny file is deprecated. 6132451Sroberto# Place both 'allow' and 'deny' rules in the hosts.allow file. 7132451Sroberto# See hosts_options(5) for the format of this file. 8132451Sroberto# hosts_access(5) no longer fully applies. 9132451Sroberto 10132451Sroberto# _____ _ _ 11132451Sroberto# | ____| __ __ __ _ _ __ ___ _ __ | | ___ | | 12132451Sroberto# | _| \ \/ / / _` | | '_ ` _ \ | '_ \ | | / _ \ | | 13132451Sroberto# | |___ > < | (_| | | | | | | | | |_) | | | | __/ |_| 14132451Sroberto# |_____| /_/\_\ \__,_| |_| |_| |_| | .__/ |_| \___| (_) 15132451Sroberto# |_| 16132451Sroberto# !!! This is an example! You will need to modify it for your specific 17132451Sroberto# !!! requirements! 18132451Sroberto 19132451Sroberto 20132451Sroberto# Start by allowing everything (this prevents the rest of the file 21132451Sroberto# from working, so remove it when you need protection). 22132451Sroberto# The rules here work on a "First match wins" basis. 23132451SrobertoALL : ALL : allow 24132451Sroberto 25132451Sroberto# Wrapping sshd(8) is not normally a good idea, but if you 26132451Sroberto# need to do it, here's how 27132451Sroberto#sshd : .evil.cracker.example.com : deny 28132451Sroberto 29132451Sroberto# Protect against simple DNS spoofing attacks by checking that the 30132451Sroberto# forward and reverse records for the remote host match. If a mismatch 31132451Sroberto# occurs, access is denied, and any positive ident response within 32132451Sroberto# 20 seconds is logged. No protection is afforded against DNS poisoning, 33132451Sroberto# IP spoofing or more complicated attacks. Hosts with no reverse DNS 34132451Sroberto# pass this rule. 35132451SrobertoALL : PARANOID : RFC931 20 : deny 36132451Sroberto 37132451Sroberto# Allow anything from localhost. Note that an IP address (not a host 38132451Sroberto# name) *MUST* be specified for rpcbind(8). 39132451SrobertoALL : localhost 127.0.0.1 : allow 40132451SrobertoALL : my.machine.example.com 192.0.2.35 : allow 41132451Sroberto 42132451Sroberto# To use IPv6 addresses you must enclose them in []'s 43132451SrobertoALL : [fe80::%fxp0]/10 : allow 44132451SrobertoALL : [fe80::]/10 : deny 45132451SrobertoALL : [3ffe:fffe:2:1:2:3:4:3fe1] : deny 46132451SrobertoALL : [3ffe:fffe:2:1::]/64 : allow 47132451Sroberto 48132451Sroberto# Sendmail can help protect you against spammers and relay-rapers 49132451Srobertosendmail : localhost : allow 50132451Srobertosendmail : .nice.guy.example.com : allow 51132451Srobertosendmail : .evil.cracker.example.com : deny 52132451Srobertosendmail : ALL : allow 53132451Sroberto 54132451Sroberto# Exim is an alternative to sendmail, available in the ports tree 55132451Srobertoexim : localhost : allow 56132451Srobertoexim : .nice.guy.example.com : allow 57132451Srobertoexim : .evil.cracker.example.com : deny 58132451Srobertoexim : ALL : allow 59132451Sroberto 60132451Sroberto# Rpcbind is used for all RPC services; protect your NFS! 61132451Sroberto# (IP addresses rather than hostnames *MUST* be used here) 62132451Srobertorpcbind : 192.0.2.32/255.255.255.224 : allow 63132451Srobertorpcbind : 192.0.2.96/255.255.255.224 : allow 64132451Srobertorpcbind : ALL : deny 65132451Sroberto 66132451Sroberto# Provide a small amount of protection for ftpd 67132451Srobertoftpd : localhost : allow 68132451Srobertoftpd : .nice.guy.example.com : allow 69132451Srobertoftpd : .evil.cracker.example.com : deny 70132451Srobertoftpd : ALL : allow 71132451Sroberto 72132451Sroberto# You need to be clever with finger; do _not_ backfinger!! You can easily 73132451Sroberto# start a "finger war". 74132451Srobertofingerd : ALL \ 75132451Sroberto : spawn (echo Finger. | \ 76132451Sroberto /usr/bin/mail -s "tcpd\: %u@%h[%a] fingered me!" root) & \ 77 : deny 78 79# The rest of the daemons are protected. 80ALL : ALL \ 81 : severity auth.info \ 82 : twist /bin/echo "You are not welcome to use %d from %h." 83