From owner-freebsd-doc Sun Jul 7 13:20:22 2002 Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1486B37B401 for ; Sun, 7 Jul 2002 13:20:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC71D43E52 for ; Sun, 7 Jul 2002 13:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g67KK1JU028006 for ; Sun, 7 Jul 2002 13:20:01 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g67KK1rY028005; Sun, 7 Jul 2002 13:20:01 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 828AE37B400 for ; Sun, 7 Jul 2002 13:14:54 -0700 (PDT) Received: from guest.reppep.com (guest.reppep.com [64.81.19.110]) by mx1.FreeBSD.org (Postfix) with ESMTP id 877E343E42 for ; Sun, 7 Jul 2002 13:14:53 -0700 (PDT) (envelope-from pepper@reppep.com) Received: by guest.reppep.com (Postfix, from userid 501) id 63209A944; Sun, 7 Jul 2002 16:15:13 -0400 (EDT) Message-Id: <20020707201513.63209A944@guest.reppep.com> Date: Sun, 7 Jul 2002 16:15:13 -0400 (EDT) From: Chris Pepper Reply-To: Chris Pepper To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: docs/40313: Grammar, wording, and clarifications for handbook/security/chapter.sgml Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 40313 >Category: docs >Synopsis: Grammar, wording, and clarifications for handbook/security/chapter.sgml >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Sun Jul 07 13:20:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Chris Pepper >Release: FreeBSD 4.6-STABLE i386 >Organization: >Environment: System: FreeBSD guest.reppep.com 4.6-STABLE FreeBSD 4.6-STABLE #3: Sun Jul 7 02:08:43 EDT 2002 root@guest.reppep.com:/usr/obj/usr/src/sys/GENERIC i386 >Description: The IPFW chapter assumes all firewalling occurs in the kernel; it might not on a non-FreeBSD system. There are some awkward word choices. >How-To-Repeat: Visit . >Fix: The patch below removes assumptions that firewall occurs in the kernel from the text. It improves some wording. There are some outstanding issues I lacked sufficient information to address: This page should mention NAT, which is the firewalling term most likely to be recognized by new users. As the main part of the IPFW system lives in the kernel, you will need to add one or more options to your kernel configuration file, depending on what facilities you want, and recompile your kernel. See "Reconfiguring your Kernel" () for more details on how to recompile your kernel. This is no longer correct -- ipfw can be kldloaded. It would be good to mention that IPFW can be activated through /etc/rc.conf, along with any additional requirements and warnings that accompany this procedure (IPFIREWALL_FORWARD broken per kern/39814; DIVERT broken for ipfw.kld per ). There are currently three kernel configuration options relevant to IPFW: Per LINT, it's 4 (or 9 with IPv6). There are two related parts to IPFW. The firewall section allows you to perform packet filtering. There is also an IP accounting section which allows you to track usage of your router, based on similar rules to the firewall section. This allows you to see (for example) how much traffic your router is getting from a certain machine, or how much WWW (World Wide Web) traffic it is forwarding. Previous versions of IPFW used separate firewall and accounting entries. The present version provides packet accounting with each firewall entry. These paras (in different sections) disagree. If both filtering and accounting now use a unified ruleset, the first should be updated. --- chapter.sgml.diff begins here --- Index: chapter.sgml =================================================================== RCS file: /home/ncvs/doc/en_US.ISO8859-1/books/handbook/security/chapter.sgml,v retrieving revision 1.111 diff -u -u -r1.111 chapter.sgml --- chapter.sgml 2002/06/18 09:58:50 1.111 +++ chapter.sgml 2002/07/07 19:47:27 @@ -919,8 +919,8 @@ respect except that it forwards encryption keys by default. What this means is that if you have a secure workstation holding keys that give you access to the rest of the system, and you - ssh to an insecure machine, your keys - becomes exposed. The actual keys themselves are not exposed, but + ssh to an insecure machine, your keys are usable by the + insecure system. The actual keys themselves are not exposed, but ssh installs a forwarding port for the duration of your login, and if an attacker has broken root on the @@ -1921,7 +1921,7 @@ There are currently two distinct types of firewalls in common use on the Internet today. The first type is more properly called a - packet filtering router, where the kernel on a + packet filtering router, where a multi-homed machine chooses whether to forward or block packets based on a set of rules. The second type, known as a proxy server, relies on daemons to provide authentication and to @@ -1946,29 +1946,29 @@ Packet Filtering Routers A router is a machine which forwards packets between two or more - networks. A packet filtering router has an extra piece of code in - its kernel which compares each packet to a list of rules before + networks. A packet filtering router has extra code to + compare each packet to a list of rules before deciding if it should be forwarded or not. Most modern IP routing software has packet filtering code within it that defaults to forwarding all packets. To enable the filters, you need to define a - set of rules for the filtering code so it can decide if the + set of rules for the filtering code so it can decide if any given packet should be allowed to pass or not. - To decide whether a packet should be passed on, the code looks + To decide whether a packet should be passed on, the firewall looks through its set of rules for a rule which matches the contents of - this packets headers. Once a match is found, the rule action is + the packet's headers. Once a match is found, the rule action is obeyed. The rule action could be to drop the packet, to forward the packet, or even to send an ICMP message back to the originator. - Only the first match counts, as the rules are searched in order. + Only the first match counts, and the rules are searched in order. Hence, the list of rules can be referred to as a rule chain. - The packet matching criteria varies depending on the software + The packet-matching criteria varies depending on the software used, but typically you can specify rules which depend on the source IP address of the packet, the destination IP address, the source port number, the destination port number (for protocols which support ports), or even the packet type (UDP, TCP, ICMP, - etc). + etc.). @@ -1976,29 +1976,29 @@ Proxy servers are machines which have had the normal system daemons (telnetd, - ftpd, etc) replaced with special servers. + ftpd, etc.) replaced with special servers. These - servers are called proxy servers as they + servers are called proxy servers, as they normally only allow onward connections to be made. This enables you - to run (for example) a proxy telnet server on your firewall host, - and people can telnet in to your firewall from the outside, go + to run (for example) a proxy telnet server on your firewall host, + so people can telnet in to your firewall from the outside, go through some authentication mechanism, and then gain access to the internal network (alternatively, proxy servers can be used for signals coming from the internal network and heading out). Proxy servers are normally more secure than normal servers, and often have a wider variety of authentication mechanisms available, - including one-shot password systems so that even if - someone manages to discover what password you used, they will not be - able to use it to gain access to your systems as the password - instantly expires. As they do not actually give users access to the + including one-shot password systems, so that even if + someone manages to record a password being used, they will not be + able to use it, as the password + instantly expires on first use. As they do not actually give users direct access to the host machine, it becomes a lot more difficult for someone to install backdoors around your security system. Proxy servers often have ways of restricting access further, so that only certain hosts can gain access to the servers, and often - they can be set up so that you can limit which users can talk to - which destination machine. Again, what facilities are available + they can be set up to limit which users can talk to + which destination machines. Again, what facilities are available depends largely on what proxy software you choose. @@ -2011,12 +2011,12 @@ FreeBSD, is a packet filtering and accounting system which resides in the kernel, and has a user-land control utility, &man.ipfw.8;. Together, they allow you to define and query the - rules currently used by the kernel in its routing decisions. + rules used by the kernel for its routing decisions. There are two related parts to IPFW. - The firewall section allows you to perform packet filtering. There is - also an IP accounting section which allows you to track usage of your - router, based on similar rules to the firewall section. This allows + The firewall section performs packet filtering. There is + also an IP accounting section which tracks usage of your + router, based on similar rules. This allows you to see (for example) how much traffic your router is getting from a certain machine, or how much WWW (World Wide Web) traffic it is forwarding. @@ -2078,13 +2078,13 @@ firewall activity, but do not want to be open to a denial of service attack via syslog flooding. - When a chain entry reaches the packet limit specified, + When a chain entry (rule) reaches the packet limit specified, logging is turned off for that particular entry. To resume logging, you will need to reset the associated counter using the &man.ipfw.8; utility: &prompt.root; ipfw zero 4500 - Where 4500 is the chain entry you wish to continue + Where 4500 is the chain entry you wish to resume logging. @@ -2200,9 +2200,9 @@ allow - Pass the packet on as normal. (aliases: - pass and - accept) + Pass the packet on as normal (aliases: + pass, permit, and + accept). @@ -2212,7 +2212,7 @@ Drop the packet. The source is not notified via an ICMP message (thus it appears that the packet never - arrived at the destination). + arrived at the destination). Alias: drop. @@ -2362,11 +2362,11 @@ Matches if the IP header contains the comma separated list of options specified in spec. The - supported list of IP options are: ssrr + supported list of IP options is: ssrr (strict source route), lsrr (loose source route), rr (record packet route), and ts (time stamp). The absence of a - particular option may be denoted with a leading + particular option may be specified with a leading !. @@ -2434,10 +2434,10 @@ -a -t -N - l + list - There are three valid flags when using this form of the + The list command may be abbreviated. There are three valid flags when using this form of the command: @@ -2482,7 +2482,7 @@ This causes all entries in the firewall chain to be removed except the fixed default policy enforced by the kernel (index - 65535). Use caution when flushing rules, the default deny policy + 65535). Use caution when flushing rules; the default deny policy will leave your system cut off from the network until allow entries are added to the chain. @@ -2499,7 +2499,7 @@ When used without an index argument, all packet counters are cleared. If an - index is supplied, the clearing operation + index is supplied, the clear operation only affects a specific chain entry. @@ -2546,25 +2546,25 @@ The following suggestions are just that: suggestions. The - requirements of each firewall are different and we cannot tell you + requirements for each firewall are different and we cannot tell you how to build a firewall to meet your particular requirements. When initially setting up your firewall, unless you have a test bench setup where you can configure your firewall host in a controlled - environment, it is strongly recommend you use the logging version of the + environment, it is strongly recommend you use the logging versions of the commands and enable logging in the kernel. This will allow you to quickly identify problem areas and cure them without too much disruption. Even after the initial setup phase is complete, I - recommend using the logging for `deny' as it allows tracing of + recommend using the logging for `deny' rule, as it allows tracing of possible attacks and also modification of the firewall rules if your - requirements alter. + requirements change. If you use the logging versions of the accept command, it can generate large amounts of log - data as one log line will be generated for every packet that passes - through the firewall, so large FTP/http transfers, etc, will really + data, as one log line will be generated for every packet that passes + through the firewall; this means large FTP/http transfers, etc., will really slow the system down. It also increases the latencies on those packets as it requires more work to be done by the kernel before the packet can be passed on. syslogd will @@ -2576,7 +2576,7 @@ You should enable your firewall from /etc/rc.conf.local or - /etc/rc.conf. The associated manual page explains + /etc/rc.conf. The /etc/rc.conf manual page explains which knobs to fiddle and lists some preset firewall configurations. If you do not use a preset configuration, ipfw list will output the current ruleset into a file that you can @@ -2590,7 +2590,7 @@ do! This is largely dependent on what access to your network you want to allow from the outside, and how much access to the outside world you want to allow from the inside. Some general - rules are: + rules to start with are: @@ -2603,7 +2603,7 @@ Block all incoming UDP traffic. There are very few useful services that travel over UDP, and what useful traffic there is, is normally a security threat (e.g. Suns RPC and - NFS protocols). This has its disadvantages also, since UDP is a + NFS protocols). This has its disadvantages also; since UDP is a connectionless protocol, denying incoming UDP traffic also blocks the replies to outgoing UDP traffic. This can cause a problem for people (on the inside) using external archie (prospero) servers. @@ -2626,7 +2626,7 @@ Check what ports any internal servers use (e.g. SQL servers, - etc). It is probably a good idea to block those as well, as they + etc.). It is probably a good idea to block those as well, as they normally fall outside the 1-1024 range specified above. @@ -2659,13 +2659,13 @@ ip_fw_chk routine, displaying the results to the console every 1000 packets. - Two rule sets, each with 1000 rules were tested. The + Two rule sets, each with 1000 rules, were tested. The first set was designed to demonstrate a worst case scenario by repeating the rule: &prompt.root; ipfw add deny tcp from any to any 55555 - This demonstrates worst case by causing most of IPFW's + This demonstrates a worst case by causing most of IPFW's packet check routine to be executed before finally deciding that the packet does not match the rule (by virtue of the port number). Following the 999th iteration of this rule was an @@ -2686,7 +2686,7 @@ rule. Thus the theoretical packet processing limit with these rules is around 370 packets per second. Assuming 10Mbps Ethernet and a ~1500 byte packet size, we would only be able - to achieve a 55.5% bandwidth utilization. + to achieve 55.5% bandwidth utilization. For the latter case each packet was processed in approximately 1.172ms, or roughly 1.2 microseconds per rule. --- chapter.sgml.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message