PermitANY
Palo AltoConfig1,234 downloads

Palo Alto Security Zones & Policies

Zone-based security policy configuration for Palo Alto firewalls: zones, Layer 3 interfaces, address objects, and security rules with App-ID and User-ID.

↓ example.txt

What is it?

Security zones are the foundation of Palo Alto's firewall model. A zone is a group of interfaces that share one trust level, and the relationship is one-way: a zone can hold many interfaces, but an interface belongs to exactly ONE zone. That single rule is what makes segmentation mean anything — if the same interface sat in both 'trust' and 'dmz', no zone pair would describe real traffic. All security policy decisions are based on zone pairs (from-zone → to-zone). Unlike Cisco ASA's security levels, PAN-OS uses App-ID — rules match on specific applications (web-browsing, ssl, office365) rather than just ports. Traffic between zones is denied by default — nothing flows until you create an explicit 'allow' rule. User-ID integration maps IP addresses to Active Directory usernames, enabling user-based policies like 'allow engineers to access GitHub but deny contractors'.

When to use

  • ·Defining the firewall's data plane — every deployment needs zones before policies work
  • ·Segmenting traffic: trust (internal LAN), untrust (internet), DMZ (servers), guest-wifi
  • ·Enabling App-ID inspection — replace port-based 'allow TCP/443' with application-aware 'allow ssl + web-browsing'
  • ·Applying security profiles (Threat Prevention, URL Filtering, File Blocking) via profile groups on security rules

When NOT to use

  • ·Virtual Wire mode (transparent deployment) doesn't use Layer 3 zones — use 'virtual-wire' zone type instead
  • ·TAP mode (passive monitoring) uses TAP zones — no traffic filtering, just inspection
  • ·This generator assigns every interface with 'set ... zone <zone> network layer3 <interface>'. A layer2, virtual-wire or TAP zone takes its members with 'network layer2', 'network virtual-wire' or 'network tap' instead, so leave the Zone field blank on those interfaces and add them by hand
  • ·Do not reach for zones to separate hosts inside one subnet — zones are enforced between interfaces, so two hosts on the same Layer 3 interface never cross the firewall. That is an intra-zone problem and needs private VLANs, microsegmentation or a separate interface

How it compares

vs Cisco ASA ACLASA uses port-based ACLs (permit tcp any host 10.0.0.1 eq 443). Palo Alto uses App-ID — 'allow application ssl' matches HTTPS regardless of port. App-ID is more secure because apps can't evade detection by using non-standard ports.
vs Fortinet FortiGate policiesSimilar zone-based model. FortiGate uses 'interfaces' as the policy selector, Palo Alto uses 'zones' (multiple interfaces can share a zone). Both support App-ID equivalent (FortiGate calls it Application Control).
vs Cisco IOS ACLIOS ACLs are stateless and port-based. Palo Alto is stateful and application-aware. For internet-facing security, Palo Alto's approach is far superior — it identifies thousands of applications by their actual behavior.

Prerequisites

  • →Interfaces must be defined as Layer 3 type before assigning IPs and zones
  • →Each interface's Zone field must name one of the zones declared above — the zone is created first, then the interface is attached to it. A name that matches nothing creates an empty zone that no policy will ever reference
  • →PAN-OS 8.0 or later for the 'set <vsys> zone' CLI shown here; the syntax is unchanged through 11.x
  • →Virtual router must be configured — all Layer 3 interfaces added to the default virtual router
  • →Address objects should be created before referencing them in security rules
  • →Security profile groups (threat, URL, file) should be configured before referencing in rules

Config Generator

Verification commands

show interface all

Verify all interfaces are up and have correct IPs

ExpectedShows each interface state, IP, zone, and virtual router assignment

show zone

List all zones and the interfaces assigned to each

ExpectedEach zone shows its type (layer3, layer2) and member interfaces

show running security-policy

Show active security rules in order

ExpectedLists all rules with from-zone, to-zone, application, source, destination, and action

show session all

Show active firewall sessions

ExpectedLists established sessions with source/dest IPs, ports, application, and rule that matched

Debug commands

test security-policy-match source 192.168.1.10 destination 8.8.8.8 destination-port 443 protocol 6 from trust to untrust application ssl

Test which security rule matches specific traffic

Common mistakes & fixes

SymptomTraffic not passing even though rule allows it
CauseRule order issue — a deny rule earlier in the list is matching first, or NAT rule is missing for internet traffic
FixUse 'test security-policy-match' to see which rule matches. Check NAT rules — internet traffic needs source NAT to leave the firewall.
Symptom'show zone' lists the same interface under two zones, or the commit fails with 'interface ethernet1/2 already assigned to zone trust'
CauseAn interface was attached to a second zone. PAN-OS allows exactly one zone per interface, and a half-applied change leaves policy matching on a zone pair that no traffic uses
FixRemove the stale membership with 'delete <vsys> zone <old-zone> network layer3 <interface>', then re-add it to the intended zone. Confirm with 'show zone' that each interface appears once
SymptomA zone exists in 'show zone' but has no member interfaces, and policies referencing it never match
CauseThe zone name on the interface did not match the zone declared above — a typo, or a trailing space. The zone is created empty rather than rejected
FixCompare 'show zone' against 'show interface all' and make the names identical. Zone names in PAN-OS are case-sensitive: 'Trust' and 'trust' are two zones
SymptomApp-ID blocking traffic matched by application 'unknown-tcp'
CauseApp-ID hasn't identified the application yet (needs 3-4 packets), or the application is truly unknown
FixCheck traffic logs to see the application identified after session established. Add 'unknown-tcp' to the allow rule temporarily to test if traffic flows.
SymptomUser-ID not mapping users to IPs in policy logs
CauseUser-ID agent not configured, or Windows Event Log collection not working
FixCheck 'show user ip-user-mapping all' — if empty, User-ID agent is not collecting events. Verify the Windows Security Event Log is accessible.

Further learning

Recommended books to go deeper on this topic.

Palo Alto Networks Firewall Deployment and Administration

Tom Piens · Packt · Security zones are the foundation of PAN-OS — covered in full detail

Related configs