14.4 Enterprise Firewalls

The ARPANET began as a research network in 1969. Within a decade, it was so reliable that many organizations used it for routine data traffic. The same happened to the internet in the 1980s.

Because it was originally a research network, many internet sites focused on supporting and promoting research efforts. Many sites provided public access to some basic resources and data files. Most sites provided services like “finger” (Section 2.3), email, and access to shared files. Some sites even allowed outsiders to store files on their file servers to simplify sharing with the site’s own users.

At the same time, computers had become cheap and powerful enough to earn a place on the desktop of most technical professionals. These computers themselves were linked into an enterprise network. Desktops shared printers, central hard drive storage, and an email service. Most networks were local in that they did not connect to other networks or to the internet.

If a site did connect to the internet, it usually did so at a single point. The connection usually required an expensive leased line. Within the site, it connected to a host that routed packets and served as a gateway to the site. Originally, this gateway did nothing more than route traffic between the internal LAN and the external internet.

Only a few sites made any attempt to filter internet traffic arriving at their site. Most sites allowed packets to move freely between their hosts and the internet. Moreover, the internet was so small that no one worried about using up the 4 billion available IP addresses.

Evolution of Internet Access Policies

By the late 1980s, the internet was a very busy international network, with thousands of private and commercial users, as well as government and educational ones. This yielded a major shift in the assets visible on the internet. Numerous incidents illustrated its vulnerability and its promise. For careful sites, this led to major shifts in internet policy. The policy issues revolved around the following two questions:

  1. How do our employees use the internet to get their jobs done?

  2. What services do we offer to internet users that aid us in achieving our enterprise objectives?

Some organizations essentially unplugged themselves from the internet, concluding that it served no business purpose. More often, a site might retain email service and block most other services, except perhaps to selected research and development groups. Other organizations took a more selective approach, allowing email and perhaps web surfing, and blocking less-essential activities like ping and the troublesome “finger” service.

As internet services evolved, especially the World Wide Web, so did the problems and concerns of internet-connected sites. The web provided access to vast quantities of important and useful information, but it also provided a trove of entertainments and distractions. Some organizations tried to restrict or control the sites that users visited through various filtering and monitoring techniques. (See Section 15.2.) The evolution of spam and email viruses also encouraged enterprises to take extra steps in filtering internet traffic.

A Simple Internet Access Policy

Let’s develop a simple policy for the Amalgamated Widget enterprise network. The enterprise has a website, and it exchanges email with a few other internet sites. In order to avoid spam, the MTA accepts only email that is forwarded from its ISP and from the local university. Here’s a list of risks that Amalgamated, in particular, may avoid through close management of its internet connection:

  1. Attacks on its internal file servers from hackers on the internet

  2. Commercial embarrassment of not having a company website

  3. Poor customer communication without ease of having email

  4. Poor email service, as a result of spam

  5. Ineffective marketing, purchasing, and R&D staff caused by a lack of internet browser access

These risks yield the internet access policy shown in TABLE 14.2.

TABLE 14.2 A Simple Policy for Managing an Internet Connection

Policy Number Requirement Risks
1 Approved MTAs shall be able to deliver mail to enterprise MTAs. 3, 4
2 The marketing, purchasing, and R&D staffs shall have Internet browser access. 5
3 Internet hosts shall be able to visit the corporate external web server. 2
4 Internet hosts shall not be able to open connections to hosts inside the enterprise network. 1

We implement this policy by controlling internet traffic as it enters and leaves the site. Because all traffic goes through the site gateway, the gateway must implement the controls.

14.4.1 Controlling Internet Traffic

Site policies often apply four different strategies for controlling internet traffic to and from an enterprise network. A gateway may restrict or allow internet traffic based on one or more of these strategies:

  1. Host control: The sending or receiving host address

  2. Service control: The TCP or UDP service as indicated by the port number

  3. Direction control: Whether the session was initiated inside the private network or from the internet

  4. Content control: Whether the application data violates specific restrictions

The gateway applies these different controls at different layers of the protocol stack (FIGURE 14.10).

An illustration of packet format depicts Traffic control associated with different packet headers.

FIGURE 14.10 Traffic controls involve different packet headers.

Host control restricts traffic according to the hosts involved. In theory, this could apply to host addresses in either the link or IP layers. Gateways usually rely on IP addresses and ignore link layer MAC addresses, because MAC addresses aren’t retained in a routed packet.

Service control restricts traffic according to the service protocol being used, as indicated by the TCP or UDP port number. Direction control restricts traffic depending on whether it originated within the enterprise network or originated from the internet. Content control restricts traffic based on an analysis of application layer data.

Some site policies use host control as a way to enforce user-based controls. Because most users access the internet from a personal computer, user-based controls tie the user identity temporarily to a specific IP address. This requires a separate protocol to authenticate the host’s user to the gateway.

Direction control is important because most site policies treat inbound connections very differently from outbound connections. We know that outbound connections are opened by hosts inside the enterprise network, so we can trust them to some degree. Inbound connections, on the other hand, may originate from an outsider with malicious intent. Although we might not trust insiders completely, we assume that insiders are less likely to have malicious intent.

Content controls are often used when enterprises need to stem perceived or actual abuses of internet resources. The most common application is in antispam and email antivirus applications. The antispam software examines incoming email and applies various rules and profiles to detect spam. After detecting it, the software either deletes it or marks it so that recipients can easily filter it out. Antivirus software uses a similar technique by analyzing attachments that may contain viruses. If the attachment matches a possible virus, the software replaces the attachment with a benign substitute, assuming that the recipient did not request the virus email.

Some site policies restrict internet browsing by users and rely on content control to monitor or enforce that policy. We discuss this further in Section 15.2.

14.4.2 Traffic-Filtering Mechanisms

Firewalls use three mechanisms to filter traffic. The following list presents them in order of increasing complexity.

  1. Packet filtering

  2. Session filtering

  3. Application filtering

Packet Filtering

Packet filtering was used on the earliest Ethernet LANs in the 1970s, partly to distinguish a host’s incoming traffic from the rest of the LAN activity. We filter packets one at a time. We look at the fields of each packet individually and either accept or reject the packet based on its contents (FIGURE 14.11).

An illustration of packet format depicts Packet filtering examining individual packet fields. The fields in the packet include Link Header, IP Header, TCP/UDP Header, and Application DATA. The IP Header and TCP/UDP Header are marked for filtering.

FIGURE 14.11 Packet filtering examines individual packet fields.

The firewall may enforce host control, service control, and some degree of content control using a packet filter. The IP header identifies source and destination hosts, and the port number identifies the service being performed. Many sites filter traffic to allow DNS, SMTP, and the Hypertext Transfer Protocol (HTTP) used for web traffic, as well as to reject most other services. Content control is limited to data that is visible in a single packet; packet filtering won’t detect unauthorized content that spans multiple packets. Many firewalls ignore the link header because the header would have been replaced if the packet passed through a router.

Session Filtering

In session filtering, we keep track of packets exchanged between pairs of sockets, that is, between a pair of hosts using a particular pair of port numbers (FIGURE 14.12). Some implementations perform “circuit filtering” in which the firewall creates a proxy TCP connection to carry the packets through the firewall. Circuit filters make the filtering decision when establishing the connection; if the filter accepts the connection, then all of its data will pass through the firewall. It’s easy to filter on the connection’s direction, because the firewall receives and processes the three-way handshake that opens the connection.

 An illustration depicts of packet format depicts session filtering keeping track of packets. The fields in the packet include Link Header, IP Header, TCP/UDP Header, and Application DATA. The IP Header and TCP/UDP Header are marked for filtering and is associated with a Session or connection state.

FIGURE 14.12 Session filtering keeps state across packets.

Other firewalls implement session filtering with a stateful packet filter that maintains connection and session state information, instead of actually establishing a connection through the firewall. Stateful filtering bases its decisions on state information developed from previously received packets. The firewall uses this information to make filtering decisions on subsequent packets. In practice, a stateful filter behaves the same as a circuit filter when handling connections: It will allow traffic to flow if it allows the connection to open.

For example, we have a firewall that blocks incoming connections and only allows its clients to open outbound connections to internet hosts. Here’s how the stateful filter might handle a TCP connection:

  • ■   A packet from an internal host arrives at the firewall with its SYN flag set. The filter allows this connection, so it will forward all of its packets after examining them. The filter records the socket information (IP addresses and port numbers) and notes that the socket’s session is opening.

  • ■   A packet arrives from the internet for that socket with its SYN and ACK flags set. The filter notes that the session is almost open.

  • ■   A packet arrives from the internal host on that socket with its ACK flag set. The filter notes that the socket’s session is fully open.

  • ■   When subsequent packets arrive in either direction for that session, the filter lets them pass.

  • ■   A packet arrives on that socket’s session with the FIN flag set. The filter notes that the session is closing.

  • ■   More packets are exchanged to close the connection. The filter discards the session.

  • ■   If additional packets arrive from the internet after the session is closed, the filter discards those packets. They do not belong to an open session.

A benefit of stateful filtering is that it handles UDP traffic as well as TCP traffic. Because UDP has no notion of a connection, the firewall must infer the session relationship based on the UDP traffic.

Application Filtering

In application filtering, the gateway examines the data in application-layer elements when deciding to let data pass (FIGURE 14.13).

An illustration depicts application filtering across multiple packets.

FIGURE 14.13 Application filtering applies to multiple packets.

The simplest form is the application proxy, a small firewall software component that applies relatively simple tests to smaller application data items. For example, a proxy can apply a blacklist to web URLs or to servers accessed via the file transfer protocol (FTP).

Proxies also provide an effective way to pass complicated protocols through the firewall; FTP, for example, negotiates the port numbers to use for its data connection. An FTP proxy allows the firewall to pass FTP service through while keeping unnecessary FTP ports disabled.

Firewall proxies can easily filter application data that fits into one or two packets. This approach does not allow filtering of arbitrarily large email messages that may contain arbitrarily large attachments. We perform such operations by redirecting the data to a special process that collects the entire message and analyzes it.

Firewalls often redirect all email to a special MTA that handles inbound email. The MTA applies spam and virus filtering software like SpamAssassin (Section 14.3.1) and IronPort (Figure 14.5). All incoming email arrives at the filtering MTA, which filters the email and then forwards it to another MTA for delivery inside the site.

14.4.3 Implementing Firewall Rules

We manage internet traffic by establishing a list of rules the firewall should enforce. The rules block or allow particular hosts, users, or traffic from certain networks or to restrict connections in particular directions.

Different firewall devices and products use different rule sets, but all have more or less the same semantics. The rule sets are often limited to the firewall-filtering mechanisms just described. Although an antivirus or spam package may apply more complex or sophisticated matching, the firewall rules determine which traffic is directed to those packages for analysis.

TABLE 14.3 shows a simple example of a firewall rule.

TABLE 14.3 Format of Simple Firewall Rules

images

Each rule contains seven fields:

  1. Control number: Numbers the rules so that we may cross-reference them when analyzing our security.

  2. Type of rule: Either “Allow” or “Deny” to indicate whether the rule explicitly permits or blocks the traffic it describes.

  3. Direction: Either “In” for traffic inbound to the site from the internet or “Out” for outbound traffic from the site to the internet.

  4. Transport protocol: Either “TCP,” “UDP,” or “All.”

  5. Source socket: Identifies the host and service that produced the packet, each in its own column. Either field may match a range of numeric values separated by a hyphen (“-”), or all possible values if a “*” is given.

    • The host identifier may contain an IP address or a domain name.

    • The service appears either as a port number or as a protocol acronym.

  6. Destination socket: Identifies the host and service intended to receive the packet. Either field may match a range of numeric values separated by a hyphen (“-”), or all possible values if a “*” is given.

    • The host identifier may contain an IP address or a domain name.

    • The service appears either as a port number or as a protocol acronym.

  7. Requirements: The numbered requirement statements addressed by this rule.

These rules enforce host, service, and direction control. Although the rules aren’t designed for a specific firewall brand or model, they assume that the firewall provides session control. The rules also assume that the firewall enforces Deny by Default.

Example of Firewall Security Controls

Our example is based on the security policy that Amalgamated Widget uses, shown in Table 14.2. The example makes certain assumptions about Amalgamated Widget’s enterprise network. We assume that the network has been assigned a block of global internet addresses in the range 30.40.*.*. In other words, the site may assign any internet address whose upper half contains 30.40 and may use the lower 16 bits for individual host addresses. This allows Amalgamated to assign a global internet address to every one of its hosts. It does not have to use NAT and private addresses. The firewall security controls in TABLE 14.4 enforce the Amalgamated policy.

TABLE 14.4 Firewall Controls to Enforce Amalgamated’s Internet Policy

images

When a packet arrives, the firewall applies the rules in order. If the packet, or its connection, matches one of the rules, the firewall applies the rule. If the rule allows the traffic, the firewall delivers the packet. If the rule denies the traffic, the firewall discards the packet.

This particular firewall implements Deny by Default and then applies the rules in the table. If the firewall does not implement Deny by Default and our policy requires Deny by Default, then the final firewall rule should deny any remaining connections.

Rules 1 and 2 allow DNS packets to enter and leave the site. Standard internet protocols won’t work without DNS. The first rule allows internet sites to visit the amawig DNS server. The second rule allows any host on the enterprise network to visit any DNS server on the internet.

Rules 3, 4, and 5 allow email connections between the amawig MTA and other MTAs. Rules 3 and 4 allow the two approved MTAs to connect to the amawig server. Rule 5 allows the amawig MTA to connect to any other MTA. Clients on the enterprise LAN must connect to their own MTA to send email; the firewall doesn’t allow access to other MTAs except by the enterprise MTA. In practice, the MTA itself may be configured to talk only to those other two MTAs. We could tighten security by restricting its connections to the other two MTAs.

The next three rules allow outbound HTTP for the three favored groups. The IP addresses with subnets 50, 60, and 70 (the third byte of each address) correspond to host addresses for the three groups allowed to surf the internet.

The final rule grants internet visitors access to the enterprise website. Note that neither inbound nor outbound rules permit SSL connections. These require additional rules.

Additional Firewall Mechanisms

A modern enterprise firewall’s rule set will also integrate some routing information and a NAT facility. The routing mechanisms allow us to route particular types of traffic to particular hosts or networks. In Table 14.4, all we can do is allow traffic to flow to a particular destination. If we specify the routing, then the traffic flows to the desired destination despite the actual destination address.

Firewall NAT configuration provides services and site security similar to those we discussed in Section 12.4.1. The enterprise firewall provides greater flexibility in assigning addresses and performing translation.

Firewall Rule Proliferation

The previous discussion notes a few specific cases for which we could improve the rule set by adding rules. Notably, no one can surf the web with SSL. In fact, the sample rule set here falls far short of providing typical internet access, even to the privileged groups. There is no FTP support or access to remote mailboxes via POP3 or IMAP. The firewall also blocks all routing and network management protocols, which may make it difficult for the enterprise to interact with the rest of the internet.

On the positive side, the rule set implements Deny by Default. The firewall should not allow traffic that we haven’t specifically allowed. This also means that we must add rules piecemeal that grant access for every internet application protocol we need to allow. Thus, we add rules as we add capabilities for our users.

It is challenging to manage a firewall rule set. Smaller sites may require only a few—or a few dozen—firewall rules. Larger and more complex sites require a larger and more complex rule set. To some extent, the number of rules depends on the size of the site and the arrangement of its point of presence (See Section 14.5). It also depends on the firewall design itself; some firewall models may describe a complex policy requirement in a single rule, while other models may require several rules to express the same restriction.

In practice, firewall rule sets may range in size from a handful to tens of thousands. Many enterprise firewalls carry 200 or fewer rules, while many others carry a thousand or more. Firewalls that support hundreds of users typically have a couple of thousand rules; the largest sites may have tens of thousands of rules.

Firewall rule sets pose an administrative challenge. The system administrators must be able to change rules reliably in response to changes in network organization or changes in security policies. Effective changes must not open vulnerabilities or block needed services.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset