Course contents

Unit 6: Advanced securityLesson 6.6 (3 of 11 in this unit)5 of 25 in the Advanced Cisco SD-WAN course

Application-aware enterprise firewall (zone-based)

Security zones, zone pairs and rules in the SD-WAN firewall: inspect, pass and drop, matching on applications, logging, and the default behaviour between zones.

Advanced · 14 min read

You'll learn to build a zone and zone-pair design for guest and corporate traffic, choose between inspect, pass and drop, explain why application rules need classification first, and read the firewall counters.

Technical definition

Zone-based firewall is a stateful firewall in which interfaces or VPNs are placed into security zones, and rules are written for traffic going from one zone to another. In Cisco SD-WAN the zones contain service VPNs, and the rules can match on addresses, ports, protocols and applications.

Guests next to the corporate LAN

BR-02 has a corporate LAN in VPN 10 (10.10.2.0/24 in this example) and a guest network in VPN 30 (10.30.1.0/24). Both reach the internet through the same router. The routing is already separate. What is missing is a statement of what each side may do: guests may browse, corporate users may browse and reach the data centre, and nothing from the internet should start a connection into either. A firewall policy writes that down and enforces it. The VPN numbers and prefixes are examples from the lab, and the same ideas apply with any numbering.

Zones and zone pairs

A security zone is a named group of one or more service VPNs. A VPN can be in one zone. A zone pair joins a source zone to a destination zone and carries the rules for that one direction. GUEST to INTERNET is one zone pair, and INTERNET to GUEST is a different one.

  • Traffic between VPNs inside one zone is normally allowed without a rule.
  • Traffic between different zones is denied unless a zone pair has a rule that allows it.
  • With no zone pair for a direction, the traffic in that direction is dropped. Check your release for the exact treatment, particularly for VPNs that you did not put in any zone.

The deny between zones is the point. It means a forgotten rule fails safe, and it also means a missing return-direction pair is the first thing to look for when a pass rule seems to break an application.

Zones and zone pairs on BR-01
Zones and zone pairs on BR-01Service VPNs are grouped into zones: Guest for VPN 30, Corporate for VPN 10 and Internet for the transport side. A zone pair names a direction, such as guest to internet, and carries a policy. Guest to internet is inspected. Guest to corporate is dropped. Corporate to internet is inspected. Traffic with no zone pair is blocked between zones by default.Guest zoneVPN 30Corporate zoneVPN 10Internet zonetransport sideGuest to Internet: inspectGuest to Corporate: dropCorporate to Internet: inspectEach arrow is a zone pair with one direction and one policy: inspect, pass or drop.

On small screens, swipe sideways or focus the diagram and use the arrow keys.

The policy applies per direction. Check the counters on the zone pair when something does not pass; a drop shows up there before it shows up anywhere else.

The policy as a table

The Manager builds this with lists and a policy editor, and the CLI it produces is long. The structure is easier to see as a table. This is an outline for the BR-02 example, not exact configuration.

The policy as a table
The policy as a tableZone; Contains. CORP: Service VPN 10 GUEST: Service VPN 30 INTERNET: The internet-facing side. Often represented by the VPN 0 transport or a service VPN with a NAT interface, depending on how the branch reaches the internet. Check your release.ZoneContainsCORPService VPN 10GUESTService VPN 30INTERNETThe internet-facing side. Often represented by the VPN 0 transport or aservice VPN with a NAT interface, depending on how the branch reaches theinternet. Check your release.

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Each item on the left, with what it means on the right.
The policy as a table
The policy as a tableZone pair; Rule (in order); Match; Action. GUEST to INTERNET: 1 Web: TCP 80 and 443, DNS Inspect : 2 Everything else Drop, with logging GUEST to CORP: No rules The pair is absent or has only a drop Drop CORP to INTERNET: 1 Blocked applications, if any Drop, with logging : 2 Everything else Inspect INTERNET to CORP / GUEST: No rules Not needed: replies to inspected flows return automatically DropZone pairRule (in order)MatchActionGUEST to INTERNET1Web: TCP 80 and 443, DNSInspect2Everything elseDrop, with loggingGUEST to CORPNo rulesThe pair is absent or hasonly a dropDropCORP to INTERNET1Blocked applications, ifanyDrop, with logging2Everything elseInspectINTERNET to CORP /GUESTNo rulesNot needed: replies toinspected flows returnautomaticallyDrop

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Read each row across: the left box names the item, the others describe it.

Every rule has the same parts: what to match (source and destination addresses, protocols and ports, applications or application families), what to do, and whether to log. A zone pair also has a default action for traffic that matches none of its rules. Rules are read from the top and the first match wins, so a broad rule placed above a narrow one hides it.

Inspect, pass and drop

Inspect, pass and drop
Inspect, pass and dropAction; Behaviour; Use it for. Inspect: Stateful. A session entry is created, and return traffic is allowed automatically Normal TCP and UDP flows that one side starts Pass: Stateless. The matching packets are allowed one way; replies need their own rule in the other zone pair Traffic that cannot be tracked as a session, or that is intentionally one-way Drop: The packets are discarded; logging is optional Blocking, and the end of a rule setActionBehaviourUse it forInspectStateful. A session entry is created,and return traffic is allowedautomaticallyNormal TCP and UDP flows that oneside startsPassStateless. The matching packets areallowed one way; replies need theirown rule in the other zone pairTraffic that cannot be tracked as asession, or that is intentionallyone-wayDropThe packets are discarded; logging isoptionalBlocking, and the end of a rule set

On small screens, swipe sideways or focus the diagram and use the arrow keys.

Read each row across: the left box names the item, the others describe it.

Inspect is usually the right choice because it needs one rule instead of two and it refuses replies that no session started. Pass is the exception, and its common fault is a rule in one direction with nothing in the other. The application works in one direction only, which looks like an application fault.

Why does a pass rule need a rule for the return traffic?

Pass keeps no state. When the reply arrives, the firewall sees a new packet from INTERNET to CORP and looks for a rule for that zone pair. If there is none, the packet is dropped, even though a pass rule allowed the request. With inspect, the reply is recognised as part of a session and is let through without a second rule.

Matching on applications

An application rule can say, for example, drop a given streaming application from GUEST. The router can do this because of its application recognition engine, which classifies flows by looking at the first packets and at details such as the name in an HTTPS handshake. Two limits follow.

  • Classification takes a few packets. Until it finishes, a flow has no application and matches only rules based on addresses and ports, or the default action.
  • Some traffic is hard to classify, especially when it is encrypted and its server name is hidden. A flow that stays unidentified is handled by the later rules or the default.

Put address and port rules where precision matters, and use application rules for the policy you want to express in business terms. Test with real applications before relying on one.

The router itself and the underlay

Traffic sent to or from the router, such as management sessions, is not ordinary transit traffic. Cisco SD-WAN has a special self zone for the router itself, and the transport side (VPN 0, the global or underlay side) has its own treatment. Whether a zone pair is needed to reach the router, how the default applies, and which interfaces count as which zone differ between releases. Read your release's firewall guide on these two points before you protect a management interface with this feature, and test from both sides.

Checking the counters

Example output written for this lesson, simplified; real output has more fields and a different layout
BR-02#show sdwan zbfw zonepair-statistics
ZONE PAIR            SRC ZONE  DST ZONE  RULE/CLASS     ACTION   PACKETS  BYTES
GUEST-TO-INTERNET    GUEST     INTERNET  WEB            inspect  48210    39120344
GUEST-TO-INTERNET    GUEST     INTERNET  class-default  drop     133      9210
CORP-TO-INTERNET     CORP      INTERNET  class-default  inspect  120934   98211876
GUEST-TO-CORP        GUEST     CORP      class-default  drop     57       3420
Traffic is matching the intended rules: web traffic from guests is inspected, the catch-all drops other guest traffic, and 57 packets from guests to the corporate zone were refused. A rule with zero counters when traffic is expected points to the wrong VPN, the wrong direction or a rule above it that matches first.
Example output written for this lesson, simplified; real output has more fields and a different layout
BR-02#show sdwan zbfw drop-statistics
REASON                          PACKETS
no zone-pair                    12
policy drop (class-default)     190
return traffic without session  4
The reasons separate a missing zone pair from a rule that dropped the traffic. Non-zero "no zone-pair" means traffic crossed between zones that have no pair at all, which is the first thing to fix. The exact counter names and layout vary by release, so treat these two commands and their fields as a guide and check them on your router.

Where the firewall misbehaves

  • One-way pass rule. The request leaves and the reply is dropped for want of a return pair. Use inspect, or add the return rule.
  • VPN in no zone. The rules do not apply to it, or it is treated differently from a zoned VPN. Confirm every service VPN you care about is in a zone.
  • Rule order. A broad inspect above a block rule means the block is not reached. Read the rules from the top.
  • Application not yet identified. The first packets did not match the application rule. A rule that depends on an application also needs a sensible default for unclassified traffic.
  • Policy not attached. The policy exists in the Manager but is not part of the device template, so the counters stay empty.

The next layer up, IPS, usually runs because a firewall rule passes traffic to it.

Test yourself on the firewall

Predict · scenario 1

VPN 30 (GUEST) and VPN 10 (CORP) are in different zones and no zone pair exists between them. A guest tries to reach a server in VPN 10. What happens?

Predict · scenario 2

A rule in the CORP to INTERNET pair uses action pass for TCP 443. Users can send requests but pages do not load. What is the most likely fix?

Predict · scenario 3

A rule drops a streaming application for the GUEST zone, but the first few seconds of each stream still get through. Why?

Predict · scenario 4

Drop statistics show a steady count of packets dropped for 'no zone-pair' after you added a new service VPN for a card reader network. What is the best interpretation?

FAQ

What is the difference between inspect and pass?
Inspect is stateful. The firewall remembers the flow and allows the return traffic automatically. Pass is stateless, like a permit in an access list: it allows the packets in that direction only, and you must allow the replies separately. For ordinary TCP and UDP flows, inspect is normally the right action.
Can the firewall match on applications such as a video service?
Yes, through application recognition. The router first has to classify the flow, and that takes a few packets, so the first packets may not yet match an application rule. Design the rules and the default action with that in mind.
Does traffic between two VPNs in the same zone need a rule?
Traffic inside one zone is normally allowed without a rule. That is why putting VPNs in one zone is a statement that they trust each other. Whether two VPNs can reach each other at all is still decided by routing.