rwhoisd Security Considerations Version 1.5.0 1-Feb-98 ------------------------------------------------------------------------ rwhoisd is in no way guaranteed to be secure. With that said, it also does not do many of the things that make other Internet services insecure, say, for instance, allowing users to download files onto a machine (like ftp) or allowing users to specify in data something that gets executed. Nonetheless, Network Solutions (NSI) strongly recommends that the user follows sound security practices. rwhoisd provides a number of built-in ways to be more secure. Run the Server as an Unprivileged User There is no need to run the rwhoisd process as root. The Internet Assigned Numbers Authority (IANA) assigned port, 4321, is not in the restricted range, and rwhoisd needs no access to typically restricted files. If you run rwhoisd as root (say, from startup), it will attempt to setuid(2) and setgid(2) to the user specified in the 'userid' parameter in the main configuration file. It sets the group id to the group set for the user in /etc/passwd. It does all of this before creating the socket (and accepting input from the outside world). Use TCP Wrappers rwhoisd contains built-in calls to Weitse Venema's TCP Wrappers code. You can specify which files to use for the allow and deny files in the main configuration file (they default to the standard /etc/hosts.allow and /etc/hosts.deny files). You can wrap the server itself using the 'rwhoisd' tag, and you can protect individual directives by using the directive name. See the operations guide and the TCP Wrappers for more details. Use chroot(2) The chroot system call resets the file system root directory to another (non-root) directory. The operating system then protects the rest of the filesystem from the process that was chrooted. This limits what a possible intruder can do. An intruder may be able to trash your rwhoisd installation, but they will not be able to steal any other data and will not be able to damage any other part of your filesystem. The use of chroot(2) is recommended. rwhoisd can be configured to do this by setting up the chrooted environment and by setting the main configuration variable 'chrooted' to TRUE or running rwhoisd with a '-s' option. Since each operating system--and even each installation--can vary so widely, there is no universal method for setting up a chroot environment. Instead, these are considered general guidelines on setting up the environment. The specifics given here will undoubtedly need to be modified to fit your specific case. Also, a good reference for setting up chroot environments can often be found in the ftpd manpage of your system, which is also often chrooted. ------------------------------------------------------------------------ 1. Make sure that there are dev, etc, tmp, and usr/lib directories off of the prefix directory ('root-dir') in the main configuration file. 2. Make sure the necessary binaries exist in their expected location. rwhoisd uses the following extra binaries: sh, sort, pgp (possibly), plus any binaries used for extended directives (/bin/date for example). sh and sort, and the extended directive binaries should be placed in