hosts.allow revision 90319
1127608Stjr#
2127608Stjr# hosts.allow access control file for "tcp wrapped" applications.
3127608Stjr# $FreeBSD: head/etc/hosts.allow 90319 2002-02-06 20:39:36Z markm $
4127608Stjr#
5127608Stjr# NOTE: The hosts.deny file is deprecated.
6127608Stjr#       Place both 'allow' and 'deny' rules in the hosts.allow file.
7127608Stjr#	See hosts_options(5) for the format of this file.
8127608Stjr#	hosts_access(5) no longer fully applies.
9127608Stjr
10127608Stjr#	 _____                                      _          _ 
11127608Stjr#	| ____| __  __   __ _   _ __ ___    _ __   | |   ___  | |
12127608Stjr#	|  _|   \ \/ /  / _` | | '_ ` _ \  | '_ \  | |  / _ \ | |
13127608Stjr#	| |___   >  <  | (_| | | | | | | | | |_) | | | |  __/ |_|
14127608Stjr#	|_____| /_/\_\  \__,_| |_| |_| |_| | .__/  |_|  \___| (_)
15127608Stjr#					   |_|                   
16127608Stjr# !!! This is an example! You will need to modify it for your specific
17127608Stjr# !!! requirements!
18127608Stjr
19127608Stjr
20127608Stjr# Start by allowing everything (this prevents the rest of the file
21127608Stjr# from working, so remove it when you need protection).
22127608Stjr# The rules here work on a "First match wins" basis.
23127608StjrALL : ALL : allow
24127608Stjr
25127608Stjr# Wrapping sshd(8) is not normally a good idea, but if you
26127608Stjr# need to do it, here's how
27127608Stjr#sshd : .evil.cracker.example.com : deny 
28196820Sdes
29127608Stjr# Protect against simple DNS spoofing attacks by checking that the
30127608Stjr# forward and reverse records for the remote host match. If a mismatch
31127608Stjr# occurs, access is denied, and any positive ident response within
32127608Stjr# 20 seconds is logged. No protection is afforded against DNS poisoning,
33127608Stjr# IP spoofing or more complicated attacks. Hosts with no reverse DNS
34127608Stjr# pass this rule.
35127608StjrALL : PARANOID : RFC931 20 : deny
36127608Stjr
37127608Stjr# Allow anything from localhost.  Note that an IP address (not a host
38127608Stjr# name) *MUST* be specified for rpcbind(8).
39127608StjrALL : localhost 127.0.0.1 : allow
40127608StjrALL : my.machine.example.com 192.0.2.35 : allow
41127608Stjr
42127608Stjr# To use IPv6 addresses you must enclose them in []'s
43127608StjrALL : [fe80::%fxp0]/10 : allow
44127608StjrALL : [fe80::]/10 : deny
45127608StjrALL : [3ffe:fffe:2:1:2:3:4:3fe1] : deny
46127608StjrALL : [3ffe:fffe:2:1::]/64 : allow
47127608Stjr
48127608Stjr# Sendmail can help protect you against spammers and relay-rapers
49127608Stjrsendmail : localhost : allow
50127608Stjrsendmail : .nice.guy.example.com : allow
51127608Stjrsendmail : .evil.cracker.example.com : deny
52127608Stjrsendmail : ALL : allow
53127608Stjr
54127608Stjr# Exim is an alternative to sendmail, available in the ports tree
55127608Stjrexim : localhost : allow
56127608Stjrexim : .nice.guy.example.com : allow
57127608Stjrexim : .evil.cracker.example.com : deny
58exim : ALL : allow
59
60# Rpcbind is used for all RPC services; protect your NFS!
61# (IP addresses rather than hostnames *MUST* be used here)
62rpcbind : 192.0.2.32/255.255.255.224 : allow
63rpcbind : 192.0.2.96/255.255.255.224 : allow
64rpcbind : ALL : deny
65
66# NIS master server. Only local nets should have access
67ypserv : localhost : allow
68ypserv : .unsafe.my.net.example.com : deny
69ypserv : .my.net.example.com : allow
70ypserv : ALL : deny
71
72# Provide a small amount of protection for ftpd
73ftpd : localhost : allow
74ftpd : .nice.guy.example.com : allow
75ftpd : .evil.cracker.example.com : deny
76ftpd : ALL : allow
77
78# You need to be clever with finger; do _not_ backfinger!! You can easily
79# start a "finger war".
80fingerd : ALL \
81	: spawn (echo Finger. | \
82	 /usr/bin/mail -s "tcpd\: %u@%h[%a] fingered me!" root) & \
83	: deny
84
85# The rest of the daemons are protected.
86ALL : ALL \
87	: severity auth.info \
88	: twist /bin/echo "You are not welcome to use %d from %h."
89