How the PIX/ASA Firewall WorksNote With the implementation of the PIX and ASA software starting with version 7.0, many of the features and functionality of the firewall were changed dramatically. Version 7.0 was truly a major design shift. This chapter is written to include the 6.x software because, in addition to the new 7.x software, that is the version of software that most Cisco PIX firewalls are running. Where possible, we point out the new/changed features, commands and functionality that is provided via the 7.0 code. If no note specifies which version of software a command functions on, that means that the command is the exact same regardless of whether the firewall is running 6.x or 7.x software. For more detailed information about PIX 7.0 code, refer to the Cisco ASA and PIX Firewall Handbook (Cisco Press). Fundamentally, the PIX/ASA firewall functions by filtering traffic that is transmitted through the firewall across the firewall interfaces. This allows the PIX/ASA to protect hosts and networks from unauthorized access while still permitting access that is deemed (and defined) by the administrator as acceptable. The firewall functionality performs these tasks by parsing a security policy, functioning in a firewall mode of operation, and performing stateful inspection of the data. Firewall Security PolicyThe firewall security policy (not to be confused with the general security policies discussed in Chapter 10, "Firewall Security Policies") on the PIX firewall is what determines the traffic that will be permitted or denied by the firewall. To facilitate this, the PIX implements a combination of the following elements to assist in making filtering decisions:
In addition, the Cisco ASA can perform the following:
Separate the Network into Zones Based on Security LevelsThe PIX separates a network into separate zones based on their security level. These security levels range from 0 (completely untrusted) to 100 (completely trusted). Depending on the number of interfaces on a given PIX, there are at least two zones: 0 (outside interface) and 100 (inside interface). If there are additional interfaces on the PIX, they can be assigned a security level value from 1 to 99. Traffic from higher-security zones is allowed to pass to lower-security zones provided a translation rule is in place (the translation rule is optional for 7.x). Traffic between zones of equal security is also allowed to pass unimpeded, provided that the connections between resources have been enabled. Use ACLs to Permit or Deny TrafficA fundamental aspect of almost all firewalls, including the PIX and ASA, is the use of ACLs to define the list of traffic permitted or denied by the firewall. The PIX can use multiple ACLs that can be applied independently to each interface on the firewall. For PIX 6.x, the ACLs are always applied to inbound traffic on an interface. With PIX/ASA 7.x, this functionality has been expanded to allow the ACL to be applied to both inbound and outbound traffic on an interface. It is important to understand that the concept of inbound and outbound traffic in the context of an ACL is based on the traffic direction on the given interface, not the network that the traffic may have come from. For example, it is easy to think of an outbound ACL as applying to traffic that is coming from the internal network (after all, the traffic is going out of the network). This is not correct, however. From the perspective of the firewall, that traffic would actually be inbound traffic on the internal network interface and would be most effectively filtered by using an ACL that is applied to inbound traffic on the internal network interface. An example of an ACL applying to outbound traffic is the traffic permitted to exit an interface to a demilitarized zone (DMZ) segment. Apply NATPIX firewalls can also use NAT to facilitate the use of private IP addresses on the internal network, hide the local address of resources, and resolve IP routing problems due to overlapping IP address ranges on connected networks. NAT is typically used any time that traffic from a lower-security level interface is allowed to pass to a higher-security level interface. This implementation typically requires the use of both an address translation and an ACL. The PIX uses two types of translation:
Two primary exceptions apply to this situation. First, if the hosts on the different networks are not using NAT at all, as is typically the case with VPN connections, translations are not required. Instead, the command nat 0 acl is used to specify the traffic (based on the ACL) that should not be translated and rather should be directly transmitted through the firewall. The PIX 7.x code also changes this functionality in that translations are no longer required; however, an ACL is still necessary. In this case, the traffic is either permitted or denied as determined by a corresponding ACL. Apply AAA for Through TrafficCertain types of traffic, in particular HTTP traffic, can also require authentication and authorization of the user attempting to initiate this traffic. This can be used to ensure that only permitted users are able to pass the traffic in question through the firewall. In addition the PIX can be configured to forward accounting information to a RADIUS or TACACS+ server for reporting of usage. Apply Web or FTP FilteringThe PIX and ASA can perform some rudimentary filtering of web (HTTP and HTTPS) and FTP traffic by default. This functionality can be greatly enhanced through the use of third-party content-filtering systems, allowing for granular filtering and control of access to specific websites, FTP server, and many other Internet-based applications (such as instant messenger and peer-to-peer file-sharing applications). In particular the following Internet filtering products are supported for seamless integration with the PIX/ASA:
Firewall Modes of OperationTraditionally, PIX firewalls operated in a single mode of operation, known as routed mode. This is the most common firewall mode of implementation and treats the firewall as a router hop on the network. Devices on one side of the firewall are considered to be on different subnets than devices on the other side of the firewall. With the advent of PIX/ASA 7.x and the ASA security devices, a new mode of operation known as transparent mode was implemented. In transparent mode, the firewall operates more like a bridge than a router, transparently allowing traffic to traverse the firewall without requiring additional router hops or manipulation of the data. Essentially, the same network exists on both sides of the firewall. Because the firewall interfaces do not have IP addresses assigned to them (at least not in the conventional sense, you still need to assign an IP address to perform remote management of the firewall), the firewall is commonly referred to as operating in stealth mode (because it is not easily detectable). For most implementations, the firewall will be configured to operate in routed mode (and this is the default operating mode). Some notable exceptions that lend themselves to transparent mode are instances where you want a firewall that can filter traffic that would be otherwise blocked by routed mode (for example, unsupported routing protocols or multicast traffic). In addition, transparent mode firewalls can use EtherType ACLs to allow the firewall to filter some types of non-IP traffic. Transparent firewalls can also be used in situations where you do not want or need to re-IP address devices on each side of the firewall, instead of leaving them as previously configured with no additional configuration required. Stateful InspectionStateful packet inspection lies at the heart of how PIX/ASA firewalls function. This functionality is provided through a process known as the Cisco adaptive security algorithm (ASA). The ASA uses a stateful approach to security. Every inbound packet is checked exhaustively against the ASA and against connection state information in memory. The ASA applies the following default rules (although this is by far not an exhaustive list) to traffic coming into the PIX:
The ASA allows connections from a higher-security interface to a lower-security interface without an explicit configuration for each internal system and application, as shown in Figure 6-1. Figure 6-1. Cisco PIX ASA OperationThe ASA is always in operation and monitors all return packets to ensure they are valid. This is done by checking the state table to determine whether the packet in question is a response to a legitimate outbound connection. If it is, the packet is automatically permitted (this is the definition of stateful packet inspection). In addition, the ASA actively randomizes the TCP sequence numbers while ensuring that they stay within an acceptable range to minimize the risk of TCP sequence number attack. The ASA can also perform application inspection for certain types of traffic to determine whether it should be permitted or denied. Application InspectionApplication inspection is provided on the PIX firewall as a component of the ASA through the use of fixups or inspections. For PIX/ASA 7.0, the fixup command has been replaced by the use of the policy-map command. Functionally, the process is similar between a fixup and a policy map. Application inspection allows the firewall to perform additional inspection of certain types of applications. In doing so, the firewall can make filtering decisions based not on the protocol in use (for example, SMTP) but on the actual application (for example, only allowing HELO, MAIL, RCPT, DATA, RSET, NOOP, and QUIT commands for SMTP traffic). Application inspection is performed on the following protocols/applications (PIX/ASA versions older than 7.1 may not support all of these applications):
|