Skip to main content

PAN-OS - Identify Unused Policy Rules

This Playbook is part of the PAN-OS by Palo Alto Networks Pack.#

Supported versions

Supported Cortex XSOAR versions: 6.10.0 and later.

The playbook collects and analyzes Palo Alto Networks NGFW policy rule hitcount information and generates a summary of unused rules for potential clean-up. Policy rules are classified into three categories:

  1. Unused Local Rules - Rules configured locally on firewalls.
  2. Unused Panorama Rules - Rules pushed to one or more firewalls from Panorama that have zero hits on all firewalls.
  3. Used Panorama Rules - Rules pushed to one or more firewalls from Panorama that have hits on some firewalls but not all. i. These rules may be pushed to firewalls where they are not needed and should be considered for clean-up.

For firewalls in HA pairs, rules are only considered unused if all members of the HA group have zero hits for it.

Dependencies#

This playbook uses the following sub-playbooks, integrations, and scripts.

Sub-playbooks#

This playbook does not use any sub-playbooks.

Integrations#

  • Panorama

Scripts#

  • PAN-OS-AnalyzeRuleHitCounts
  • PrintErrorEntry

Commands#

  • pan-os-get-rule-hitcounts
  • pan-os-platform-get-ha-state
  • pan-os-platform-get-system-info

Playbook Inputs#


NameDescriptionDefault ValueRequired
RulebaseThe firewall rulebase to analyze. Must be one of the following:
security, nat, decryption, application-override, authentication, dos, network-packet-broker, pbf, qos, sdwan, security, tunnel-inspect.
securityRequired

Playbook Outputs#


PathDescriptionType
PANOS.UnusedRules.TotalLocalRulesAnalyzedThe total number of local rules analyzed.Number
PANOS.UnusedRules.TotalPanoramaRulesAnalyzedThe total number of analyzed rules pushed from Panorama.Number
PANOS.UnusedRules.UnusedLocalRulesList of Unused Local Rules.unknown
PANOS.UnusedRules.UnusedLocalRules.activeHAPeerIf the firewall where this rule data comes from is in an HA pair, contains the Host ID of the active device in the pair.Unknown
PANOS.UnusedRules.UnusedLocalRules.hostidHost ID of the firewall where the rule is configured.String
PANOS.UnusedRules.UnusedLocalRules.hostnameHostname of the firewall where this rule is configured.String
PANOS.UnusedRules.UnusedLocalRules.vsysThe virtual system (VSYS) where the rule is configured.String
PANOS.UnusedRules.UnusedLocalRules.instanceNameName of the PAN-OS Integration Instance used to collect rule hitcount data.String
PANOS.UnusedRules.UnusedLocalRules.nameThe name of the rule.String
PANOS.UnusedRules.UnusedLocalRules.positionThe position of the rule within the Panorama device-group rulebase (pre-rulebase or post-rulebase).String
PANOS.UnusedRules.UnusedLocalRules.rulebaseThe rulebase where the rule is configured (e.g. "Security", "NAT", etc).String
PANOS.UnusedRules.UnusedPanoramaRulesList of Unused Rules Pushed from Panorama.unknown
PANOS.UnusedRules.UnusedPanoramaRules.from_dg_nameThe rulebase where the rule is configured (e.g. "Security", "NAT", etc).String
PANOS.UnusedRules.UnusedPanoramaRules.instanceNameName of the PAN-OS Integration Instance used to collect rule hitcount data.String
PANOS.UnusedRules.UnusedPanoramaRules.nameThe name of the rule.String
PANOS.UnusedRules.UnusedPanoramaRules.positionThe position of the rule within the Panorama device-group rulebase (pre-rulebase or post-rulebase).String
PANOS.UnusedRules.UnusedPanoramaRules.rulebaseThe rulebase where the rule is configured (e.g. "Security", "NAT", etc).String
PANOS.UnusedRules.UsedPanoramaRulesList of Rules Pushed from Panorama that are used on some firewalls but not all.unknown
PANOS.UnusedRules.UsedPanoramaRules.from_dg_nameName of the Device Group the rule is inherited from.String
PANOS.UnusedRules.UsedPanoramaRules.hostids_with_hitsHost IDs of firewalls where this rule has hits.String
PANOS.UnusedRules.UsedPanoramaRules.hostnames_with_hitsHostnames of firewalls where this rule has hits.String
PANOS.UnusedRules.UsedPanoramaRules.hostids_with_zero_hitsHost IDs of firewalls where this rule has zero hits.Unknown
PANOS.UnusedRules.UsedPanoramaRules.hostnames_with_zero_hitsHostnames of firewalls where this rule has zero hits.Unknown
PANOS.UnusedRules.UsedPanoramaRules.instanceNameName of the PAN-OS Integration Instance used to collect rule hitcount data.String
PANOS.UnusedRules.UsedPanoramaRules.nameThe name of the rule.String
PANOS.UnusedRules.UsedPanoramaRules.positionThe position of the rule within the Panorama device-group rulebase (pre-rulebase or post-rulebase).String
PANOS.UnusedRules.UsedPanoramaRules.rulebaseThe rulebase where the rule is configured (e.g. "Security", "NAT", etc).String

Playbook Image#


PAN-OS - Identify Unused Policy Rules