home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / general / firewall.faq < prev    next >
Encoding:
Text File  |  2003-06-11  |  45.2 KB  |  871 lines

  1. Firewalls FAQ (Rev 8, updated Sun Jan  7 23:13:54 1996)
  2.  
  3. Archive-name: firewalls-faq
  4. Posting-Frequency: whenever updated
  5. Last-modified: Sun Jan  7 23:13:54 1996
  6. Version: 8
  7. Internet Firewalls Frequently Asked Questions
  8.  
  9. FAQ Maintainer: Marcus J. Ranum
  10.  
  11. About the FAQ
  12.  
  13. This FAQ is not an advertisement or endorsement for any product, company, or
  14. consultant. The maintainer welcomes input and comments on the contents of this
  15. FAQ. Comments related to the FAQ should be addressed to Fwalls-FAQ@v-one.com.
  16. The FAQ is also available via WWW from http://www.v-one.com. As of this
  17. writing, the FAQ's primary format is HTML.
  18.  
  19. Contents:
  20.  
  21.   1. What is a network firewall?
  22.  
  23.   2. Why would I want a firewall?
  24.  
  25.   3. What can a firewall protect against?
  26.  
  27.   4. What can't a firewall protect against?
  28.  
  29.   5. What about virusses?
  30.  
  31.   6. What are good sources of print information on firewalls?
  32.  
  33.   7.  Where can I get more information on firewalls on the network?
  34.  
  35.   8. What are some commercial products or consultants who sell/service
  36.      firewalls?
  37.  
  38.   9. What are some of the basic design decisions in a firewall?
  39.  
  40.  10. What are some of the basic types of firewall?
  41.  
  42.  11. What are proxy servers and how do they work?
  43.  
  44.  12.  What are some cheap packet screening tools?
  45.  
  46.  13.  What are some reasonable filtering rules for a Cisco?
  47.  
  48.  14. How do I make Web/http work with a firewall?
  49.  
  50.  15. How do I make DNS work with a firewall?
  51.  
  52.  16. How do I make FTP work through my firewall?
  53.  
  54.  17. How do I make Telnet work through my firewall?
  55.  
  56.  18. How do I make Finger and whois work through my firewall?
  57.  
  58.  19. How do I make gopher, archie, and other services work through my firewall?
  59.  
  60.  20. What are the issues about X-Window through a firewall?
  61.  
  62.  21. What is source routed traffic and why is it a threat?
  63.  
  64.  22. What are ICMP redirects and redirect bombs?
  65.  
  66.  23. What about denial of service?
  67.  
  68.  24. Glossary of firewall related terms
  69.  
  70.  25. Contributors
  71.  
  72. What is a network firewall?
  73.  
  74. A firewall is a system or group of systems that enforces an access control
  75. policy between two networks. The actual means by which this is accomplished
  76. varies widely, but in principle, the firewall can be thought of as a pair of
  77. mechanisms: one which exists to block traffic, and the other which exists to
  78. permit traffic. Some firewalls place a greater emphasis on blocking traffic,
  79. while others emphasize permitting traffic. Probably the most important thing to
  80. recognize about a firewall is that it implements an access control policy. If
  81. you don't have a good idea what kind of access you want to permit or deny, or
  82. you simply permit someone or some product to configure a firewall based on what
  83. they or it think it should do, then they are making policy for your
  84. organization as a whole.
  85.  
  86. Why would I want a firewall?
  87.  
  88. The Internet, like any other society, is plagued with the kind of jerks who
  89. enjoy the electronic equivalent of writing on other people's walls with
  90. spraypaint, tearing their mailboxes off, or just sitting in the street blowing
  91. their car horns. Some people try to get real work done over the Internet, and
  92. others have sensitive or proprietary data they must protect. Usually, a
  93. firewall's purpose is to keep the jerks out of your network while still letting
  94. you get your job done.
  95.  
  96. Many traditional-style corporations and data centers have computing security
  97. policies and practices that must be adhered to. In a case where a company's
  98. policies dictate how data must be protected, a firewall is very important,
  99. since it is the embodiment of the corporate policy. Frequently, the hardest
  100. part of hooking to the Internet, if you're a large company, is not justifying
  101. the expense or effort, but convincing management that it's safe to do so. A
  102. firewall provides not only real security - it often plays an important role as
  103. a security blanket for management.
  104.  
  105. Lastly, a firewall can act as your corporate "ambassador" to the Internet. Many
  106. corporations use their firewall systems as a place to store public information
  107. about corporate products and services, files to download, bug-fixes, and so
  108. forth. Several of these systems have become important parts of the Internet
  109. service structure (e.g.: UUnet.uu.net, whitehouse.gov, gatekeeper.dec.com) and
  110. have reflected well on their organizational sponsors.
  111.  
  112. What can a firewall protect against?
  113.  
  114. Some firewalls permit only Email traffic through them, thereby protecting the
  115. network against any attacks other than attacks against the Email service. Other
  116. firewalls provide less strict protections, and block services that are known to
  117. be problems.
  118.  
  119. Generally, firewalls are configured to protect against unauthenticated
  120. interactive logins from the "outside" world. This, more than anything, helps
  121. prevent vandals from logging into machines on your network. More elaborate
  122. firewalls block traffic from the outside to the inside, but permit users on the
  123. inside to communicate freely with the outside. The firewall can protect you
  124. against any type of network-borne attack if you unplug it.
  125.  
  126. Firewalls are also important since they can provide a single "choke point"
  127. where security and audit can be imposed. Unlike in a situation where a computer
  128. system is being attacked by someone dialing in with a modem, the firewall can
  129. act as an effective "phone tap" and tracing tool. Firewalls provide an
  130. important logging and auditing function; often they provide summaries to the
  131. administrator about what kinds and amount of traffic passed through it, how
  132. many attempts there were to break into it, etc.
  133.  
  134. What can't a firewall protect against?
  135.  
  136. Firewalls can't protect against attacks that don't go through the firewall.
  137. Many corporations that connect to the Internet are very concerned about
  138. proprietary data leaking out of the company through that route. Unfortunately
  139. for those concerned, a magnetic tape can just as effectively be used to export
  140. data. Many organizations that are terrified (at a management level) of Internet
  141. connections have no coherent policy about how dial-in access via modems should
  142. be protected. It's silly to build a 6-foot thick steel door when you live in a
  143. wooden house, but there are a lot of organizations out there buying expensive
  144. firewalls and neglecting the numerous other back-doors into their network. For
  145. a firewall to work, it must be a part of a consistent overall organizational
  146. security architecture. Firewall policies must be realistic, and reflect the
  147. level of security in the entire network. For example, a site with top secret or
  148. classified data doesn't need a firewall at all: they shouldn't be hooking up to
  149. the internet in the first place, or the systems with the really secret data
  150. should be isolated from the rest of the corporate network.
  151.  
  152. Another thing a firewall can't really protect you against is traitors or idiots
  153. inside your network. While an industrial spy might export information through
  154. your firewall, he's just as likely to export it through a telephone, FAX
  155. machine, or floppy disk. Floppy disks are a far more likely means for
  156. information to leak from your organization than a firewall! Firewalls also
  157. cannot protect you against stupidity. Users who reveal sensitive information
  158. over the telephone are good targets for social engineering; an attacker may be
  159. able to break into your network by completely bypassing your firewall, if he
  160. can find a "helpful" employee inside who can be fooled into giving access to a
  161. modem pool.
  162.  
  163. What about virusses?
  164.  
  165. Firewalls can't protect very well against things like viruses. There are too
  166. many ways of encoding binary files for transfer over networks, and too many
  167. different architectures and viruses to try to search for them all. In other
  168. words, a firewall cannot replace security- consciousness on the part of your
  169. users. In general, a firewall cannot protect against a data-driven attack --
  170. attacks in which something is mailed or copied to an internal host where it is
  171. then executed. This form of attack has occurred in the past against various
  172. versions of Sendmail and GhostScript, a freely-available PostScript viewer.
  173.  
  174. Organizations that are deeply concerned about virusses should implement
  175. organization-wide virus control measures. Rather than trying to screen virusses
  176. out at the firewall, make sure that every vulnerable desktop has virus scanning
  177. software that is run when the machine is rebooted. Blanketting your network
  178. with virus scanning software will protect against virusses that come in via
  179. floppy disks, modems, and Internet. Trying to block virusses at the firewall
  180. will only protect against virusses from the Internet - and the vast majority of
  181. virusses are caught via floppy disks.
  182.  
  183. What are good sources of print information on firewalls?
  184.  
  185. There are several books that touch on firewalls. The best known are:
  186.  
  187.    * Title: Firewalls and Internet Security: Repelling the Wily Hacker Authors:
  188.      Bill Cheswick and Steve Bellovin Publisher: Addison Wesley Edition: 1994
  189.      ISBN: 0-201-63357-4
  190.    * Title: Building Internet Firewalls Authors: D. Brent Chapman and Elizabeth
  191.      Zwicky Publisher: O'Reilly Edition: 1995 ISBN: 1-56592-124-0
  192.    * Title: Practical Unix Security Authors: Simson Garfinkel and Gene Spafford
  193.      Publisher: O'Reilly Edition: 1991 ISBN: 0-937175-72-2 (discusses primarily
  194.      host security)
  195.  
  196. Related references are:
  197.  
  198.    * Titles: Internetworking with TCP/IP Vols I, II and III Authors: Douglas
  199.      Comer and David Stevens Publisher: Prentice-Hall Edition: 1991 ISBN:
  200.      0-13-468505-9 (I), 0-13-472242-6 (II), 0-13-474222-2 (III) Comment: A
  201.      detailed discussion on the architecture and implementation of the Internet
  202.      and its protocols. Vol I (on principles, protocols and architecture) is
  203.      readable by everyone, Vol 2 (on design, implementation and internals) is
  204.      more technical, and Vol 3 (on client-server computing) is recently out.
  205.    * Title: Unix System Security - A Guide for Users and System Administrators
  206.      Author: David Curry Publisher: Addision Wesley Edition: 1992 ISBN:
  207.      0-201-56327-4
  208.  
  209. Where can I get more information on firewalls on the network?
  210.  
  211.    * Ftp.greatcircle.com - Firewalls mailing list archives. Directory:
  212.      pub/firewalls
  213.    * Firewall Howto - A how-to-build firewalls document.
  214.    * Ftp.tis.com - Internet firewall toolkit and papers. Directory:
  215.      pub/firewalls
  216.    * Research.att.com - Papers on firewalls and breakins. Directory:
  217.      dist/internet_security
  218.    * Net.Tamu.edu - Texas AMU security tools. Directory: pub/security/TAMU
  219.    * v-one.com - Internet attacks presentation, firewall standards
  220.  
  221. The internet firewalls mailing list is a forum for firewall administrators and
  222. implementors. To subscribe to Firewalls, send "subscribe firewalls" in the body
  223. of a message (not on the "Subject:" line) to "Majordomo@GreatCircle.COM".
  224. Archives of past Firewalls postings are available for anonymous FTP from
  225. ftp.greatcircle.com in pub/firewalls/archive
  226.  
  227. What are some commercial products or consultants who sell/service firewalls?
  228.  
  229. We feel this topic is too sensitive to address in a FAQ, however, an
  230. independantly maintained list (no warrantee or recommendations are implied) can
  231. be found at URL: http://www.access.digex.net/~bdboyle/firewall.vendor.html
  232.  
  233. What are some of the basic design decisions in a firewall?
  234.  
  235. There are a number of basic design issues that should be addressed by the lucky
  236. person who has been tasked with the responsibility of designing, specifying,
  237. and implementing or overseeing the installation of a firewall.
  238.  
  239. The first and most important is reflects the policy of how your company or
  240. organization wants to operate the system: is the firewall in place to
  241. explicitly deny all services except those critical to the mission of connecting
  242. to the net, or is the firewall in place to provide a metered and audited method
  243. of "queuing" access in a non-threatening manner. There are degrees of paranoia
  244. between these positions; the final stance of your firewall may be more the
  245. result of a political than an engineering decision.
  246.  
  247. The second is: what level of monitoring, redundancy, and control do you want?
  248. Having established the acceptable risk level (e.g.: how paranoid you are) by
  249. resolving the first issue, you can form a checklist of what should be
  250. monitored, permitted, and denied. In other words, you start by figuring out
  251. your overall objectives, and then combine a needs analysis with a risk
  252. assessment, and sort the almost always conflicting requirements out into a
  253. laundry list that specifies what you plan to implement.
  254.  
  255. The third issue is financial. We can't address this one here in anything but
  256. vague terms, but it's important to try to quantify any proposed solutions in
  257. terms of how much it will cost either to buy or to implement. For example, a
  258. complete firewall product may cost between $100,000 at the high end, and free
  259. at the low end. The free option, of doing some fancy configuring on a Cisco or
  260. similar router will cost nothing but staff time and cups of coffee.
  261. Implementing a high end firewall from scratch might cost several man- months,
  262. which may equate to $30,000 worth of staff salary and benefits. The systems
  263. management overhead is also a consideration. Building a home-brew is fine, but
  264. it's important to build it so that it doesn't require constant and expensive
  265. fiddling-with. It's important, in other words, to evaluate firewalls not only
  266. in terms of what they cost now, but continuing costs such as support.
  267.  
  268. On the technical side, there are a couple of decisions to make, based on the
  269. fact that for all practical purposes what we are talking about is a static
  270. traffic routing service placed between the network service provider's router
  271. and your internal network. The traffic routing service may be implemented at an
  272. IP level via something like screening rules in a router, or at an application
  273. level via proxy gateways and services.
  274.  
  275. The decision to make is whether to place an exposed stripped-down machine on
  276. the outside network to run proxy services for telnet, ftp, news, etc., or
  277. whether to set up a screening router as a filter, permitting communication with
  278. one or more internal machines. There are plusses and minuses to both
  279. approaches, with the proxy machine providing a greater level of audit and
  280. potentially security in return for increased cost in configuration and a
  281. decrease in the level of service that may be provided (since a proxy needs to
  282. be developed for each desired service). The old trade-off between ease-of-use
  283. and security comes back to haunt us with a vengeance.
  284.  
  285. What are the basic types of firewalls?
  286.  
  287. Conceptually, there are two types of firewalls:
  288.  
  289.    * Network Level
  290.    * Application Level
  291.  
  292. They are not as different as you might think, and latest technologies are
  293. blurring the distinction to the point where it's no longer clear if either one
  294. is "better" or "worse." As always, you need to be careful to pick the type that
  295. meets your needs.
  296.  
  297. Network level firewalls generally make their decisions based on the source,
  298. destination addresses and ports in individual IP packets. A simple router is
  299. the "traditional" network level firewall, since it is not able to make
  300. particularly sophisticated decisions about what a packet is actually talking to
  301. or where it actually came from. Modern network level firewalls have become
  302. increasingly sophisticated, and now maintain internal information about the
  303. state of connections passing through them, the contents of some of the data
  304. streams, and so on. One thing that's an important distinction about many
  305. network level firewalls is that they route traffic directly though them, so to
  306. use one you usually need to have a validly assigned IP address block. Network
  307. level firewalls tend to be very fast and tend to be very transparent to users.
  308.  
  309. [Image]
  310.  
  311. Example Network level firewall: In this example, a network level firewall
  312. called a "screened host firewall" is represented. In a screened host firewall,
  313. access to and from a single host is controlled by means of a router operating
  314. at a network level. The single host is a bastion host; a highly-defended and
  315. secured strong-point that (hopefully) can resist attack.
  316.  
  317. [Image]
  318.  
  319. Example Network level firewall: In this example, a network level firewall
  320. called a "screened subnet firewall" is represented. In a screened subnet
  321. firewall, access to and from a whole network is controlled by means of a router
  322. operating at a network level. It is similar to a screened host, except that it
  323. is, effectively, a network of screened hosts.
  324.  
  325. Application level firewalls generally are hosts running proxy servers, which
  326. permit no traffic directly between networks, and which perform elaborate
  327. logging and auditing of traffic passing through them. Since the proxy
  328. applications are sopftware components running on the firewall, it is a good
  329. place to do lots of logging and access control. Application level firewalls can
  330. be used as network address translators, since traffic goes in one "side" and
  331. out the other, after having passed through an application that effectively
  332. masks the origin of the initiating connection. Having an application in the way
  333. in some cases may impact performance and may make the firewall less
  334. transparent. Early application level firewalls such as those built using the
  335. TIS firewall toolkit, are not particularly transparent to end users and may
  336. require some training. Modern application level firewalls are often fully
  337. transparent. Application level firewalls tend to provide more detailed audit
  338. reports and tend to enforce more conservative security models than network
  339. level firewalls.
  340.  
  341. [Image]
  342.  
  343. Example Application level firewall: In this example, an application level
  344. firewall called a "dual homed gateway" is represented. A dual homed gateway is
  345. a highly secured host that runs proxy software. It has two network interfaces,
  346. one on each network, and blocks all traffic passing through it.
  347.  
  348. The Future of firewalls lies someplace between network level firewalls and
  349. application level firewalls. It is likely that network level firewalls will
  350. become increasingly "aware" of the information going through them, and
  351. application level firewalls will become increasingly "low level" and
  352. transparent. The end result will be a fast packet-screening system that logs
  353. and audits data as it passes through. Increasingly, firewalls (network and
  354. application layer) incorporate encryption so that they may protect traffic
  355. passing between them over the Internet. Firewalls with end-to-end encryption
  356. can be used by organizations with multiple points of Internet connectivity to
  357. use the Internet as a "private backbone" without worrying about their data or
  358. passwords being sniffed.
  359.  
  360. What are proxy servers and how do they work?
  361.  
  362. A proxy server (sometimes referred to as an application gateway or forwarder)
  363. is an application that mediates traffic between a protected network and the
  364. Internet. Proxies are often used instead of router-based traffic controls, to
  365. prevent traffic from passing directly between networks. Many proxies contain
  366. extra logging or support for user authentication. Since proxies must
  367. "understand" the application protocol being used, they can also implement
  368. protocol specific security (e.g., an FTP proxy might be configurable to permit
  369. incoming FTP and block outgoing FTP).
  370.  
  371. Proxy servers are application specific. In order to support a new protocol via
  372. a proxy, a proxy must be developed for it. One popular set of proxy servers is
  373. the TIS Internet Firewall Toolkit ("FWTK") which includes proxies for Telnet,
  374. rlogin, FTP, X-Window, http/Web, and NNTP/Usenet news. SOCKS is a generic proxy
  375. system that can be compiled into a client-side application to make it work
  376. through a firewall. Its advantage is that it's easy to use, but it doesn't
  377. support the addition of authentication hooks or protocol specific logging. For
  378. more information on SOCKS, see ftp.nec.com: /pub/security/socks.cstc Users are
  379. encouraged to check the file "FILES" for a description of the directory's
  380. contents.
  381.  
  382. What are some cheap packet screening tools?
  383.  
  384. The Texas AMU security tools include software for implementing screening
  385. routers (FTP net.tamu.edu, pub/security/TAMU). Karlbridge is a PC-based
  386. screening router kit ftp://ftp.net.ohio-state.edu/pub/kbridge. A version of the
  387. Digital Equipment Corporation "screend" kernel screening software is available
  388. for BSD/386, NetBSD, and BSDI. There is a kernel-level packet screen called
  389. ipfilter available for free, for BSD-based systems. Many commercial routers
  390. support screening of various forms.
  391.  
  392. What are some reasonable filtering rules for a Cisco?
  393.  
  394. The following example shows one possible configuration for using the Cisco as
  395. filtering router. It is a sample that shows the implementation of as specific
  396. policy. Your policy will undoubtedly vary.
  397.  
  398. [Image]
  399.  
  400. In this example, a company has Class C network address 195.55.55.0. Company
  401. network is connected to Internet via IP Service Provider. Company policy is to
  402. allow everybody access to Internet services, so all outgoing connections are
  403. accepted. All incoming connections go through "mailhost". Mail and DNS are only
  404. incoming services.
  405.  
  406. Implementation
  407.  
  408.    * Allow all outgoing TCP-connections
  409.    * Allow incoming SMTP and DNS to mailhost
  410.    * Allow incoming FTP data connections to high TCP port (>1024)
  411.    * Try to protect services that live on high port numbers
  412.  
  413. Only incoming packets from Internet are checked in this configuration. Rules
  414. are tested in order and stop when the first match is found. There is an
  415. implicit deny rule at the end of an access list that denies everything. This IP
  416. access lists assumes that you are running Cisco IOS v. 10.3 or later.
  417.  
  418.   1. no ip source-route
  419.   2. !
  420.   3. interface ethernet 0
  421.   4. ip address 195.55.55.1
  422.   5. !
  423.   6. interface serial 0
  424.   7. ip access-group 101 in
  425.   8. !
  426.   9. access-list 101 deny ip 195.55.55.0 0.0.0.255
  427.  10. access-list 101 permit tcp any any established
  428.  11. !
  429.  12. access-list 101 permit tcp any host 195.55.55.10 eq smtp
  430.  13. access-list 101 permit tcp any host 195.55.55.10 eq dns
  431.  14. access-list 101 permit udp any host 192.55.55.10 eq dns
  432.  15. !
  433.  16. access-list 101 deny tcp any any range 6000 6003
  434.  17. access-list 101 deny tcp any any range 2000 2003
  435.  18. access-list 101 deny tcp any any eq 2049
  436.  19. access-list 101 deny udp any any eq 204
  437.  20. !
  438.  21. access-list 101 permit tcp any 20 any gt 1024
  439.  22. !
  440.  23. access-list 101 permit icmp any any
  441.  24. !
  442.  25. snmp-server community FOOBAR RO 2
  443.  26. line vty 0 4
  444.  27. access-class 2 in
  445.  28. access-list 2 permit 195.55.55.0 255.255.255.0
  446.  
  447. Explanations
  448.  
  449.    * Drop all source-routed packets. Source routing can be used for address
  450.      spoofing.
  451.    * If incoming packet claims to be from local net, drop it.
  452.    * All packets which are part of already established TCP-connections can pass
  453.      through without further checking.
  454.    * All connections to low port numbers are blocked except SMTP and DNS.
  455.    * Block all services that listen TCP connections in high port numbers.
  456.      X-windows (port 6000+), OpenWindows (port 2000+) are few candidates. NFS
  457.      (port 2049) runs usually over UDP, but it can be run over NFS, so you have
  458.      better block it.
  459.    * Incoming connections from port 20 into high port numbers are supposed to
  460.      be FTP data connections.
  461.    * Access-list 2 limits access to router itself (telnet & SNMP)
  462.    * All UDP traffic is blocked to protect RPC services
  463.  
  464. Shortcomings
  465.  
  466.    * You cannot enforce strong access policies with router access lists. Users
  467.      can easily install backdoors to their systems to get over "no incoming
  468.      telnet" or "no X" rules. Also crackes install telnet backdoors on systems
  469.      where they break in.
  470.    * You can never be sure what services you have listening connections on high
  471.      port numbers.
  472.    * Checking source port on incoming FTP data connections is a weak security
  473.      method. It also breaks access to some FTP sites. It makes users more
  474.      difficult to use their backdoors, but doesn't prevent hackers to scan your
  475.      systems.
  476.  
  477. Use at least Cisco version 9.21 so you can filter incoming packets and check
  478. for address spoofing. It's still better to use 10.3, where you get some extra
  479. features (like filtering on source port) and some improvements on filter
  480. syntax.
  481.  
  482. You have still a few ways to make your setup stronger. Block all incoming
  483. TCP-connections and tell users to use passive-FTP clients. You can also block
  484. outgoing icmp echo-reply and destination-unreachable messages to hide your
  485. network and to prevent use of network scanners.
  486.  
  487. Cisco.com has an archive of examples for building firewalls using Cisco routers
  488. (ftp://ftp.cisco.com/pub/acl-examples.tar.Z) Those examples are a bit
  489. out-of-date, but there are some perl scripts which are pretty useful, once
  490. adjusted for your network.
  491.  
  492. How do I make Web/HTTP work through my firewall?
  493.  
  494. There are 3 ways to do it - Pick one:
  495.  
  496.    * Allow "established" connections out via a router, if you are using
  497.      screening routers.
  498.    * Use a Web client that supports SOCKS, and run SOCKS on your firewall.
  499.    * Run some kind of proxy-capable Web server on the firewall. The TIS
  500.      firewall toolkit includes a proxy called http-gw, which proxies Web,
  501.      gopher/gopher+ and FTP. CERN httpd also has a proxy capability, which many
  502.      sites use in combination with the server's ability to cache frequently
  503.      accessed pages. Many Web clients have proxy server support (Netscape,
  504.      Mosaic, Spry, Chameleon, etc) built directly into them.
  505.  
  506. How do I make DNS work with a firewall?
  507.  
  508. Some organizations want to hide DNS names from the outside. Many experts don't
  509. think hiding DNS names is worthwhile, but if site/corporate policy mandates
  510. hiding domain names, this is one approach that is known to work. Another reason
  511. you may have to hide domain names is if you have a non-standard addressing
  512. scheme on your internal network. In that case, you have no choice but to hide
  513. those addresses. Don't fool yourself into thinking that if your DNS names are
  514. hidden that it will slow an attacker down much if they break into your
  515. firewall. Information about what is on your network is too easily gleaned from
  516. the networking layer itself. If you want an interesting demonstration of this,
  517. ping the subnet broadcast address on your LAN and then do an "arp -a." Note
  518. also that hiding names in the DNS doesn't address the problem of host names
  519. "leaking" out in mail headers, news articles, etc.
  520.  
  521. This approach is one of many, and is useful for organizations that wish to hide
  522. their host names from the Internet. The success of this approach lies on the
  523. fact that DNS clients on a machine don't have to talk to a DNS server on that
  524. same machine. In other words, just because there's a DNS server on a machine,
  525. there's nothing wrong with (and there are often advantages to) redirecting that
  526. machine's DNS client activity to a DNS server on another machine.
  527.  
  528. First, you set up a DNS server on the bastion host that the outside world can
  529. talk to. You set this server up so that it claims to be authoritative for your
  530. domains. In fact, all this server knows is what you want the outside world to
  531. know; the names and addresses of your gateways, your wildcard MX records, and
  532. so forth. This is the "public" server.
  533.  
  534. Then, you set up a DNS server on an internal machine. This server also claims
  535. to be authoritiative for your domains; unlike the public server, this one is
  536. telling the truth. This is your "normal" nameserver, into which you put all
  537. your "normal" DNS stuff. You also set this server up to forward queries that it
  538. can't resolve to the public server (using a "forwarders" line in
  539. /etc/named.boot on a UNIX machine, for example).
  540.  
  541. Finally, you set up all your DNS clients (the /etc/resolv.conf file on a UNIX
  542. box, for instance), including the ones on the machine with the public server,
  543. to use the internal server. This is the key.
  544.  
  545. An internal client asking about an internal host asks the internal server, and
  546. gets an answer; an internal client asking about an external host asks the
  547. internal server, which asks the public server, which asks the Internet, and the
  548. answer is relayed back. A client on the public server works just the same way.
  549. An external client, however, asking about an internal host gets back the
  550. "restricted" answer from the public server.
  551.  
  552. This approach assumes that there's a packet filtering firewall between these
  553. two servers that will allow them to talk DNS to each other, but otherwise
  554. restricts DNS between other hosts.
  555.  
  556. Another trick that's useful in this scheme is to employ wildcard PTR records in
  557. your IN-ADDR.ARPA domains. These cause an an address-to-name lookup for any of
  558. your non- public hosts to return something like "unknown.YOUR.DOMAIN" rather
  559. than an error. This satisfies anonymous FTP sites like ftp.uu.net that insist
  560. on having a name for the machines they talk to. This may fail when talking to
  561. sites that do a DNS cross-check in which the host name is matched against its
  562. address and vice versa.
  563.  
  564. How do I make FTP work through my firewall?
  565.  
  566. Generally, making FTP work through the firewall is done either using a proxy
  567. server such as the firewall toolkit's ftp-gw or by permitting incoming
  568. connections to the network at a restricted port range, and otherwise
  569. restricting incoming connections using something like "established" screening
  570. rules. The FTP client is then modified to bind the data port to a port within
  571. that range. This entails being able to modify the FTP client application on
  572. internal hosts.
  573.  
  574. In some cases, if FTP downloads are all you wish to support, you might want to
  575. consider declaring FTP a "dead protocol" and letting you users download files
  576. via the Web instead. The user interface certainly is nicer, and it gets around
  577. the ugly callback port problem. If you choose the FTP-via-Web approach, your
  578. users will be unable to FTP files out, which, depending on what you are trying
  579. to accomplish, may be a problem.
  580.  
  581. A different approach is to use the FTP "PASV" option to indicate that the
  582. remote FTP server should permit the client to initiate connections. The PASV
  583. approach assumes that the FTP server on the remote system supports that
  584. operation. (See RFC1579 for more information)
  585.  
  586. Other sites prefer to build client versions of the FTP program that are linked
  587. against a SOCKS library.
  588.  
  589. How do I make Telnet work through my firewall?
  590.  
  591. Telnet is generally supported either by using an application proxy such as the
  592. firewall toolkit's tn-gw, or by simply configuring a router to permit outgoing
  593. connections using something like the "established" screening rules. Application
  594. proxies could be in the form of a standalone proxy running on the bastion host,
  595. or in the form of a SOCKS server and a modified client.
  596.  
  597. How do I make Finger and whois work through my firewall?
  598.  
  599. Many firewall admings permit connections to the finger port from only trusted
  600. machines, which can issue finger requests in the form of: finger
  601. user@host.domain@firewall. This approach only works with the standard UNIX
  602. version of finger. Controlling access to services and restricting them to
  603. specific machines is managed using either tcp_wrappers or netacl from the
  604. firewall toolkit. This approach will not work on all systems, since some finger
  605. servers do not permit user@host@host fingering.
  606.  
  607. Many sites block inbound finger requests for a variety of reasons, foremost
  608. being past security bugs in the finger server (the Morris internet worm made
  609. these bugs famous) and the risk of proprietary or sensitive information being
  610. revealed in user's finger information. In general, however, if your users are
  611. accostomed to putting proprietary or sensitive information in their.plan files,
  612. you have a more serious security problem than just a firewall can solve.
  613.  
  614. How do I make gopher, archie, and other services work through my firewall?
  615.  
  616. The majority of firewall administrators choose to support gopher and archie
  617. through Web proxies, instead of directly. Proxies such as the firewall
  618. toolkit's http-gw convert gopher/gopher+ queries into HTML and vice versa. For
  619. supporting archie and other queries, many sites rely on Internet-based
  620. Web-to-archie servers, such as ArchiePlex. The Web's tendency to make
  621. everything on the Internet look like a Web service is both a blessing and a
  622. curse.
  623.  
  624. There are many new services constantly cropping up. Often they are misdesigned
  625. or are not designed with security in mind, and their designers will cheerfully
  626. tell you if you want to use them you need to let port xxx through your router.
  627. Unfortunately, not everyone can do that, and so a number of interesting new
  628. toys are difficult to use for people behind firewalls. Things like RealAudio,
  629. which require direct UDP access, are particularly egregious examples. The thing
  630. to bear in mind if you find yourself faced with one of these problems is to
  631. find out as much as you can about the security risks that the service may
  632. present, before you just allow it through. It's quite possible the service has
  633. no security implications. It's equally possible that it has undiscovered holes
  634. you could drive a truck through.
  635.  
  636. What are the issues about X-Window through a firewall?
  637.  
  638. X Windows is a very useful system, but unfortunately has some major security
  639. flaws. Remote systems that can gain or spoof access to a workstation's X
  640. display can monitor keystrokes that a user enters, download copies of the
  641. contents of their windows, etc.
  642.  
  643. While attempts have been made to overcome them (E.g., MIT "Magic Cookie") it is
  644. still entirely too easy for an attacker to interfere with a user's X display.
  645. Most firewalls block all X traffic. Some permit X traffic through application
  646. proxies such as the DEC CRL X proxy (FTP crl.dec.com). The firewall toolkit
  647. includes a proxy for X, called x-gw, which a user can invoke via the Telnet
  648. proxy, to create a virtual X server on the firewall. When requests are made for
  649. an X connection on the virtual X server, the user is presented with a pop-up
  650. asking them if it is OK to allow the connection. While this is a little
  651. unaesthetic, it's entirely in keeping with the rest of X.
  652.  
  653. What is source routed traffic and why is it a threat?
  654.  
  655. Normally, the route a packet takes from its source to its destination is
  656. determined by the routers between the source and destination. The packet itself
  657. only says where it wants to go (the destination address), and nothing about how
  658. it expects to get there.
  659.  
  660. There is an optional way for the sender of a packet (the source) to include
  661. information in the packet that tells the route the packet should get to its
  662. destination; thus the name "source routing". For a firewall, source routing is
  663. noteworthy, since an attacker can generate traffic claiming to be from a system
  664. "inside" the firewall. In general, such traffic wouldn't route to the firewall
  665. properly, but with the source routing option, all the routers between the
  666. attacker's machine and the target will return traffic along the reverse path of
  667. the source route. Implementing such an attack is quite easy; so firewall
  668. builders should not discount it as unlikely to happen.
  669.  
  670. In practice, source routing is very little used. In fact, generally the main
  671. legitimate use is in debugging network problems or routing traffic over
  672. specific links for congestion control for specialized situations. When building
  673. a firewall, source routing should be blocked at some point. Most commercial
  674. routers incorporate the ability to block source routing specifically, and many
  675. versions of UNIX that might be used to build firewall bastion hosts have the
  676. ability to disable or ignore source routed traffic.
  677.  
  678. What are ICMP redirects and redirect bombs?
  679.  
  680. An ICMP Redirect tells the recipient system to over-ride something in its
  681. routing table. It is legitimately used by routers to tell hosts that the host
  682. is using a non-optimal or defunct route to a particular destination, i.e. the
  683. host is sending it to the wrong router. The wrong router sends the host back an
  684. ICMP Redirect packet that tells the host what the correct route should be. If
  685. you can forge ICMP Redirect packets, and if your target host pays attention to
  686. them, you can alter the routing tables on the host and possibly subvert the
  687. security of the host by causing traffic to flow via a path the network manager
  688. didn't intend. ICMP Redirects also may be employed for denial of service
  689. attacks, where a host is sent a route that loses it connectivity, or is sent an
  690. ICMP Network Unreachable packet telling it that it can no longer access a
  691. particular network.
  692.  
  693. Many firewall builders screen ICMP traffic from their network, since it limits
  694. the ability of outsiders to ping hosts, or modify their routing tables.
  695.  
  696. What about denial of service?
  697.  
  698. Denial of service is when someone decides to make your network or firewall
  699. useless by disrupting it, crashing it, jamming it, or flooding it. The problem
  700. with denial of service on the Internet is that it is impossible to prevent. The
  701. reason has to do with the distributed nature of the network: every network node
  702. is connected via other networks which in turn connect to other networks, etc. A
  703. firewall administrator or ISP only has control of a few of the local elements
  704. within reach. An attacker can always disrupt a connection "upstream" from where
  705. the victim controls it. In other words, if someone wanted to take a network off
  706. the air, they could do it either by taking the network off the air, or by
  707. taking the networks it connects to off the air, ad infinitum. There are many,
  708. many, ways someone can deny service, ranging from the complex to the
  709. brute-force. If you are considering using Internet for a service which is
  710. absolutely time or mission critical, you should consider your fall-back
  711. position in the event that the network is down or damaged.
  712.  
  713. Glossary of firewall related terms
  714.  
  715. Abuse of Privilege:
  716.      When a user performs an action that they should not have, according to
  717.      organizational policy or law.
  718. Application-Level Firewall:
  719.      A firewall system in which service is provided by processes that maintain
  720.      complete TCP connection state and sequencing. Application level firewalls
  721.      often re-address traffic so that outgoing traffic appears to have
  722.      originated from the firewall, rather than the internal host.
  723. Authentication:
  724.      The process of determining the identity of a user that is attempting to
  725.      access a system.
  726. Authentication Token:
  727.      A portable device used for authenticating a user. Authentication tokens
  728.      operate by challenge/response, time-based code sequences, or other
  729.      techniques. This may include paper-based lists of one-time passwords.
  730. Authorization:
  731.      The process of determining what types of activities are permitted.
  732.      Usually, authorization is in the context of authentication: once you have
  733.      authenticated a user, they may be authorized different types of access or
  734.      activity.
  735. Bastion Host:
  736.      A system that has been hardened to resist attack, and which is installed
  737.      on a network in such a way that it is expected to potentially come under
  738.      attack. Bastion hosts are often components of firewalls, or may be
  739.      "outside" Web servers or public access systems. Generally, a bastion host
  740.      is running some form of general purpose operating system (e.g., UNIX, VMS,
  741.      WNT, etc.) rather than a ROM-based or firmware operating system.
  742. Challenge/Response:
  743.      An authentication technique whereby a server sends an unpredictable
  744.      challenge to the user, who computes a response using some form of
  745.      authentication token.
  746. Chroot:
  747.      A technique under UNIX whereby a process is permanently restricted to an
  748.      isolated subset of the filesystem.
  749. Cryptographic Checksum:
  750.      A one-way function applied to a file to produce a unique "fingerprint" of
  751.      the file for later reference. Checksum systems are a primary means of
  752.      detecting filesystem tampering on UNIX.
  753. Data Driven Attack:
  754.      A form of attack in which the attack is encoded in innocuous-seeming data
  755.      which is executed by a user or other software to implement an attack. In
  756.      the case of firewalls, a data driven attack is a concern since it may get
  757.      through the firewall in data form and launch an attack against a system
  758.      behind the firewall.
  759. Defense in Depth:
  760.      The security approach whereby each system on the network is secured to the
  761.      greatest possible degree. May be used in conjunction with firewalls.
  762. DNS spoofing:
  763.      Assuming the DNS name of another system by either corrupting the name
  764.      service cache of a victim system, or by compromising a domain name server
  765.      for a valid domain.
  766. Dual Homed Gateway:
  767.      A dual homed gateway is a system that has two or more network interfaces,
  768.      each of which is connected to a different network. In firewall
  769.      configurations, a dual homed gateway usually acts to block or filter some
  770.      or all of the traffic trying to pass between the networks.
  771. Encrypting Router:
  772.      see Tunneling Router and Virtual Network Perimeter.
  773. Firewall:
  774.      A system or combination of systems that enforces a boundary between two or
  775.      more networks.
  776. Host-based Security:
  777.      The technique of securing an individual system from attack. Host based
  778.      security is operating system and version dependent.
  779. Insider Attack:
  780.      An attack originating from inside a protected network.
  781. Intrusion Detection:
  782.      Detection of break-ins or break-in attempts either manually or via
  783.      software expert systems that operate on logs or other information
  784.      available on the network.
  785. IP Spoofing:
  786.      An attack whereby a system attempts to illicitly impersonate another
  787.      system by using its IP network address.
  788. IP Splicing / Hijacking:
  789.      An attack whereby an active, established, session is intercepted and
  790.      co-opted by the attacker. IP Splicing attacks may occur after an
  791.      authentication has been made, permitting the attacker to assume the role
  792.      of an already authorized user. Primary protections against IP Splicing
  793.      rely on encryption at the session or network layer.
  794. Least Privilege:
  795.      Designing operational aspects of a system to operate with a minimum amount
  796.      of system privilege. This reduces the authorization level at which various
  797.      actions are performed and decreases the chance that a process or user with
  798.      high privileges may be caused to perform unauthorized activity resulting
  799.      in a security breach.
  800. Logging:
  801.      The process of storing information about events that occurred on the
  802.      firewall or network.
  803. Log Retention:
  804.      How long audit logs are retained and maintained.
  805. Log Processing:
  806.      How audit logs are processed, searched for key events, or summarized.
  807. Network-Level Firewall:
  808.      A firewall in which traffic is examined at the network protocol packet
  809.      level.
  810. Perimeter-based Security:
  811.      The technique of securing a network by controlling access to all entry and
  812.      exit points of the network.
  813. Policy:
  814.      Organization-level rules governing acceptable use of computing resources,
  815.      security practices, and operational procedures.
  816. Proxy:
  817.      A software agent that acts on behalf of a user. Typical proxies accept a
  818.      connection from a user, make a decision as to whether or not the user or
  819.      client IP address is permitted to use the proxy, perhaps does additional
  820.      authentication, and then completes a connection on behalf of the user to a
  821.      remote destination.
  822. Screened Host:
  823.      A host on a network behind a screening router. The degree to which a
  824.      screened host may be accessed depends on the screening rules in the
  825.      router.
  826. Screened Subnet:
  827.      A subnet behind a screening router. The degree to which the subnet may be
  828.      accessed depends on the screening rules in the router.
  829. Screening Router:
  830.      A router configured to permit or deny traffic based on a set of permission
  831.      rules installed by the administrator.
  832. Session Stealing:
  833.      See IP Splicing.
  834. Trojan Horse:
  835.      A software entity that appears to do something normal but which, in fact,
  836.      contains a trapdoor or attack program.
  837. Tunneling Router:
  838.      A router or system capable of routing traffic by encrypting it and
  839.      encapsulating it for transmission across an untrusted network, for
  840.      eventual de-encapsulation and decryption.
  841. Social Engineering:
  842.      An attack based on deceiving users or administrators at the target site.
  843.      Social engineering attacks are typically carried out by telephoning users
  844.      or operators and pretending to be an authorized user, to attempt to gain
  845.      illicit access to systems.
  846. Virtual Network Perimeter:
  847.      A network that appears to be a single protected network behind firewalls,
  848.      which actually encompasses encrypted virtual links over untrusted
  849.      networks.
  850. Virus:
  851.      A self-replicating code segment. Viruses may or may not contain attack
  852.      programs or trapdoors.
  853.  
  854. Contributors:
  855.  
  856.    * Primary Author: mjr@v-one.com - Marcus Ranum, V-ONE Corporation
  857.  
  858.    * Cisco Config (V2.0): vjk@relevantum.fi - Keinanen Vesa
  859.  
  860.    * Cisco Config (V1.0): allen@msen.com - Allen Leibowitz
  861.  
  862.    * DNS Hints: brent@greatcircle.com - Brent Chapman, Great Circle Associates
  863.  
  864.    * Policy Brief: bdboyle@erenj.com - Brian Boyle, Exxon Research
  865.  
  866. -------------------------------------------------------------------------------
  867. Copyright(C) 1995 Marcus J. Ranum. All rights reserved. This document may be
  868. used, reprinted, and redistributed as is providing this copyright notice and
  869. all attributions remain intact.
  870.  
  871.