xref: /freebsd/lib/libwrap/hosts.allow (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
1#
2# hosts.allow access control file for "tcp wrapped" applications.
3#
4# NOTE: The hosts.deny file is deprecated.
5#       Place both 'allow' and 'deny' rules in the hosts.allow file.
6#       See hosts_options(5) for the format of this file.
7#       hosts_access(5) no longer fully applies.
8#
9#   _____                                      _          _
10#  | ____| __  __   __ _   _ __ ___    _ __   | |   ___  | |
11#  |  _|   \ \/ /  / _` | | '_ ` _ \  | '_ \  | |  / _ \ | |
12#  | |___   >  <  | (_| | | | | | | | | |_) | | | |  __/ |_|
13#  |_____| /_/\_\  \__,_| |_| |_| |_| | .__/  |_|  \___| (_)
14#                                     |_|
15# !!! This is an example! You will need to modify it for your specific
16# !!! requirements!
17
18
19# Start by allowing everything (this prevents the rest of the file
20# from working, so remove it when you need protection).
21# The rules here work on a "First match wins" basis.
22ALL : ALL : allow
23
24# Wrapping sshd(8) is not normally a good idea, but if you
25# need to do it, here's how
26#sshd : .evil.cracker.example.com : deny
27
28# Protect against simple DNS spoofing attacks by checking that the
29# forward and reverse records for the remote host match. If a mismatch
30# occurs, access is denied, and any positive ident response within
31# 20 seconds is logged. No protection is afforded against DNS poisoning,
32# IP spoofing or more complicated attacks. Hosts with no reverse DNS
33# pass this rule.
34ALL : PARANOID : RFC931 20 : deny
35
36# Allow anything from localhost.  Note that an IP address (not a host
37# name) *MUST* be specified for rpcbind(8).
38ALL : localhost 127.0.0.1 : allow
39# Comment out next line if you build libwrap without IPv6 support.
40ALL : [::1] : allow
41#ALL : my.machine.example.com 192.0.2.35 : allow
42
43# To use IPv6 addresses you must enclose them in []'s
44#ALL : [fe80::%fxp0]/10 : allow
45#ALL : [fe80::]/10 : deny
46#ALL : [2001:db8:2:1:2:3:4:3fe1] : deny
47#ALL : [2001:db8:2:1::]/64 : allow
48
49# Sendmail can help protect you against spammers and relay-rapers
50sendmail : localhost : allow
51#sendmail : .nice.guy.example.com : allow
52#sendmail : .evil.cracker.example.com : deny
53sendmail : ALL : allow
54
55# Exim is an alternative to sendmail, available in the ports tree
56exim : localhost : allow
57#exim : .nice.guy.example.com : allow
58#exim : .evil.cracker.example.com : deny
59exim : ALL : allow
60
61# Rpcbind is used for all RPC services; protect your NFS!
62# Rpcbind should be running with -W option to support this.
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