Enabling TCP Wrappers in the Solaris 10 Operating System
Glenn Brunette, April, 2005
First let's first provide a little background. TCP Wrappers has been around for many, many years (see Wietse Venema's FTP archive). It is used to restrict access to TCP services based on host name, IP address, network address, and so on. For more details on what TCP Wrappers is and how you can use it, see tcpd(1M). TCP Wrappers was integrated into the Solaris Operating System starting in the Solaris 9 release, where both Solaris Secure Shell and inetd-based (streams, nowait) services were wrapped. Bonus points are awarded to anyone who knows why UDP services are not wrapped by default.
TCP Wrappers support in Secure Shell was always enabled since Secure Shell always called the TCP Wrapper function host_access(3) to determine if a connection attempt should proceed. If TCP Wrappers was not configured on that system, access, by default, would be granted. Otherwise, the rules as defined in the hosts.allow and hosts.deny files would apply. For more information on these files, see hosts_access(4). Note that this and all of the TCP Wrappers manual pages are stored under /usr/sfw/man in the Solaris 10 OS. To view this manual page, you can use the following command:
Code: Select all
$ man -M /usr/sfw/man -s 4 hosts_access
In the Solaris 10 OS, two new services were wrapped: sendmail and rpcbind. sendmail works in a way similar to Secure Shell. It always calls the host_access function and therefore TCP Wrappers support is always enabled. Nothing else needs to be done to enable TCP Wrappers support for that service. On the other hand, TCP Wrappers support for rpcbind must be enabled manually using the new Service Management Facility (SMF). Similarly, inetd was modified to use a SMF property to control whether TCP Wrappers is enabled for inetd-based services.
Let's look at how to enable TCP Wrappers for inetd and rpcbind.
To enable TCP Wrappers support for inetd-based services, you can simply use the following commands:
Code: Select all
# inetadm -M tcp_wrappers=true
# svcadm refresh inetd
Code: Select all
# inetadm -l telnet | grep tcp_wrappers
default tcp_wrappers=TRUE
Code: Select all
# svcprop -p defaults inetd
defaults/tcp_wrappers boolean true
Code: Select all
# svccfg -s inetd setprop defaults/tcp_wrappers=true
# svcadm refresh inetd
Code: Select all
# inetadm -p | grep tcp_wrappers
tcp_wrappers=FALSE
# inetadm -l telnet | grep tcp_wrappers
default tcp_wrappers=FALSE
# inetadm -l ftp | grep tcp_wrappers
default tcp_wrappers=FALSE
Code: Select all
# inetadm -m telnet tcp_wrappers=TRUE
Code: Select all
# inetadm -p | grep tcp_wrappers
tcp_wrappers=FALSE
# inetadm -l telnet | grep tcp_wrappers
tcp_wrappers=TRUE
# inetadm -l ftp | grep tcp_wrappers
default tcp_wrappers=FALSE
You can enable TCP Wrappers support for rpcbind by running the following command:
Code: Select all
# svccfg -s rpc/bind setprop config/enable_tcpwrappers=true
# svcadm refresh rpc/bind
Code: Select all
# svcprop -p config/enable_tcpwrappers rpc/bind
true