Transcription

1 Network Firewalls Computer security is a hard problem. Security on networked computers is much harder. Firewalls (barriers between two networks), when used properly, can provide a significant increase in computer security. Steven M. Bellovin and William R. Cheswick STEVEN M. BELLOVIN works at AT&T Bell Laboratones, where he does research in networks and securily WILLIAM R CHESWICK serves as an assirtantprogammer trainee and member of the technical staff at Bell Laboratories. Much of this article was taken?om Firewalls and Internet Security: Repelling the Wiky Hacker by William R. Cheswick and Steven M. Bellovin, Addison Wesley Publishing Company, ISBN , AT&T Bell Laboratories. omputer security is a hard problem. Security on networked computers is much harder. The administratorofasingle hostcan-withagreat deal of care and attention to details, luck in the choice of vendor software, and a careful and educated user community - probably do an adequate job of keeping the machine secure. But if the machine is connected to a network, the situation is much difficult. First, many more entry points to the host than a simple login prompt must be secured. The mailer, the networked file system, and the database servers are all potential sources of danger. Furthermore, the authentication used by some protocols may be inadequate. Nevertheless, they must be run, to provide adequate service to local users. Second, there are now many more points from which an attack can be launched. If a computer s users are confined to a single building, it is difflcult for an outsider to try to penetrate system security. A network-connected computer, on the other hand, can be reached from any point on the network - and the Internet reaches tens of millions of users in every part of the globe. Finally, networks expose computers to the problem of transitive trust. Your computersmay be secure, but you may have users who connect from other machines that are lesssecure. Thisconnection-even ifdulyauthorizedandimmune todirect attack-may nevertheless be the vehicle for a successful penetration ofyour machines, if the source of the connection has been compromised. The usual solution to all of these problems is afirewall: abanier thatrestrictsthe freeflowofdatabetween the inside and the outside. Used properly, a firewall can provide asignificantincreaseincomputersecurity. Stance Akey decisionwhen developing a security policy is the stanceofthe firewalldesign. Thestance is the attitude of the designers. It is determined by the cost of failure of the firewall and the designers estimate of that likelihood. It is also basedon the designers opinions of their own abilities. At one end of the scale is a philosophy that says, we ll run it unless you can show me that it s broken. People at the other end say, show me that it s both safe and necessary; otherwise, we won trun it. Thosewho arecompletelyoff the scale prefer to pull the plug on the network, rather than take any risks at all. Such a move is too extreme, but understandable. Why would a company risk losing its secrets for the benefits of network connection? We do not advocate disconnection for most sites. Our philosophy issimple: there areno absolutes. One cannot have complete safety; to pursue that chimera is to ignore the costs of the pursuit. Networks and internetworks have advantages; to disconnect from anetworkis to deny oneself those advantages. When all is said and done, disconnection may be the right choice, but it is a decision that can only be made by weighing the risks against the benefits. We advocate caution, not hysteria. For reasons that are spelled out below, we feel that firewalls are an important tool that can minimize the danger, while providingmost-butnot necessarily all-of the benefits of a network connection. However, a paranoid stance is necessary for many sites when setting up a firewall. Most computing professionals realize that most large software systems are buggy. If the system is security-sensitive - that is, if it provides any sort of network service at all - one runs the risk that the bugs will manifest themselves as security holes. The most practical solution is to run as few programs as possible, and to make sure that these are as small and simple as possible. A firewall can do this. It is not constrained to offer generalcomputing services to ageneral user population. It need not run networked file systems, distributedusernamedatabases,etc. The very act of eliminating such programs automatically makes a firewall more secure than the average host. We also feel that any program, no matter how innocuous it seems, can harbor security holes. (Who would have guessed that on some machines, integer divide exceptions couldlead to system penetrations?) We thus have a firm belief that everything is guilty until proven innocent. Consequently, we configure our firewalls to reject everything, unlesswe have explicitly made the choice - and accepted the risk - to permit it. Taking the opposite tack, of blocking only known offenders, strikes us as extremely dangerous. 50 IEEE Communications Magazine September 1994

2 Figure I. Schematic of a firewall. Furthermore, whether or not a security policy is formally spelled out, one always exists. If nothing else is said or implemented, the default policy is anything goes. Needless tosay, thisstance i5 rarely acceptable in a security-conscious environment. If one does not make explicit decisions, one will have made the default decision to allow almost anything. Host Security To some people, the very notion of a firewall is anathema. In most situations, the network is not the resource at risk rather, the endpoints of the network are threatened. By analogy, con artists rarely steal phone service per se; instead, they use the phone system as a tool to reach their real victims. So it is, in a sense, with network security. Given that the target of the attackers is the hosts on the network, should they not be suitably configured and armored to resist attack? The answer is that they should be, but probablycannot. Such attempts areprobablyfutile. There will be bugs, either in the network programsor in the administration of the system. It is this way with computer security: the attacker only has to win once. It does not matter how thick are your walls, nor how loftyyourbattlements; ifan attacker findsone weakness - say, a postern gate, to extend our metaphor -your systemwill be penetrated. And if one machine falls. its neighbors are likely to follow. Types of Firewalls e define afirewall as acollectionofcomponents W placed between two networks that collectively have the following properties: All traffic from inside to outside, and viceversa, must pass through the firewall. Only authorized trafflc, as defined by the local security policy, will be allowed to pass. The firewall itself is immune to penetration. We should note that these are design goals; a failure in one aspect does not mean that the collection is not a firewall, simply that it is not a very good one. That firewalls are desirable follows directly from our earlier statements. Many hosts-and more likely, most hosts - cannot protect themselves against a determined attack. Firewalls have several distinct advantages. First, ofcourse, afirewall is likely to be more secure than an average host. The biggest single reason for that is simply that it is not a general-purpose machine. Thus, features that are of doubtful security but add greatly to user convenience - Network Information Service (NIS), rlcgin, etc. - are not necessary. For that matter, many features of unknown security can be omitted if they are irrelevant to the firewall s functionality. A second benefit comes from having professional administration of the firewall machines. We do not claim that firewall administrators are necessarily more competent than your average system administrator, but they may be more security conscious. However, they are almost certainly better than nonadministrators who must nevertheless tend to their own machines. This category would include physical scientists, professors, etc., who (rightly) prefer to worry about their own areas of responsibility. It may or may not be reasonable to demand more security consciousness from them; nevertheless, it is obviously not their top priority. Fewer normal users is a help as well. Poorly chosen passwords are a serious risk; if usersand their attendant passwords do not exist, this is not a problem. Similarly, one can make more or less arbitrary changes to various program interfaces if that would help security, without annoying a population accustomed toa differentway ofdoing things. One example would be the use of hand-held authenticators for logging in. Many people resent them, or they may be too expensive to be furnished to an entire organization; a gateway machine, however, should have a user community that is restricted enough so that these concerns are negligible. More subtly, gateway machines need not, and should not, be trusted by any other machines. Thus, even if the gateway machine has been compromised, no others will fall automatically. On the other hand, the gateway machinecan, if theuserwishes(and decides against using hand-held authenticators), trust other machines, thereby eliminating the need for most passwordson the few accounts it should have. Again, something that is not there cannot be compromised. Gateway machines have other, nonsecurity advantages as well. They are a central point for mail and madministration, for example. Only one machine need be monitored for delayed mail, proper header syntax, return-address rewriting (i.e., to f irstname. dminformat), etc. Outsiders have a single point of contact for mail problems and a single location to search for files being exported. Our main focus, though, is security. And for all that we have stated about the benefits of a firewall, it should be stressed that we neither advocate nor condone sloppy attitudes toward host security. Even if a firewall were impermeable, and even if the administrators and operators never made any mistakes, the Internet isnot theonlysource ofdanger. Apart from the risk of insider attacks and in some environments, that is a serious risk - an outsider can gain access by other means. In at least one case, a hacker came in through a modem pool, and attacked the firewall from the inside [7]. Strong host securitypolicies are a necessity, not a luxury. For that matter, internal firewallsare agood idea, toprotectverysensitive portions of organizational networks. Afirewall, ingeneral, consistsofseveral different components (Fig. 1). The filters (sometimes called screens ) block transmission of certain classes of traffic. A gateway is a machine or a set of machines that provides relay services to compensate for the effects of the filter. The network inhabited by the gateway isoftencalled the demilitarizedzone (DMZ). Agateway in the DMZ is sometimes assisted by an internal gateway. Typically, the two gateways will have more open communication through the inside filter than the outside gateway has to other internal hosts. Either filter,orforthatmatterthegatewayitself,maybeomitted; the details will vary from firewall to firewall. In general, the outside filter can be used to protect the gateway from attack, while the inside filter is used - Everything is guilty until proven innocent. Thus, we configure our firewalls to reject everything, unless we have explicitly made the choice - and accepted the risk - to permit it. IEEE Communications Magazine September

3 - Even authorized users should pass through a security gateway when crossing the firewall; otherwise, if their home machines are compromised, the equipment on the inside could be next. to guard against theconsequencesof acompromised gateway. Either or both filters can protect the internal network from assaults. An exposed gateway machine is often called a bastion host. We classify firewalls into three main categories: packet filtering, circuit gateways, and applicationgateways.commonly,more thanoneoftheseisusedatthe same time. Asnotedearlier,mailisoftenrouted through a gateway even when no security firewall is used. Our examples and discussion unabashedlyrelate to UNIX systems and programs. The majority of multiuser machines on the Internet run some version of the UNIX operating system. Most application-level gateways are implemented in UNIX. This is not to say that other operating systems are more secure; however, there are fewer of them on the Internet, and they are less popular as targets for that reason. But the principles and philosophy apply to network gateways built on other operating systems as well. Our focus is on the TCP/IP protocol suite, especiallyasusedon the Internet.Again, thisisnot because TCP/IP has more security problems than other protocol stacks (we doubt that very much), rather, it is a commentary on the success of TCPIIP. By far, it is the heterogeneous networking protocol of choice- not onlyonworkstations,forwhich it is thenative tongue -but on virtually all machines, ranging from desktop personal computers to the largest supercomputers. Many intemdcorporate networks are based ontcp/ip some - but not all -of these are connected to the Internet. And the Internet links most major universitiesin theunited States (andmanyothersaround the world),research labs, many government agencies, and even a fair number of businesses. We believe, though, that our advice is applicable to any network with similar characteristics. We have read of serious attacks on computers attached to public X.25 data networks. Firewalls are useful there, too, although naturally they would differ in detail. Traditionally, firewalls are placed between an organization and the outside world. But a large organization may need internal firewalls as well to isolate security domains (also known as administrative domains). A security domain is a set of machines under common administrative control, with a common security policy and security level. There are many good reasons to erect internal firewalls. In many largecompanies, most employees are not (or should not be) privy to all information. In othercompanies, thecash business(1ike thefactory,or a phone company s telephone switches) needs to be accessible to developers or support personnel, but not to the general corporate population. Even authorized users should pass through a security gateway when crossing the firewall; otherwise, if their home machines, which live outside of the firewall, are compromised, the sensitive equipment on the inside could be next. The firewall controls the access and the trust in a carefully predictable way. Packet-Filtering Gateways acket filters can provide a cheap and useful level P of gateway security. Used by themselves, they are cheap: the filtering abilities come with the router software. Since you probably need a router to connect to thelnternet inthe firstplace, there isnoextracharge. Even if the router belongs to your network service provider, you will probably find that they will install any filters you wish. Packet filterswork by dropping packets based on their source or destination addresses or service (i.e., port number). In general, no context is kept; decisions are made only from the contentsof the current packet. Depending on the type of router, filtering may be doneat inputtime,atoutputtime,orboth.theadministrator makes a list of the acceptable machines and services and a stoplist of unacceptable machines or services. It is easy to permit or deny access at the host or network level with a packet filter. For example, one can permit any IP access between host A and B, or deny any access to B from any machine but A. Most security policies require finer control than this; they need to define access to specific services for hosts that are otherwise untrusted. For example, one might want to allow any host to connect to machine A, but only to send or receive mail. Other services may or may not be permitted. Packet filteringallowssomecontrolatthislevel, but itisadangerous and error-prone process. To do it right, one needs intimate knowledge of TCP and UDP port utilization on a number of operating systems. This is one of the disadvantages of packet filters: if you get these tables wrong you may inadvertently let in the Bad Guys [SI. But even with a perfectly implemented filter, some compromises can be dangerous. We discuss these in a section to follow. Configuring a packet filter is a three-step process. First,ofwurse,onemust knowwhat shouldand should not be permitted. That is, one must have a security policy. Next, the allowable types of packets must be specified formally, in terms of logical expressions on packet fields. Finally - and this can be remarkablydifflcult-the expressionsmust be rewritten in whatever syntax your vendor supports. An example is helpful. Suppose that one part of your security policywas to allow inbound mail (SMTF, port 25), but only to your gateway machine. However, mail from some particular site SPIGOT is to be blocked, because of their penchant for trying to mail several gigabytes of data at a time. A filter that implemented such a ruleset might looklike ruleset A in the text box on the following page. The rules are applied in order from top to bottom. The * in a field matches anything. Packets not explicitly allowed by a filter rule are rejected, i.e., every ruleset is followed by an implicit rule reading like ruleset B in the textbox above. This fits with our general philosophy: all that is not expressly permitted is prohibited. Note carefully the distinction between ruleset A and ruleset C, which is intended to implement the po1icy any inside host can send mail to the outside. The call may come from any port on an inside machine, but will be directed to port 25 on the outside. This ruleset seems simple and obvious. It is also wrong. The problemis that therestriction we have defined is based solely on the outside host s port number. While port 25 is indeed the normal mail port, there is no way we can control that on a foreign host. An enemy can access any intemal machine and port byoriginating his call from port 25 on the outside machine. A better rule would be to permit outgoing calls to port 25, i.e., we want to permit our hosts to make calls to someone else s port 25, so that we know what sgoingon: mail delivery. An incoming call from port 25 implements some service of the caller s choosing. Fortunately, the distinction between incoming and outgoing calls can be made in a simple packet filter if we expand our notation a bit. 52 IEEE Communications Magazine September 1994

4 A TCP conversation consists of packets flowing in two directions [19]. Even if all of the data is flowing one way, acknowledgment packets and control packets must flow the other way. We can accomplish what we want by paying attention to the direction of the packet, and by looking at some of the control fields. In particular, an initial open request packet in TCP does not have the set in the header; all other TCP packets do. Thus, packets with ACK set are part of an ongoing conversation; packets without it represent connection establishment messages, which we will permit only from internal hosts. The idea is that an outsider cannot initiate a connection, but can continue one. One must believe that an inside kernel will reject a continuation packet for a TCP session that has not been initiated. To date, this is a fair assumption. Thus, we can write our ruleset as seen in ruleset D, keying our rules by the source and destination fields, rather than the more nebulous OURHOST and THEIRHOST : The notation {our hosts} describes a set of machines, anyone of which is eligible. In a real packet filter, youcouldeither list themachinesexplicitly, or you could specify a group of machines, probably by the network number portion of the IP address. Filtering FTP Sessions Some services are not handled well by packet filters. We use the File Transfer Protocol (FTF ) [20] as an example here; other problematic protocols include x11 and the Domain Name System (DNS) [12,16, For FIT, files are transferredviaasecondaryconnection. If the control channel to a server on THEIRHOST uses the connection (ourhost, ourport, theirhost, 21), file transfers will occur on (ourhost, ourport, theirhost, 20) by default. Furthermore, the server must initiate the file transfer call. We thus have the problem we saw earlier, but without the ability to screen based on the direction of the call. One idea is to use the range of ourport to make filtering decisions. Most servers, and hence most attack targets, live on low-numbered ports; most outgoing calls tend to use higher numbered ports, typically above Thus, a sample ruleset might be ruleset E in the text box, where packets are passed under one of three circumstances: They originated from one of our machines. They are reply packets to a connection initiated by one of our machines. They are destined for a high-numbered port on our machines. Actually, the last two rules apply to all packets, not just packets originating from outside. But any packets from the inside would be accepted by the first rule, and would not be examined by the later rules. Unfortunately, this ruleset does not accomplish what we really want, which is to block incoming calls to our servers. We said most servers live on low-numbered ports, not all. A number of tempting targets, especially ~11, inhabit highnumbered ports. Presumably, one could filter out known dangerous ports; unfortunately, new ones could be added without notice. Thus, a cautious stance dictates that this heuristic not be adopted. Under certain circumstances, a bypass is available if you have the source code to the FTP client programs. You can modify the programs to issue a PA= command to the server, directing it to do a passive open, and thus permitting an outgoing call through the firewall for the data channel. This variant is not without its problems. The data channel, though an outgoing call, is to a random port. Such calls are generally barred by sites that wish to restrict outbound data flow. You also have the obvious problem of distributing modified clients to all inside machines. Also, not all servers understand the PASV command, even though they should. The issues are discussed further in [3]. Protocols Without Fixed Addresses Some services are problematic for packet filters because they can involve random port numbers. On occasion the situation is evenworse: a number of services always use random port numbers, and rely on a separate server to supply the current contact information. Twoexamplesofthisare the tcpmuxprotocol[13] and the portmapper [26] used by SunOS for RPC - A TCP conversation consists of packets flowing in two directions. Even ifall the data is flowing one way, acknowledgment packets and control packets must flow the other way. IEEE Communications Magazine September

5 - Filtering TCP circuits is dificult. Filtering UDP pa ckets while still retaining desired functionality is all but impossible. [25]. In both cases, client programs contact the mapping program rather than the application.the portmapper also processes registration requests from applications, informing it of their currentport numbers. On the other hand, tcpmux will invoke the application directly, passing it the open connection. This difference gives rise to different filter-based protection mechanisms. With tcpmux, one can block access to either all such services, or none, simply by controlling access to the tcpmux port. With the portmapper, each service has its own port number. While one can deny easy access to them by filtering out portmapper requests, an intruder can bypass the portmapper and simply sweep the port number space looking for interesting applications. We have seen evidence of this happening. The only cure is to block access to all possible port numbers used by RPC-based servers - and there is no easy way to know what that range is. Packet Filters and UDP Filtering TCP circuits is difficult. Filtering UDP packets [18] while still retaining desired functionality isall but impossible. The reason liesin the essential difference between TCP and UDP: the former is avirtualcircuit protocol, and assuch hasretainedcontext; the latter is a datagram protocol, where each message is independent. As we saw earlier, filtering TCP requires reliance on the ACK bit, in order to distinguish between incoming calls and return packets from an outgoing call. But UDP has no such indicator: we are forced to rely on the source port number, which is subject to forgery. An example illustrates the problem. Suppose an internal host wishes to query the UDP echo server on some outside machine. The originating packet would carry the address where localport is in the high-numbered range. But the reply would be ( remotehost, 7, localhost, localport), and the firewall would have no idea that localport was really a safe destination. An incoming packet (remotehost, 7, localhost, 2049), is probably an attempt to subvert our NFS server; and, while we could list the known dangerous destinations, we do not know what new targets will be added next week by a system administrator in the remote corners of our network. Worse yet, the RPC-based services use dynamic port numbers, sometimes in the high-numbered range. As with TCP, indirectly named services are not amenable to protection by packet filters. A conservative stance therefore dictates that we ban virtually all outgoing UDP calls. It is not that the requests themselves are dangerous; rather, it is that we cannot trust the responses. The only exceptions are those protocols where there is apeer-to-peerrelationship. Agood example is the NetworkTime Protocol (NTP) [15]. Innormal operation, messages are both from and to port 123. It is thus easy to admit replies, because they are to a fixed port number, rather than to an anonymous high-numbered port. But one use of NTP - set- ting the clock when rebooting - will not work, because the client program will not use port 123. (Of course, a booting computer probably should not ask an outsider for the time.) Typical Configurations We cannot provide readerswith the exact packet filter for a particular site, because we do not know what itspolicies are. Butwecangivesomereasonable samples that may serve as a starting point. Universities tend to have an open policy about Internet connections. Still, they should block some common services, such as NFS and TFTP. There is no need to export these services to the world. Also, there might be a PClab in a dorm that has been the source of some trouble, so they do not allow that lab access the Internet. (The users have to go through one of the main systems that require an account, which gives some accountability.) Finally, there is to be no access to the administrative computers except for access to a transcript manager. That service should use strong authentication and encryption. On the other hand, a small company with an Internet connection might wish to shut out most incoming Internet access, while preserving most outgoing connectivity. A gateway machine receives incoming mail and provides name service for the company s machines. Only access to that machine, and to the necessary services, should be permitted. Application-Level Gateways n application-level gateway represents the oppo- A site extreme in firewall design. Rather than using a general-purpose mechanism to allow many different kinds of traffic to flow, special-purpose code can be used for each desired application. Although this seems wasteful, it is likely to be far more secure than any of the alternatives. One need not worry about interactions among different sets of filter rules, nor about holes in thousands of hosts offering nominally secure services to the outside. Only a chosen few programs need to be scrutinized. Application gateways have another advantage that in some environments is quite critical: it is easy to log and control all incoming and outgoing traffic. The SEAL package [21] from Digital Equipment Corporation takes advantage of this. Outbound FTP traffic is restricted to authorized individuals, and the effective bandwidth is limited. The intent is to prevent theft of valuable company programs and data. While of limited utility against insiders, who could easily dump the desired files to tapes or floppies, it is a powerful weapon against electronic intruders who lack physical access. Electronic mail is often passed through an application-level gateway, regardless of what technology is chosen for the rest of the firewall. Indeed, mail gateways are valuable for their other properties, even without a firewall. Userscan keep the same address, regardless of which machine they are using at the time. The gateway machines also worry about mail header formats and logging (mail logging is a postmaster s friend) and provide a centralized point for monitoring the behavior of the electronic mail system. It is equally valuable to route incoming mail 54 IEEE Communications Magazine September 1994

6 through a gateway. One person can be aware of all internal connectivity problems, rather than leaving it to hundreds of random system administrators around the net. Reasonably constant mail addresses can be accepted and processed. Different technologies, such as uucp, can be used to deliver mail internally. Indeed, the need for incoming mail gateways is so obvious that the DNS has a special feature - MXrecords - defined to support them. No other application has a defined mechanism for indirect access. These features are even more valuable from a security perspective. Internal machine names can be stripped off, hiding possibly valuable data. Trafflc analysis and even content analysis and recording can be performed to look for information leaks. But these abilities should be used with the utmostreluctance,forbothlegalandethicalreasons. Application gateways are often used in conjunction with the other gateway designs, packet filters and circuit-level relays. An application gateway can be used to pass ~ 1through 1 a firewall with reasonable security [27]. The semantic knowledge inherent in the design of an applicationgateway canbe usedinmoresophisticatedfashions. Gopher servers [l] can specify that a file is in the format used by the uuencode program. But that format includes a file name and mode. A clever gateway could examine or even rewrite this line, thus blocking attempts to force the installation of bogus. rhosts files or shells with the setuid bit turned on. The type of filteringused depends on local needs and customs. A location with many PC users might wish to scan incoming files for viruses. We note that the mechanisms described herein are intended to guard against attackfrom the outside. A clever insider who wanted to retrieve such files certainly would not be stopped by them. But it is not a firewall s job to worry about that class of problem. The principal disadvantage of applicationlevel gateways is the need for a specialized user program or variant user interface for most services provided. In practice, this means that only the most important services will be supported. This may not be entirely bad-again, programs that you do not run cannot hurt you -but it does make it harder to adopt newer technologies. Also, use of such gateways is easiest with applications that make provision for redirection, such as mail and ~11. Otherwise, new client programs must be provided. Circuit-Level Gate ways he third type of gateway - our preference for T outgoing connections - is circuit level. Circuit gateways relay TCP connections. The caller connects to a TCP port on the gateway, which connects to some destination on the other side of the gateway. During the call the gateway s relay program(s) copy the bytes back and forth: the gateway acts as a wire. In some cases a circuit connection is made automatically. For example, we have a host outside our gateway that needs to use an internal printer. We have told that host toconnect to the print service on the gateway. Our gateway is configured to relay that particular connection to the printer port on an internal machine. We use an access control mechanism to ensure that only that one external host can connect to the gateway s printer service. We are also confident that this particular connection will not provide a useful entry hole should the external host be compromised. In other cases, the connection service needs to be told the desired destination. In this case, there is a little protocol between the caller and the gateway. This protocol describes the desired destination and service, and the gateway returns error information if appropriate. In our implementation, called proxy, the destination is a host name. In socks (discussed later), it is the numeric IP address. If theconnection is successful, theprotocol ends and the real bytes start flowing. These services require modifications to the calling program or its library. In general, these relay services do not examine the bytes as they flow through. Our services do log the number of bytes and the TCP destination. These logs can be useful. For example, we recently heard of a popular external site that had beenpenetrated. The Bad Guys had been collecting passwords for over a month. If any of our users used these systems, we could warn them. A quick grep through the logs spotted a single unfortunate (and grateful) user. The outgoing proxy TCP service provides most of the externalconnectivity our internalusers need. As noted, though, protocols such as FIT and ~ 11 require incoming calls. But it is too much of a security risk to permit the gateway to make an uncontrolled call to the inside. Any general solution is going to involve the gateway machine listening on some port. Ths approach demonstrates a subtle problem with the notion of a circuit gateway: uncooperative inside users can easily subvert the intent of the gateway designer, by advertising unauthorized services. It is unlikely that, say, port 25 could be used that way, as the gateway machine is probably using it for its own incoming mail processing, but there are other dangers. What about an unprotected telnet service on a nonstandard port? An NFS server? Amultiplayer game? Logging can catch some of these abuses, but probably not all. Clearly, some sorts of controls are necessary. These can take various forms, including a time limit on how long such ports will last (and a delay before they may be reused), a requirement for a list of permissible outside callers to the port, and even user authentication on the setup request from the inside client. Obviously, the exact criteria depend on your stance. The other big problem with circuit relays is the need to provide new client programs. Although thecode changes are generally not onerous, they are a nuisance. Issues include availability of application source code for various platforms, version control, distribution, and the headache to users of having to know about two subtly different programs. Several strategies are available for making the necessary changes. The best known is the socks package [8]. It consists of a set of almost-compatible replacements for various system calls: socket, connect, bind, etc. Converting an application is as simple as replacing the vanilla calls with the - The principal disadvantage of application - level gateways is the need for a specialized user program or variant user in ter3ca ce for most services provided. IEEE Communications Magazine September

7 - Regardless of the firewall design, it is generally necessary to support various incoming services. Naturally, access to any of these must be blessed by the filter and the gateway. socks equivalents. A version of it has been implemented via a replacement shared library, similar to that used in securelib [ 111 and 3-D FS [lo]. This would permit existing applications to run unchanged. But such libraries are not portable, and it may not be possible to include certain of the security features mentioned earlier. Application and circuit gateways are well suited for some UDP applications. The client programs must be modified to create a virtual circuit to some sort of proxy process; the existence of the circuit provides sufficient context to allow secure passage through the filters. The actual destination and source addresses are sent in-line. However, services that require specificlocal port numbers are still problematic. Supporting Inbound Services egardless of the firewall design, it is generally R necessary to support various incoming services. These include things like , FTP, logins, and possibly site-specific services. Naturally, access to any of these must be blessed by the filter and the gateway. The most straightfonvardwayto do thisis toprovide these services on the gateway itself. This is the obvious solution for mail and FTP. For incoming logins, we provide a security server: users must have one-time password devices to gain access to inside machines. If they pass that test, the gateway program will connect them to an inside machine, using some sort of preauthenticated connection mechanism such as rlogin. Ganesan has implemented a gateway that uses Kerberos[4,9,14,24] to authenticatecalls[6]. Once the gateway has satisfied itself about the identity of the caller, it will pass the connection on to the desired internal server. With this design, the Kerberos server should be run by the same group that administers the firewalls, since the party that controls the server controls the authenication, and hence the ability to make calls through the firewall. Regardless of the scheme used, all incoming calls carry some risk. The telnet call that was authenticated via a strong mechanism could be the product of a booby-trapped command. Consider, for example, a version that. after a few hundred bytes, displays Destination Unreachable on the console and exits - but before doing that, it forks, and retains the open session to your inside machine. Similarly, a legitimate user who connects for the purpose of reading mail takes the risk that some of those messages contain sensitive information, information that can now be read by anyone monitoring the unprotected, untrustworthy outside network. Tunnels Good and Bad lthough firewalls offer strong protection, tun- A nels can be used to bypass them. As with most technologies, tunnels can be used in good or bad ways. Tunneling refers to the practice of encapsulating a message from one protocol in another, and using the facilities of the second protocol to traverse some number of network hops. At the destination point, the encapsulation is stripped off, and the original message is reinjected into the network. In a sense, the packet burrows under the intervening network nodes, and never actually sees them. There are many uses for such a facility, such as enclypting links and supporting mobile hosts. More are described in [2]. In some cases, a protocol may be encapsulated within itself. That is, IP may be buried within either IP or some part of its own protocol suite, such as TCP or UDP. That is the situation we are concerned about here. If a firewall permits user packets to be sent, a tunnel can be used to bypass the firewall. The implications of this are profound. Suppose that an internal userwith a friend on the outside dislikes the firewall, and wishes to bypass it. The two of them can construct (dig?) a tunnel between an inside host and an outside host, thereby allowing the free flow of packets. This is far worse than a simplc outgoing call, since incoming calls are permitted as well. Almost any sort of mechanism can be used to build a tunnel. At least one vendor of a Point-to- Point Protocol (PPP) package [22] supports TCP tunneling. There are reports of telnet connections and even DNS messages being used to carry IP packets. Almost any gateway that supports anything more powerful than mail relays can be abused in this fashion (yet see RFC ). Even pairs of FTP file transfer connections can provide a bidirectional data path. The extent of the damage done by a tunnel depends on how routing information is propagated. Suppression of routing information is almost as effective as full isolation. If the tunnel does not leak your routes to the outside, the damage is less than might be feared at first glance. On the other hand, routing filters are difficult to deploy in complex topologies; if the moles choose to pass connectivity information, it is hard to block them. In the Internet, the backbone routers do, in fact, perform filtering. Thus, if your internal networks are not administratively authorized for connection to the Internet, routes to them will not propagate past that point. Even so, you are exposed to anyone using the same network provider as the tunnel exit. Often, suchasituationcanbedetected. Ifyouare using an application- or circuit-level gateway, and an external router knowsapath to any internalnetwork except the gateway s, something is leaking. This argues strongly that a gateway net should not be a subnet of an internal net. Rather, it should have its own, separate, Class C address. Standard network management tools may be able to hunt down the source, at which time standard people management tools should be able to deal with the root cause. Unauthorized tunnels are, in the final analysis, a management problem, not a technical one. If insiderswill not accept the need for information security, firewalls and gateways are likely to be futile. (Ofcourse, it is worth asking if one s protective measures are too stringent. Certainly. that happens as well.) Once suspected or spotted, the gateway logging tools should be able to pick out the tunnels. Tunnels have their good side aswell. When properly employed, they can be used to bypass the limitationsof a topology. For example, a tunnel could link two separate sites that areconnected onlyvia a commercial network provider. Firewalls at each location would provide protection from the outside, while the tunnel provides connectivity. If the tunnel traffic is encrypted, the risks are low and the benefits high. 56 IEEE Communications Magazine September 1994

8 implementation concepts What Firewalls Cannot Do irewalls are a powerful tool for network secu- F rity. However, there are things they cannot do. It is important to understand their limitations as well as their benefits. Consider the usual network protocol layer cakc. By its nature, a firewall is avery strong defense against attacks at a lower level of the protocol stack. For example, hosts behind a circuit-level relay are more or less immune to network-lcvel attacks, such as IP addressspoofing. The forged packets cannot reach them; the gateway will only pass particular TCP connections that have been properly set up. In contrast, firewalls provide almost no protection against problems with higher level protocols, except by peeking. The best TCP relay in the world is no protection if the code that uses it is buggy and insecure. You only get protection at this level if your gateway refuses to connect you to certain services (i.e., x11), and even that decision is applying application-layer knowledge to make that decision. (Ifyou thinkof the standard protocol stack as an onion rather than as a layer cakc, peering up through the layers may be referred to as looking through a glass onion. ) The most interesting question is what degree of protection a firewall can provide against threats at its own level. The answer turns entirely on how carefully the gateway code - the permissive part - is written. Thus, a mail gateway, which runs at the application level, must be exceedingly careful to implement all of the mail protocols, and all of the other mail delivery functions, absolutely correctly. To the extent that it is insecurely written - sendmail comes to mind - it cannot serve as an adequate firewall component. The problems, however, do not stop there. Any information that passes inside can trigger problems, if a sensitive component should lay hands (or silicon) on it. We have seen files that,when transferred over a communications link, effectively brought down that link, because of bit pattern sensitivity in some network elements. Were that deliberate, we would label it a denial-of-service attack. Arecent sendmail bugprovidesa sterlingexample. Problems with certain mail header lines could tickle bugs in delivery agents. Our firewall, and many others. paid almost no attention to headers, believing that they were strictly a matter for mail readers and composers (known as user agents in the business). But that meant that the firewalls provided no protection against this problem, because undercertaincircumstances, senhi1 -which is run on many internal machines here -does look at the headers, and certain entries made it do evil things. Furthermore, even ifwe had implemented defenses against the knownflaws, wewouldstillbe~lnerable to next year s. If someone invented anew header line that was implemented poorly - and this particular problem did involve a nonstandard header - we would still be vulnerable. We could have protected ourselves if and only if we had refused to pass anything but the minimal subset of headers we did know of, and even then there might have been danger if some aspect of processing a legitimate, syntactically correct header was implemented poorly. At best. a firewall provides aconvenient single place to apply a corrective filter. Conclusions etworks are very powerful tools. Like all N tools, they can be misused. Firewalls, though not perfect, provide a strong measure of protection for computers connected to networks. There are a number of firewall technologies to choose from, each with its own advantages. Regardless of which is selected, careful configuration is necessary. But if one have a good security policy, and a correct implementation of it, one can enjoy most of the benefits of networking, while minimizing the risks. References 111 F. Anklesaria et al., The Internet gopher protocol (A distributed document search and retrieval protocol) RFC 1436, March [215 M. Bellovin. Pseudo-networkdriversandvirtual networks. In USENIX Conf. Proc.. pp Washington, D.C.. Jan S M. Bellovin, Firewall-friendly FTP. RFC 1579, Feb B Bryant, Designing an authentication system: A dialogue in four scenes, Feb , Draft. 151 D. B. Chapman, Network (in)security through IP packet filtering. In Proceedings of the Third Usenix UNlX Security Symposium, pp Baltimore, MD. Sept R. Ganesan. BAfirewall: A modern design, Proc. of the Internet SocietySymposiumon Networkan ddistributed System Security, San Diego, CA, Feb. 3, lK.HafnerandJ. Markoff,Cyberpunk:Outlawsand Hackersonthecomputer Frontier (Simon & Schuster. 1991) I81 D. Koblas and M. R. Koblas, Socks, UNlX Security 111 Symposium, pp Baltimore, MD, Sept USENIX. 191 J. Kohl and C. Neuman. The Kerberos network authentication service (V5). RFC 1510, Sept I101 D. G. Korn and E. Krell, The 3-d file system, USENIX Conf. Proc.. pp , Baltimore, MD, Summer I111 W. LeFebvre, Restricting network access to system daemons under SunOS. UNlX Security Ill Symposium, pp Baltimore, MD. Sept USENIX. I121 M Lottor. Domain administrators operations guide. RFC 1033, Nov M. Lottor,TCPportservicemultiplexerUCPMUX), RFC1078, Nov [141 S. P. Miller et al.. Kerberos authentication and authorization system, Project Athena Technical Plan, MIT. Dec. 1987, Section E.2.1. I151 D. Mills. Network time protocol (version 3) specification, implementation and analysis. RFC 1305, March P Mockapetris, Domain names ~ and facilities, RFC 1034, Nov P. Mockapetris, Domain names ~ and specification. RFC 1035, Nov [181 J. Postel. User datagram protocol, RFC 768, Aug. 28, J. Postel, Transmission control protocol, RFC 793, Sept.1981 [201 J. Postel and 1 Reynolds, File transfer protocol. RFC 959, Oct I21 I M. 1. Ranum. A network firewall. Proc. World Conference on System Administration and Security, Washington. D.C., July William Simpson. The point-to-point protocol (PPP) for the transmission of multi-protocol datagrams over point-to-point links. RFC 1331, May L231 M. Stahl, Domain administrators guide. RFC 1032, Nov [241 J. Steiner. B. Clifford Neuman, and 1. I. Schiller. Kerberos: An authentication service for open network systems, Proc. Winter USENIX Conf.. pp Dallas, TX Sun Microsystems. RPC: Remote procedure call protocol specification: Version 2. RFC 1057, June L261 Sun Microsystems, Network Interfaces Programmer s Guide, Mountain View, CA, March, SunOS 4 1 [271 W. Treese and A. Wolman. X through the firewall, and other application relays, USENIXConf. Proc., pp.87-99,cincinnati.oh.june L281 D. Waitzman, Standard for the transmission of IP datagrams on avian carriers. RFC 1149, April 1, 1990 Biographies STEVENM.BELLOV~N receivedab.a.fromcolumbiauniversity,and M.S.and Ph D degrees in computer science from the University of North Carolina at Chapel Hill. While a graduate student, he wrote the original version of pathalias and helped create netnews. However, the former is not an indictable offense, and the statute of limitations on the latter ha5 expired. Since 1982 he has been at AT&T Bell Laboratories, Murray Hill, New Jersey, where he does research in networks and security. and why the two don t get along. He is also the co-author of the recent book Firewalls and Internet Security: Repellmg the Wily Hacker. His address is WILLIAM R. CHESWICK was graduated from Lehigh University in the mid- 1970s with a computer science degree. He pursued a random career of technical support, teaching, and system administration at a variety of universities in the northeast. For the past seven years he has served as an assistant programmer trainee and member of the technical staff at Bell Laboratories in Murray Hill, New Jersey. He recently coauthored, with Steve Bellovin. Firewalls and Internet Security. Repelling the Wily Hacker. His address is - What degree of protection can a firewall provide against threats at its own level? The answer turns entirely on how carefully the gateway code - the pemissive part - is written. IEEE Communications Magazine September

83-10-41 Types of Firewalls E. Eugene Schultz Payoff Firewalls are an excellent security mechanism to protect networks from intruders, and they can establish a relatively secure barrier between a system

Proxy Server, Network Address Translator, Firewall 1 Proxy Server 2 1 Introduction What is a proxy server? Acts on behalf of other clients, and presents requests from other clients to a server. Acts as

Firewalls What is a Firewall? A choke point of control and monitoring Interconnects networks with differing trust Imposes restrictions on network services only authorized traffic is allowed Auditing and

CSCI 7000-001 Firewalls and Packet Filtering November 1, 2001 Firewalls are the wrong approach. They don t solve the general problem, and they make it very difficult or impossible to do many things. On

Chapter 10 Firewall Firewalls are devices used to protect a local network from network based security threats while at the same time affording access to the wide area network and the internet. Basically,

IMPLEMENTATION OF INTELLIGENT FIREWALL TO CHECK INTERNET HACKERS THREAT Roopa K. Panduranga Rao MV Dept of CS and Engg., Dept of IS and Engg., J.N.N College of Engineering, J.N.N College of Engineering,

Internet Firewalls Policy Development and Technology Choices Leonard J. D Alotto GTE Laboratories, Incorporated Abstract Since the development of the World Wide Web (WWW), more and more organizations are

Firewalls (IPTABLES) Objectives Understand the technical essentials of firewalls. Realize the limitations and capabilities of firewalls. To be familiar with iptables firewall. Introduction: In the context

CMPT 471 Networking II Firewalls Janice Regan, 2006-2013 1 Security When is a computer secure When the data and software on the computer are available on demand only to those people who should have access

Firewalls and VPNs Principles of Information Security, 5th Edition 1 Learning Objectives Upon completion of this material, you should be able to: Understand firewall technology and the various approaches

A Unix Network Protocol Security Study: Network Information Service Introduction David K. Hess, David R. Safford and Udo W. Pooch Texas A&M University dhess@cs.tamu.edu This note is a study of the security

Module 8 Network Security Lesson 3 Firewalls Specific Instructional Objectives On completion of this lesson, the students will be able to answer: What a firewall is? What are the design goals of Firewalls

Stateful Inspection Technology Security Requirements TECH NOTE In order to provide robust security, a firewall must track and control the flow of communication passing through it. To reach control decisions

What is Firewall? A system designed to prevent unauthorized access to or from a private network. What is Firewall? (cont d) Firewall is a set of related programs, located at a network gateway server. Firewalls

A firewall is a software- or hardware-based network security system that allows or denies network traffic according to a set of rules. Firewalls can be categorized by their location on the network: A network-based

Firewalls and Intrusion Detection What is a Firewall? A computer system between the internal network and the rest of the Internet A single computer or a set of computers that cooperate to perform the firewall

Firewalls, Tunnels, and Network Intrusion Detection 1 Part 1: Firewall as a Technique to create a virtual security wall separating your organization from the wild west of the public internet 2 1 Firewalls

Firewalls Network Security: Firewalls, VPNs, and Honeypots CS 239 Computer Security March 7, 2005 A system or combination of systems that enforces a boundary between two or more networks - NCSA Firewall

N-CAP Users Guide Everything You Need to Know About Using the Internet! How Firewalls Work How Firewalls Work By: Jeff Tyson If you have been using the internet for any length of time, and especially if

Page 1 of 6 Overview - Using ADAMS With a Firewall Internet security is becoming increasingly important as public and private entities connect their internal networks to the Internet. One of the most popular

Page 1 of 9 Overview - Using ADAMS With a Firewall Internet security is becoming increasingly important as public and private entities connect their internal networks to the Internet. One of the most popular

CSE331: Introduction to Networks and Security Lecture 12 Fall 2006 Announcements Midterm I will be held Friday, Oct. 6th. True/False Multiple Choice Calculation Short answer Short essay Project 2 is on

Security threats and network As we have already discussed, many serious security threats come from the networks; Firewalls The firewalls implement hardware or software solutions based on the control of

Cyber Security: Beginners Guide to Firewalls A Non-Technical Guide Essential for Business Managers Office Managers Operations Managers This appendix is a supplement to the Cyber Security: Getting Started

Host/Platform Security Module 11 Why is Host/Platform Security Necessary? Firewalls are not enough All access paths to host may not be firewall protected Permitted traffic may be malicious Outbound traffic

Firewall Management Prep. drd. Radu Constantinescu Academy of Economics Studies, Bucharest ABSTRACT Network connectivity can be both a blessing and a curse. On the one hand, network connectivity can enable

ΕΠΛ 674: Εργαστήριο 5 Firewalls Παύλος Αντωνίου Εαρινό Εξάμηνο 2011 Department of Computer Science Firewalls A firewall is hardware, software, or a combination of both that is used to prevent unauthorized

Architecture The policy discussed suggests that the network be partitioned into several parts with guards between the various parts to prevent information from leaking from one part to another. One part

Classification of Firewalls and Proxies By Dhiraj Bhagchandka Advisor: Mohamed G. Gouda (gouda@cs.utexas.edu) Department of Computer Sciences The University of Texas at Austin Computer Science Research

Firewalls, Tunnels, and Network Intrusion Detection 1 Firewalls A firewall is an integrated collection of security measures designed to prevent unauthorized electronic access to a networked computer system.

1-06-20 Internet Security Using Firewalls Vincent C. Jones Payoff Openness has long been the modus operandi on the Internet. Now, as more businesses connect to the Internet as a service to their internal

FIREWALL RULES Firewalls operate by examining a data packet and performing a comparison with some predetermined logical rules. The logic is based on a set of guidelines programmed in by a firewall administrator,

In today s world the Internet has become a valuable resource for many people. However with the benefits of being connected to the Internet there are certain risks that a user must take. In many cases people

ΕΠΛ 475: Εργαστήριο 9 Firewalls Τοίχοι πυρασφάλειας Department of Computer Science Firewalls A firewall is hardware, software, or a combination of both that is used to prevent unauthorized Internet users