home *** CD-ROM | disk | FTP | other *** search
- @(#) README 1.2 92/07/06 19:53:25
-
- Description
- -----------
-
- This is a portmapper replacement with access control in the style of
- the tcp wrapper (log_tcp) package. It provides a simple mechanism to
- discourage access to the NIS (YP), NFS, and other services registered
- with the portmapper.
-
- In some cases, better or equivalent alternatives are available:
-
- The SunOS portmap that is provided with patch id 100482-02 should
- close the same security holes. In addition, it provides NIS
- daemons with their own access control lists. This is better than
- just portmapper access control.
-
- The "securelib" shared library (eecs.nwu.edu:/pub/securelib.tar)
- implements access control for all kinds of (RPC) services, not
- just the portmapper.
-
- Reportedly, Irix 4.0.x already has a secured portmapper.
-
- However, many vendors still ship portmap implementations that allow
- anyone to read or modify its tables and that will happily forward any
- request so that it appears to come from the local system.
-
- Features
- --------
-
- - optional: host access control. The local host is always considered
- authorized. This feature requires the libwrap.a library that comes with
- recent tcp wrapper (log_tcp) implementations.
-
- - requests to change the portmap tables are accepted only when they
- come from the local system.
-
- - optional: requests to (un)register services on privileged ports (port
- < 1024) are accepted only when they come from a privileged port. This
- feature is optional because some RPC implementations still run all RPC
- daemons of an unprivileged port. Bug your vendor if your RPC is like
- that.
-
- - requests that are forwarded by the portmapper will be forwarded
- through an unprivileged port.
-
- - the portmapper refuses to forward requests to rpc daemons that do (or
- should) verify the origin of the request: at present, the list includes
- most of the calls to the NFS mountd/nfsd daemons and the NIS daemons.
-
- Restrictions
- ------------
-
- Limiting access to the portmapper does not protect you from direct
- attacks on the rpc daemons; the main task of portmap is to maintain a
- table of available RPC services and the network ports that they are
- listening on. The securelib can be used to protect individual RPC
- daemons, and the latest SunOS portmap+NIS fix already protects the NIS
- daemons and implements limited forwarding.
-
- On the other hand, even though a portmapper with access control only
- makes an attack more difficult, it still provides an excellent early
- warning system.
-
- Origin and portability
- ----------------------
-
- The sources in this distribution are derived from code on the second
- BSD networking tape, which was derived from Sun's RPCSRC 4.0 code, and
- from Sun's TIRPC (transport-independent rpc) distribution.
-
- The code compiles fine with SunOS 4.1.1, Ultrix 4.x and ESIX System V
- release 4.0, but I expect it will work with many other UNIX flavours.
- Tested with SunOS 4.1.1; an earlier version was also tested with Ultrix
- 3.0. If anyone can get this thing working with SYSV4 let me know; it
- didn't with ESIX.
-
- Installation
- ------------
-
- (1) Follow the instructions in the Makefile, then build the portmap and
- auxiliary executables.
-
- (2) Before killing the present portmap process, save the present
- portmapper tables using the command:
-
- ./pmap_dump >table
-
- If you kill the portmap process without saving its tables you will have
- to reboot the machine.
-
- Note: the information in the portmap tables is dynamic: For example, it
- will be different after each reboot. On a Sun, it even changes each
- time a windowing system is started that uses the selection service.
-
- (3) Kill the running portmap process and start the new portmap
- program. Then (still as root) initialize the portmap tables with:
-
- ./pmap_set <table
-
- (4) If you get error messages of the form: "not registered: xxxx",
- disable the CHECK_PORT feature in the Makefile, remove pmap_check.o and
- rebuild the portmap program. Then proceed with step 3.
-
- In order to revert to the original portmap daemon, kill off the running
- one, restart the original one and reload its tables using the
- "pmap_set" command as shown above.
-
- Suggested entries for the host access-control files are:
-
- /etc/hosts.allow:
- portmap: your.sub.net.number/your.sub.net.mask
- portmap: 255.255.255.255 0.0.0.0
-
- /etc/hosts.deny
- portmap: ALL: (finger -l @%h | mail root) &
-
- The syntax of the access-control files is described in the
- hosts_access.5 manual page that comes with the tcp wrapper (log_tcp)
- sources. The second line in the hosts.allow file may be needed if
- there are PC-NFS systems on your network segment.
-
- For security reasons, the portmap process does not run as root. The
- access control files should therefore be group readable.
-
- In order to avoid deadlocks, the portmap program does not attempt to
- look up the remote host name, nor will it try to match NIS netgroups.
- If you do not want to accept requests from everyone on your subnet you
- will have to enumerate the addresses of authorised hosts. There is no
- need to specify the local system: since it runs the portmap daemon, it
- is authorized by definition.
-
- Testing:
- --------
-
- Normally, only rejected requests will be reported via the syslog
- daemon. Logging is done in a child process, in order to avoid
- possible deadlock in case the logging code needs assistance from
- the portmapper.
-
- By default, the portmapper will be utterly silent. In fact, the portmap
- daemon is not consulted that often. Sending a SIGINT signal to the
- portmap process will enable the logging of all requests.
-
- Warning: with some systems, such as HP-UX, the logging code needs
- assistance from the portmapper. If verbose logging is on, these calls
- for assistance will also be logged, so that you end up with a system
- full of portmap processes.
-
- With verbose logging turned on, requests such as "ypcat" or "rpcinfo
- -p" should show up with log file entries such as:
-
- MMM dd hh:mm:ss hostname portmap[pid]: connect from x.x.x.x to getport(ypserv)
- MMM dd hh:mm:ss hostname portmap[pid]: connect from y.y.y.y to dump()
-
- Send another SIGINT to the portmapper to turn the verbose logging off.
-
- Acknowledgements
- ----------------
-
- Casper H.S. Dik (casper@fwi.uva.nl) provided lots of valuable
- information on RPC security and tested an intermediate version of the
- portmapper with SunOS 4.1.2. Lyford D. Rich (rich@ece.nps.navy.mil)
- was helpful with porting the daemon to Ultrix 3.0.
-
- Wietse Venema (wietse@wzv.win.tue.nl)
- Mathematics and Computing Science
- Eindhoven University of Technology
- The Netherlands
-