home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume23 / log_tcp / part01 / README < prev    next >
Encoding:
Text File  |  1991-10-19  |  7.8 KB  |  171 lines

  1. @(#) README 1.6 91/10/04 21:28:09
  2.  
  3. General description
  4. -------------------
  5.  
  6. With this package you can monitor connections to the SYSTAT, FINGER,
  7. FTP, TELNET, RLOGIN, RSH, EXEC, TFTP, old and new TALK, and other IP
  8. network services.  Connections are reported through the syslog daemon.
  9. Requirements are that network daemons are started by the inetd program
  10. or something similar, and the availability of a syslog(3) library.
  11.  
  12. The programs are tiny front ends. By default, they just report the name
  13. of the remote host and of the requested service, and then invoke the
  14. real network daemon; no information is exchanged with the remote client
  15. process. In the most common case, no changes should be required to
  16. existing software or to existing configuration files.  Just move the
  17. vendor-provided daemons to another place and install the front ends
  18. into their original places.  Installation details are given below.
  19.  
  20. Early versions of the programs were tested with Ultrix >= 2.2, with
  21. SunOS >= 3.4 and ISC 2.2. Later versions have been installed on a wide
  22. variety of platforms (BSD-style, SYSV-style, Apollo's idea of UNIX).
  23.  
  24. The present release was tested with SunOS 4.1.1, Ultrix 4.1 and Apollo
  25. SR10.3.5, but it should still run without modification on top of most
  26. BSD-style TCP/IP implementations.
  27.  
  28. Restriction
  29. -----------
  30.  
  31. Some UDP (and RPC) daemons linger around for a while after they have
  32. finished their work, just in case another request comes in.  Only the
  33. request that started such a daemon will be logged. This restriction
  34. does normally not apply to connection-oriented (TCP) services.
  35.  
  36. Access control
  37. --------------
  38.  
  39. When compiled with -DHOSTS_ACCESS, the front-end programs support a
  40. simple form of access control that is based on pattern matching.  The
  41. access-control software provides hooks for the execution of shell
  42. commands when a pattern fires.  For details, see the hosts_access(5)
  43. manual page.
  44.  
  45. Detection of hosts that pretend to have someone elses host name
  46. ---------------------------------------------------------------
  47.  
  48. Authentication based on host names, such as used by RLOGIN and RSH,
  49. used to work quite reliably when all host name lookups were done from
  50. the local /etc/hosts file or its equivalent.
  51.  
  52. With _distributed_ name services, authentication schemes that rely on
  53. host names can be subverted by playing games with the address->name
  54. maps that are maintained by some far-away name server.  Many rshd and
  55. rlogind implementations still blindly believe the remote host name that
  56. they get from gethostbyaddr() and don't bother to check if that host
  57. name really belongs to the system that they are talking to.
  58.  
  59. The front-end programs verify the remote host name that was returned by
  60. the name server responsible for the address->name mapping, by looking
  61. at the host address that is returned by the name server responsible for
  62. the name->address mapping of that host name. If the latter address does
  63. not match the original host address, the front ends conclude that they
  64. are dealing with a host that pretends to have someone elses host name.
  65.  
  66. If the sources are compiled with -DPARANOID, the front ends will drop
  67. the connection in case of a host name/address mismatch. Otherwise, the
  68. front ends just ignore the bad host name and use the host address when
  69. consulting the access control tables.
  70.  
  71. Related software
  72. ----------------
  73.  
  74. Versions of rshd and rlogind, hacked to report the remote user name,
  75. are available for anonymous ftp (ftp.win.tue.nl:/pub/logdaemon.tar.Z).
  76. These programs are derived from BSD source; they have been tested only
  77. with SunOS >= 4.0.
  78.  
  79. Another way to manage access to tcp/ip services is illustrated by the
  80. servers provided with the authutil package (comp.sources.unix volume
  81. 22). This has the advantage that one will get the remote username from
  82. any host supporting RFC 931 security.  By installing the auth package
  83. (same volume) one supports RFC 931 security too (but you will have to
  84. believe what the remote host tells you).  Eventually one can start
  85. cutting off unauthenticated connections. This is obviously a much more
  86. advanced approach than what my front-end programs provide. The present
  87. package is more suitable for those who lack the resources to install
  88. anything that requires more than just renaming a couple of executables.
  89.  
  90. Configuration and installation (the easy way)
  91. ---------------------------------------------
  92.  
  93. An advanced installation recipe is given lateron. The "easy way" recipe
  94. requires no changes to existing software or configuration files.
  95.  
  96. If you don't run Ultrix, you don't need the miscd front-end program.
  97. The Ultrix miscd daemon implements among others the SYSTAT service,
  98. which pipes the output from the WHO command to standard output.
  99.  
  100. By default, the front-end programs assume that the vendor-provided
  101. daemons will be moved to the "/usr/etc/..." directory.  If you want
  102. something else, adjust the REAL_DAEMON and the REAL_DAEMON_DIR macros
  103. in the files miscd.c and tcpd.c.
  104.  
  105. Follow the instructions at the beginning of the Makefile and compile
  106. the programs. The result is three binaries. The `try' program can be
  107. used to play with host access control tables. The tcpd and miscd
  108. programs are the actual front end programs.
  109.  
  110. The tcpd program can be used for monitoring requests for the telnet,
  111. finger, ftp, exec, rsh, rlogin, tftp, talk, spray, rusers, comsat and
  112. other services that have a one-to-one mapping onto executable files.
  113.  
  114. Decide which services you want to be monitored. Move the corresponding
  115. vendor-provided daemon programs to the location specified by the
  116. REAL_DAEMON_DIR macro in the file tcpd.c, and copy the tcpd front end
  117. to the locations where the vendor-provided daemons used to be. That is,
  118. one copy of (or link to) the tcpd program for each service that you
  119. want to monitor.
  120.  
  121. Ultrix only: if you want to monitor connections to the SYSTAT service,
  122. move the vendor-provided miscd daemon to the location specified by the
  123. REAL_DAEMON macro in the miscd.c file, and install the miscd front end
  124. into the original miscd location.
  125.  
  126. Configuration and installation (the advanced way)
  127. -------------------------------------------------
  128.  
  129. Instead of moving the vendor-provided daemons to another directory,
  130. define the REAL_DAEMON_DIR to reflect the present location of those
  131. daemons, and install the tcpd command in the same directory (Apollo
  132. UNIX users will want to install the front end under a different name
  133. because tcpd is the name of an already existing command. A suitable
  134. name for the front-end program would be "frontd"). Then perform the
  135. following edits on the inetd configuration file (usually located in
  136. /etc/inetd.conf):
  137.  
  138.     finger  stream  tcp     nowait  nobody  /usr/etc/in.fingerd     in.fingerd
  139.  
  140. becomes:
  141.  
  142.     finger  stream  tcp     nowait  nobody  /usr/etc/tcpd           in.fingerd
  143.  
  144. (the example applies to SunOS 4.x; other UNIX implementations should
  145. not differ much). Similar changes will be needed for the other services
  146. that are to be covered by the tcpd (or frontd) front-end program. Send
  147. a SIGHUP to the inetd process to make the changes effective.
  148.  
  149. The same trick can be played with the Ultrix miscd daemon but then
  150. either the miscd daemon front end or the real miscd daemon will have to
  151. be given a different name.
  152.  
  153. Acknowledgements
  154. ----------------
  155.  
  156. Thanks to Brendan Kehoe (brendan@cs.widener.edu), Heimir Sverrisson
  157. (heimir@hafro.is) and Dan Bernstein (brnstnd@kramden.acf.nyu.edu) for
  158. feedback on an early release of this product.  The host name/address
  159. check was suggested by John Kimball (jkimball@src.honeywell.com).
  160. Willem-Jan Withagen (wjw@eb.ele.tue.nl), Pieter Schoenmakers
  161. (tiggr@es.ele.tue.nl) and Charles S. Fuller (fuller@wccs.psc.edu)
  162. provided help on dealing with with Apollo's UNIX environment.  Hal R.
  163. Brand (BRAND@addvax.llnl.gov) told me how to get the remote IP address
  164. in case of datagram-oriented services, and suggested the optional shell
  165. command feature.
  166.  
  167.     Wietse Venema (wietse@wzv.win.tue.nl),
  168.     Mathematics and Computing Science,
  169.     Eindhoven University of Technology,
  170.     The Netherlands.
  171.