For more information on Security, visit our Security Reference Guide or sign up for our Security Newsletter
This chapter covers the following topics:
- Architectural overview
- Configuration of security contexts
- Deployment scenarios
- Monitoring and troubleshooting
The virtual firewall methodology enables a physical firewall to be partitioned into multiple standalone firewalls. Each standalone firewall acts and behaves as an independent entity with its own configuration, interfaces, security policies, routing table, and administrators. In Cisco ASA, these virtual firewalls are known as security contexts.
The following are some example scenarios in which security contexts are useful in network deployments:
- You act as a service provider and you want to provide firewall services to customers. However, you do not want to purchase additional physical firewalls for each customer.
- You manage an educational institution and you want to segregate student networks from faculty networks for improved security using one physical security appliance.
- You administer a large enterprise with different departmental groups, and each department wants to implement its own security policies.
- You have overlapping networks in your organization and you want to provide firewall services to all of those networks without changing the addressing scheme.
- You currently manage many physical firewalls and you want to integrate security policies into one physical firewall.
In Figure 9-1, SecureMe, an enterprise headquartered in Chicago, has a Cisco ASA providing firewall services to two of its customers. To implement a cost-effective solution, SecureMe has configured two security contexts in the security appliance: CustA for Customer A and CustB for Customer B. Each customer can manage and administer its own security context without interfering with the other context. On the other hand, the security appliance administrator manages the system execution space, which is discussed in the next section.
Figure 9-1 Security Contexts in the ASA
In this figure, each horizontal dotted box represents a security context that has a Cisco ASA inspecting and protecting the packets going through it, while the vertical box represents the physical Cisco security appliance with multiple security contexts.
Architectural Overview
In multiple security context mode, the Cisco security appliance can be divided into three types:
- A system execution space
- An admin context
- One or more customer contexts
All contexts must be configured correctly for proper function. Similar to a real network, in which one misconfigured device can affect the operations of other network devices, misconfiguration of a security context can impact the overall operation of a security appliance.
System Execution Space
Unlike other contexts, the system execution space does not have any Layer 2 or Layer 3 interfaces or any network settings. Rather, it is mainly used to define the attributes of other security context attributes. Here are the three important attributes configured for each context in the system execution space:
- Context name.
- Location of context's startup configuration. The configuration of each context is also known as a configlet.
- Interface allocation.
Additionally, many optional features, such as interface and boot parameters, can be configured within the system execution space. Table 9-1 lists the important features that can be set up through the system execution space.
Table 9-1. Options Available in System Execution Space
Feature |
Description |
Interface |
Sets up physical interfaces for speed and duplex. Interfaces can be enabled or disabled. |
Banner |
Specifies a login or session banner when connecting to the security appliance. |
Boot |
Specifies boot parameters to load proper image. |
Activation key |
Enables or disables security appliance features. |
File management |
Adds or deletes the security context configurations that are stored locally on the security appliance. |
Firewall mode |
Configures single- or multiple-mode firewall in the system execution space. |
Failover |
Sets the failover parameters to accommodate multiple physical security appliances. |
The system execution space configuration resides in the nonvolatile random-access memory (NVRAM) area of the security appliance, while the configurations for security contexts are stored either in local Flash memory or on a network storage server using one of the following protocols:
- TFTP
- FTP
- HTTPS
- HTTP
The system execution space designates one of the security contexts as the admin context, which is responsible for providing network access when the system needs to contact resources. The admin context is discussed next.
Admin Context
The admin context provides connectivity to network resources, as mentioned earlier. The IP addresses on the allocated interfaces can be used for remote management purposes, such as SSH or Telnet. The security appliance also uses the IP addresses to retrieve configurations for other contexts if they are located on a network share. A system administrator with access to the admin context can switch into the other contexts to manage them. The security appliance uses the admin context to send the syslog messages that relate to the system.
The admin context must be created before defining other contexts. Additionally, it must reside on the local disk. A new admin context can be designated at any time by using the admin-context command, which is discussed in the "Configuration of Security Context" section, later in this chapter.
When a Cisco ASA is converted from single mode to multi-mode, the network-related configuration of the single-mode security appliance is saved as the admin context. The security appliance names this context as, admin.
The admin context configuration is similar to a customer context. Aside from its relationship to the system execution space, it can be used as a regular context. However, using it as a regular context is not recommended, because of its significance.
Customer Context
Each customer context acts as a virtual firewall with its own configuration that contains almost all the options that are available in a standalone firewall. Table 9-2 lists the differences between a security appliance running in single mode and an appliance running in multiple mode.
Table 9-2. Contrasting Single- and Multiple-Mode Firewalls
Feature |
Single Mode |
Multiple Mode |
Interface |
All physical interfaces are available for use. |
Only allocated interfaces are available in the contexts. |
File management |
Allows an administrator to copy system images and configurations. |
Restricts a context administrator to manage the context configurations. |
Firewall management |
Allows a system administrator to fully manage the security appliance. |
Allows a context administrator to manage the context. |
Addressing scheme |
Does not allow overlapping networks. |
Allows overlapping networks between the contexts. |
Routing protocols |
Supports RIP and OSPF as the dynamic routing protocols. |
Does not allow any dynamic routing protocols. |
Licensing |
There are no security contexts in single mode, hence no license is needed to turn on the security contexts. |
Needs a license to activate more than two security contexts. The default license includes two customer security contexts and an admin context. |
Resource allocation |
The security appliance uses all the available resources. |
The security appliance shares the system resources between the contexts. |
Failover |
Does not allow Active/Active failover. |
Allows Active/Active failover for redundancy and load-balancing. |
Quality of service |
Supports QoS. |
Does not support QoS. |
Multicast |
Supports multicast using PIM-SM. |
Does not support multicast. |
VPN |
Supports remote access and site-to-site VPN tunnels. |
Does not support VPNs. |
The number of customer contexts depends on the installed activation key. To find out how many customer contexts are allowed on a security appliance, look at the security context information in show version, as shown in Example 9-1. In this example, the ASA can have up to five customer contexts.
Example 9-1. Verifying the Number of Security Contexts
Chicago# show version | include Security Contexts Security Contexts : 5
Packet Flow in Multiple Mode
When the packets traverse through the security appliance in multiple mode, they are classified and forwarded to the right context. The packets are then processed based on the configured security policies on a context. The packet classification and the forwarding mechanism are discussed in the following subsections.
Packet Classification
In multiple mode, the security appliance must classify the packets to find out which context should operate on them. The packet classification is done at the ingress interface point that tags the packets using the source IP address, source port, destination IP address, destination port, and the interface or VLAN. The packet is processed based on the security policies configured in that context. Cisco ASA uses the following fields or packet identifiers to classify them properly:
-
Source interface— If all the contexts in the Cisco ASA use unique interfaces, the packet classification becomes easier because the security appliance classifies these packets based on the source interface. As illustrated in Figure 9-2, when the packet is sourced from 192.168.10.10, the classifier assigns the packet to context CustA because the packet originated from G0/0, which is a part of the CustA security context.
Figure 9-2 Packet Classification Using Source Interface
- Destination IP address— The security appliance allows you to share one or more interfaces between the security contexts. In this deployment model, the shared interface uses the same network space with unique IP addresses on the end hosts. If the security appliance is configured to use a shared ingress interface, then it uses the destination IP address to further clarify which of the security contexts using the shared interface should receive the packets. In this case, the security contexts within the Cisco ASA cannot use overlapping IP addresses, and therefore all destination IP addresses must be unique.
Packet Forwarding Between Contexts
In multiple mode, the two contexts communicate with each other as if two standalone appliances were communicating with one another. The security contexts can talk to each other in two ways:
- Without a shared interface
- With a shared interface
Depending on what mode you use, the packet flow is different, as discussed in the following subsections.
Forwarding Without a Shared Interface
As Figure 9-3 illustrates, SecureMe's ASA has four interfaces: two of them belong to the CustA context and the remaining two are allocated to CustB. The outside interface of both contexts is connected to Router1, which is responsible for routing packets from one context to another.
Figure 9-3 Security Contexts Without a Shared Interface
If NAT and packet filtering are set up on the security appliance, then the following sequence of events takes place when Host A sends an ICMP ping packet to Host B:
- Host A sends an ICMP ping packet with a source address of 192.168.10.10 and a destination address of 192.168.20.10. The classifier tags the packet coming in on GigabitEthernet0/0 before sending it to the inside interface of CustA.
- The packet is inspected by the inbound ACL and, if allowed, forwarded to the NAT engine for translation. The NAT engine translates the source address or leaves it unchanged as dictated by the configured policy. Before the security appliance forwards it to Router1, the packet is inspected by the outbound ACL to ensure that it is allowed to leave.
- Router1 checks the destination IP address in the routing table and sends the packet to the G0/2 interface on the security appliance.
- The appliance classifies the packet before sending it to the outside interface of the CustB context, where it is inspected by the inbound ACL. If it is allowed in, the packet passes through the NAT engine to determine if it needs to be translated.
- The security context forwards the packet to Host B after verifying that the outbound ACL on the inside interface does not deny it.
Forwarding with a Shared Interface
Figure 9-4 illustrates another network topology, where SecureMe uses a shared outside LAN interface. To provide Internet connectivity, it has Router1 connected to the same shared interface. Using the shared interfaces, SecureMe can conserve the address space and the allocated interfaces. Additionally, shared contexts are useful when multiple security contexts need access to one public interface to get Internet connectivity.
Figure 9-4 Security Contexts with a Shared Interface
Using the previous example, when Host A sends an ICMP ping packet to Host B, the following steps are taken for successful communication:
- Host A sends an ICMP ping packet with a source address of 192.168.10.10 and a destination address of 209.165.200.231, which can be translated by context CustB to 192.168.20.1. The classifier tags the packet coming in on GigabitEthernet0/0 before sending it to the inside interface of CustA.
- The packet is inspected by the inbound ACL and, if allowed, forwarded to the NAT engine for translation. The NAT engine translates the source address or leaves it unchanged as dictated by the configured policy. The packet is then inspected by the outbound ACL to ensure that it is allowed to leave.
- The packet passes through the context classifier, which looks at the destination IP address and forwards it to the outside interface of the CustB security context because 209.165.200.231 is owned by CustB.
- The security context of CustB applies security policies after receiving the packet on the outside interface. The packet enters CustB's security context, where it is inspected by the inbound ACL. If it is allowed in, the NAT engine translates the destination address to 192.168.20.10.
- The security context forwards the packet to Host B after verifying that the outbound ACL on the inside interface does not deny it.