hosts.allow revision 90319
145088Smarkm#
256585Sobrien# hosts.allow access control file for "tcp wrapped" applications.
350472Speter# $FreeBSD: head/etc/hosts.allow 90319 2002-02-06 20:39:36Z markm $
445088Smarkm#
558750Scwt# NOTE: The hosts.deny file is deprecated.
658750Scwt#       Place both 'allow' and 'deny' rules in the hosts.allow file.
756585Sobrien#	See hosts_options(5) for the format of this file.
856585Sobrien#	hosts_access(5) no longer fully applies.
945088Smarkm
1053685Sobrien#	 _____                                      _          _ 
1153685Sobrien#	| ____| __  __   __ _   _ __ ___    _ __   | |   ___  | |
1253685Sobrien#	|  _|   \ \/ /  / _` | | '_ ` _ \  | '_ \  | |  / _ \ | |
1353685Sobrien#	| |___   >  <  | (_| | | | | | | | | |_) | | | |  __/ |_|
1453685Sobrien#	|_____| /_/\_\  \__,_| |_| |_| |_| | .__/  |_|  \___| (_)
1553685Sobrien#					   |_|                   
1653685Sobrien# !!! This is an example! You will need to modify it for your specific
1753685Sobrien# !!! requirements!
1845088Smarkm
1953685Sobrien
2045088Smarkm# Start by allowing everything (this prevents the rest of the file
2145088Smarkm# from working, so remove it when you need protection).
2245488Smarkm# The rules here work on a "First match wins" basis.
2345088SmarkmALL : ALL : allow
2445088Smarkm
2545088Smarkm# Wrapping sshd(8) is not normally a good idea, but if you
2645088Smarkm# need to do it, here's how
2745488Smarkm#sshd : .evil.cracker.example.com : deny 
2845088Smarkm
2981890Sdwmalone# Protect against simple DNS spoofing attacks by checking that the
3081890Sdwmalone# forward and reverse records for the remote host match. If a mismatch
3181890Sdwmalone# occurs, access is denied, and any positive ident response within
3281890Sdwmalone# 20 seconds is logged. No protection is afforded against DNS poisoning,
3381890Sdwmalone# IP spoofing or more complicated attacks. Hosts with no reverse DNS
3481890Sdwmalone# pass this rule.
3545088SmarkmALL : PARANOID : RFC931 20 : deny
3645088Smarkm
3760031Ssheldonh# Allow anything from localhost.  Note that an IP address (not a host
3874537Salfred# name) *MUST* be specified for rpcbind(8).
3960031SsheldonhALL : localhost 127.0.0.1 : allow
4060031SsheldonhALL : my.machine.example.com 192.0.2.35 : allow
4145088Smarkm
4263515Sume# To use IPv6 addresses you must enclose them in []'s
4363515SumeALL : [fe80::%fxp0]/10 : allow
4463515SumeALL : [fe80::]/10 : deny
4563515SumeALL : [3ffe:fffe:2:1:2:3:4:3fe1] : deny
4663515SumeALL : [3ffe:fffe:2:1::]/64 : allow
4763515Sume
4845088Smarkm# Sendmail can help protect you against spammers and relay-rapers
4945088Smarkmsendmail : localhost : allow
5045488Smarkmsendmail : .nice.guy.example.com : allow
5145488Smarkmsendmail : .evil.cracker.example.com : deny
5245088Smarkmsendmail : ALL : allow
5345088Smarkm
5449394Ssheldonh# Exim is an alternative to sendmail, available in the ports tree
5549394Ssheldonhexim : localhost : allow
5649394Ssheldonhexim : .nice.guy.example.com : allow
5749394Ssheldonhexim : .evil.cracker.example.com : deny
5849394Ssheldonhexim : ALL : allow
5949394Ssheldonh
6076030Salex# Rpcbind is used for all RPC services; protect your NFS!
6153685Sobrien# (IP addresses rather than hostnames *MUST* be used here)
6274537Salfredrpcbind : 192.0.2.32/255.255.255.224 : allow
6374537Salfredrpcbind : 192.0.2.96/255.255.255.224 : allow
6474537Salfredrpcbind : ALL : deny
6545488Smarkm
6690319Smarkm# NIS master server. Only local nets should have access
6790319Smarkmypserv : localhost : allow
6890319Smarkmypserv : .unsafe.my.net.example.com : deny
6990319Smarkmypserv : .my.net.example.com : allow
7090319Smarkmypserv : ALL : deny
7190319Smarkm
7245088Smarkm# Provide a small amount of protection for ftpd
7345488Smarkmftpd : localhost : allow
7445488Smarkmftpd : .nice.guy.example.com : allow
7545488Smarkmftpd : .evil.cracker.example.com : deny
7645088Smarkmftpd : ALL : allow
7745088Smarkm
7845088Smarkm# You need to be clever with finger; do _not_ backfinger!! You can easily
7945088Smarkm# start a "finger war".
8045088Smarkmfingerd : ALL \
8145088Smarkm	: spawn (echo Finger. | \
8245088Smarkm	 /usr/bin/mail -s "tcpd\: %u@%h[%a] fingered me!" root) & \
8345088Smarkm	: deny
8445088Smarkm
8557284Sjkh# The rest of the daemons are protected.
8645088SmarkmALL : ALL \
8757284Sjkh	: severity auth.info \
8845088Smarkm	: twist /bin/echo "You are not welcome to use %d from %h."
89