?? 00000143.htm
字號:
<HTML><HEAD> <TITLE>BBS水木清華站∶精華區</TITLE></HEAD><BODY><CENTER><H1>BBS水木清華站∶精華區</H1></CENTER>發信人: CuteGuy (被大頭針扎傷※休養中), 信區: Linux <BR>標 題: Enhancing System Security With TCP Wrappers(轉) <BR>發信站: BBS 水木清華站 (Sun May 2 12:33:43 1999) <BR> <BR> <BR> <BR><A HREF="http://www.performancecomputing.com/Linux-IT/features/9905of1.shtml">http://www.performancecomputing.com/Linux-IT/features/9905of1.shtml</A> <BR> <BR>LINUX-IT - MAY 1999 <BR> Enhancing System Security With TCP Wrappers <BR>Paul Dunne <BR>TCP Wrappers, written by Wietse Venema, is a tool that filters incoming <BR>connections to network services. This article looks at how TCP Wrappers can <BR>be used to enhance the security of a networked system. The example platform <BR>is Linux, but the information <BR>is applicable to most any UNIX system. <BR>The idea of the package is to provide "wrapper" daemons that can be installed <BR>without any changes to existing software. <BR> <BR>Most TCP/IP applications depend on the client-server model--that is, when a <BR>connection is requested by a client, a server process is started on the host <BR>to deal with it. TCP Wrappers works by interposing an additional layer, or <BR>wrapper, between client <BR>and server. In the basic service, the wrapper logs the name of the client <BR>host and requested service, then hands the communication over to the real <BR>daemon, neither exchanging information with the client or server, nor <BR>imposing overhead on the actual <BR>conversation between the two. Optional features may be enabled, including <BR>access control, client username lookups, and additional protection against <BR>hostname spoofing. <BR>The current version of TCP Wrappers, 7.6, can be obtained from <BR><A HREF="ftp://ftp.porcupine.org/pub/security/.">ftp://ftp.porcupine.org/pub/security/.</A> (Note that the old location, <BR><A HREF="ftp://ftp.win.tue.nl/pub/security/,">ftp://ftp.win.tue.nl/pub/security/,</A> was compromised earlier this year and is <BR>no longer maintained.) <BR>Compilation <BR>There are a few decisions to make at compile time. Features can be turned on <BR>or off through definitions. Here is a list, with default values shown where <BR>appropriate: <BR>STYLE = -DPROCESS_OPTIONS <BR>Enables language extensions. This is disabled by default. <BR>FACILITY=LOG_MAIL <BR>Sets the location of log records. I prefer to set this to LOG_DAEMON, and log <BR>stuff into /var/log/daemon. Your mileage may vary. <BR>SEVERITY= LOG_INFO <BR>Sets what level to give to the log message. The default, LOG_INFO, is fine in <BR>most cases. The complete list is, in ascending order of severity, debug, <BR>notice, warning, err, crit, alert, emerg. See the syslog.conf(5) man page for <BR>more details. <BR>HOSTS_ACCESS <BR>When compiled with this option, the wrapper programs support a simple form of <BR>access control. Since this is the reason most people install TCP Wrappers, it <BR>is defined by default. <BR>PARANOID <BR>When compiled with -DPARANOID, the wrappers try to look up and double-check <BR>the client hostname, and will always refuse service in case of a discrepancy <BR>between hostname and IP address. This is a reasonable policy for most <BR>systems. When compiled <BR>without -DPARANOID, the wrappers by default still perform hostname lookup, <BR>but hosts where such lookups give conflicting results for hostname and IP <BR>address are not automatically rejected. They can be matched with the PARANOID <BR>wildcard in the access <BR>files, and a decision can be made on whether to grant access. <BR>DOT= -DAPPEND_DOT <BR>This appends a dot to a domain name. For example, "example.com" becomes <BR>"example.com.". This is done because typically, the resolver will first <BR>append substrings of the local domain before trying to resolve the name it <BR>has actually been given. Use of <BR>the APPEND_DOT feature stops this waste of time and resources. It is off by <BR>default. <BR>AUTH = -DALWAYS_RFC931 <BR>Always attempt remote username lookups. By default, this is off, and the <BR>wrappers look up the remote username only when the access-control rules <BR>require them to do so. Note that for this to be of any use, the remote host <BR>must run a daemon that supports <BR>the finger protocol. Also, such lookups are not possible for UDP-based <BR>connections. <BR>RFC931_TIMEOUT = 10 <BR>Username lookup timeout. This may not be long enough for slow hosts or <BR>networks, but is enough to irritate PC users. <BR>-DDAEMON_UMASK=022 <BR>The is the default file-protection mask for processes run under control of <BR>the wrappers. <BR>ACCESS = -DHOSTS_ACCESS <BR>Sets host access control. This is enabled by default. Note that this can also <BR>be turned off at run time by providing no, or empty, access-control tables. <BR>TABLES = -DHOSTS_DENY=\"/etc/ <BR> hosts.deny\" -DHOSTS_ <BR> ALLOW=\"/etc/hosts.allow\" <BR>Sets the pathnames for the access-control tables. <BR>HOSTNAME= -DALWAYS_HOSTNAME <BR>Always attempt to look up the client hostname. This is on by default. If this <BR>is disabled, the client hostname lookup is postponed until the name is <BR>required by an access-control rule or by a %letter expansion. If this is what <BR>you want, you must <BR>disable paranoid mode as well. <BR>-DKILL_IP_OPTIONS <BR>This is for protection against hosts that pretend they have someone else's <BR>host address (host address spoofing). This option is not needed on modern <BR>UNIX systems that can stop source-routed traffic in the kernel (for example, <BR>Linux, Solaris 2.x, 4.4BSD <BR>and derivatives). <BR>-DNETGROUP <BR>Defines if your system has NIS support. Off by default. This is used only in <BR>conjunction with host access control, so if you're not using that, don't <BR>bother about this in any case. <BR>Some definitions are given that work around system bugs (just the basics <BR>here; see Makefile for details). The standard define is: <BR>BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK <BR>Having set the options to your requirements, type make sys-type, where <BR>sys-type is one of the 48 systems listed in Figure 1. As you can see, enough <BR>choices! <BR>If none of these matches your environment, then you will have to edit the <BR>system dependencies sections in the Makefile and do a make other. <BR>Installation <BR>There are two ways to install the software. The easy installation method <BR>requires no changes to existing software or configuration files. You move the <BR>daemons that you want to protect to the directory specified in <BR>REAL_DAEMON_DIR in the Makefile, <BR>replacing them with copies of the tcpd program. For example, for telnet: <BR>mkdir REAL_DAEMON_DIR <BR>mv /sbin/in.telnetd REAL_DAEMON_DIR <BR>cp tcpd /sbin/in.telnetd <BR>That's all there is to it. Note that the wrapper, all files used by the <BR>wrapper, and all directories in the path leading to those files should have <BR>read- or read-and-execute-only access (modes 755 or 555); they must not be <BR>writable. There is no need to <BR>set the wrapper set-uid. <BR>The advanced installation method leaves your daemon executables alone, but <BR>involves simple modifications to the inetd configuration file /etc/inetd.conf. <BR> The changes to inetd.conf are straightforward. For each service to be <BR>protected by wrappers, tcpd <BR>should be executed in place of the original daemon, passing the original <BR>daemon pathname as an argument to tcpd. <BR>Here is a standard inetd.conf record for telnet service: <BR>telnet stream tcp nowait root /sbin/in.telnetd /sbin/in.telnetd <BR>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -