CCNA Security: The Zone-Based Firewall
Date: Sep 15, 2011
Female Voice: Don’t tell me which zone’s for stopping and which zone’s for loading! Male Voice: Listen, Betty, don’t start your white zone $%@# again. There is just no stopping in the white zone.
Airplane (1980)
A very welcome new addition in the CCNA, CCNP, and CCIE Security tracks is the Cisco IOS Zone-Based Firewall. This article aims to guide you through this new technology from Cisco. As you will see, this new feature is actually combining earlier Cisco features like the Modular Quality of Service Command Line Interface (MQC) and Context Based Access Control (CBAC).
I first wrote about the Zone-Based Firewall in the CCNA Security Quick Reference Sheets from Cisco Press. This was back in July of 2008. Not much has changed with the technology since then, but my goal in this article is to go much further than I was able to go in that intentionally-condensed coverage. If this document wets your appetite, then be sure to check out the more expansive Official Guides from Cisco Press. Again, realize this important technology appears in the Associate, Professional, and Expert levels of Cisco Certification.
The Zone-Based Firewall first appeared in the Cisco IOS version 12.4(6)T release. Cisco’s goal with this security invention was to provide an intuitive and straightforward policy design approach for multiple interface routers. The early CBAC technology was very well received, but it did not provide a high level of granularity for the application of complex security policies. That approach to router-based firewalling was also cursed with an interface by interface configuration that could become quite nightmarish when dealing with multiple internal, external, and DMZ interfaces.
The Configuration
With the Zone-Based Firewall, we take interfaces and place them into a new logical router structure called a zone. A zone is used to define interfaces that will share a security treatment. Cisco automatically designates a special zone for us called the Self Zone. This important zone is used for controlling traffic that is sourced from or directed to the router itself.
The zones we create are placed into zone pairs. A great example is having a simple Inside Zone paired with an Outside Zone. You then apply a unidirectional security treatment to the zone pair. Special-purpose security class-maps are used to define the traffic that we want to apply policy to. Sure enough, special-purpose policy-maps are used to define the policy, and finally, service policies are used to assign these zone-based policy-maps to zone pairs. For those readers familiar with the decade-plus old MQC on Cisco routers, this sounds very familiar indeed.
When you are assigning policy to a zone pair in a particular direction, you use the options of DROP, PASS, or INSPECT. DROP is obvious. The traffic matching the class-map is dropped. PASS is also obvious. The traffic is not treated or analyzed in any special manner; it is simply passed from one zone to another and defined in the zone pair. The INSPECT option is the important one. This does stateful inspection (think CBAC) on the traffic as defined in the class-maps.
Here is an example. Perhaps you have Fa0/0 and Fa0/1 that connect to private networks in your company. Your interface S0/0 connects to the public Internet. The steps for the Zone-Based Firewall configuration are as follows:
Step 1 Define and populate zones.
Step 2 Define the class-maps that identify traffic flowing between zones.
Step 3 Configure a policy-map that specifies actions for the traffic.
Step 4 Configure the zone pair and apply the policy.
Given our scenario, here are the configurations for these steps.
Step 1 Define and populate zones:
configure terminal ! zone security ZONE_PRIV zone security ZONE_INT ! interface range fa0/0 - 1 zone-member security ZONE_PRIV ! interface s0/0 zone-member security ZONE_INT
Notice the important new commands here: zone security for the creation of the zone in Global Configuration mode, and zone-member security in Interface Configuration mode for the assignment of interfaces to zones.
Step 2 Define the class-maps that identify traffic flowing between zones:
configure terminal ! class-map type inspect match-any CM_NET_TRAFFIC match protocol http match protocol https match protocol ftp
Notice the special class-map here of type inspect. We have to specify that this class-map is a match-any since we are looking for http, or https, or ftp traffic. Any traffic that does not match any of these definition will fall into a class-map automatically created by Cisco called the class-default class-map. You can specify policy for this “catch-all” class just like you can your user-defined classes.
Step 3 Configure a policy-map that specifies actions for the traffic:
configure terminal ! policy-map type inspect PM_PRIVATE_TO_INTERNET class type inspect CM_NET_TRAFFIC inspect
Here is the creation of our policy-map. Notice that it is also of the special type inspect. There is nothing much to configure under Policy-map Configuration mode. Perhaps you might want to add a text-based description to the structure. It is typical to immediately reference the class-map that you want to effect with a policy. In our example here, we are making sure to inspect the http, https, and ftp traffic. This means the router will dynamically permit this traffic out from one zone to another, and dynamically allows the appropriate response traffic back in. Should traffic from the outside Internet attempt to initiate connections from the outside, they will be dynamically blocked. We remember all of this behavior from the older CBAC.
Step 4 Configure the zone pair and apply the policy:
configure terminal zone-pair security ZONEP_PRIV_INT source ZONE_PRIV destination ZONE_INT service-policy type inspect PM_PRIVATE_TO_INTERNET
Notice how the unidirectional nature of the zone pair is specified. The zone-pair security command specifies the source and the destination.
The Verification
It is critical to verify and then monitor the success of your Zone-Based Firewall. What is the key command to do this? It is:
show policy-map type inspect zone-pair
Here is an example of this command in action:
SampleRouter#show policy-map type inspect zone-pair Zone-pair: ZONEP_SAMPLE Service-policy inspect : PM_T1_T2 Class-map: CM_TEST (match-any) Match: protocol telnet 5 packets, 120 bytes 30 second rate 0 bps Inspect Packet inspection statistics [process switch:fast switch] tcp packets: [0:40]
Be sure to test, and test, and test some more with your configuration in a lab or pilot environment prior to deploying into the production network.
The Caveats
Now that you have mastered the basics of the Zone-Based Firewall and its configuration, it is important that you master the caveats of this new and exciting Cisco router feature:
- Configure your zones first as we demonstrated. A zone must be configured before you can assign interfaces to the zone.
- You can assign an interface to only one security zone.
- Traffic is always implicitly allowed to flow between interfaces within the same zone.
- To permit traffic to and from a zone member interface, you must configure a policy allowing or inspecting traffic between that zone and any other zone.
- Traffic cannot flow between a zone member interface and any interface that is not a zone member.
- Interfaces that have not been assigned to a zone function as classic router ports. These ports are still capable of receiving a classic CBAC configuration.