Monitor Policy Rule Usage

How to view rule usage for policy rules pushed to a device group from Panorama.
As your policies change over time, tracking rule usage on Panorama helps you evaluate whether your policy implementation continues to match your enforcement needs. This visibility helps you identify and remove unused rules to reduce security risks and keep your policy rule base organized. Additionally, rule usage tracking allows you to quickly validate new rule additions and rule changes and to monitor rule usage for operations and troubleshooting tasks. On Panorama, you can view the rule usage of firewalls in a device group—to which you pushed policies—to determine if all, some, or none of the firewalls have traffic matches instead of only being able to monitor the total number of hits across all firewalls in a device group. You can quickly filter rules using the rule usage data, such as the Created and Modified dates, within a customizable timeframe. Rule usage information displayed persists through reboot, dataplane restarts and upgrades.
On Panorama, you can view the rule usage details for managed firewalls which are running PAN-OS 8.1 or later release, have policy rule hit count enabled (it is by default), and to which you have defined and pushed policy rules using device groups. Panorama cannot retrieve rule usage details for policy rules configured locally on the firewall, so you must log in to the firewall to view rule usage information for locally configured rules.
Policy rule usage data may also be useful when using Policy Optimizer to prioritize which rules to migrate or clean up first.
To view the rule usage across any Shared rule or for a specific device group:
  1. Log in to the Panorama Web Interface.
  2. Verify that the Policy Rule Hit Count is enabled.
    1. Select PanoramaSetup Management and navigate to Policy Rulebase Settings.
    2. Verify that Policy Rule Hit Count is enabled.
    verify-policy-rule-hit-count-enabled.png
  3. Select Policies<policy rule> to view a rule.
  4. Change the Device Group context to Shared or to the specific device group you want to view.
  5. Determine whether the rule is being used (Rule Usage column). The policy rule usage status is one of the following:
    Firewalls must run PAN-OS 8.1 or later release with Policy Rule Hit Count enabled for Panorama to determine rule usage.
    • Used—When all firewalls in the device group—to which you pushed the policy rule—have traffic matches for the policy rule.
    • Partially Used—When some of the firewalls in the device group—to which you pushed the policy rule—have traffic matches for the policy rule.
    • Unused—When no firewalls in the device group—to which you pushed the policy rule—have traffic matches for the policy rule.
    • Em-dash (—)—When no firewalls in the device group—to which you pushed the policy rule—have Policy Rule Hit Count enabled or available for Panorama to determine the rule usage.
    • Modified—The date and time the policy rule was last modified.
    • Created—The date and time the policy rule was created.
      If the rule was created when Panorama was running PAN-OS 8.1 and the Policy Rule Hit Count setting is enabled, the First Hit date and time is used as the Created date and time on upgrade to PAN-OS 9.0. If the rule was created in PAN-OS 8.1 when the Policy Rule Hit Count setting is disabled, or if the rule was created when Panorama was running PAN-OS 8.0 or earlier release, the date and time Panorama was successfully upgraded to PAN-OS 9.0 is used as the Created date.
    panorama-rule-usage.png
  6. Click the status in the Rule Usage column to view the list of firewalls using the rule and the hit-count data for traffic that matches that rule on each firewall.
    view-device-hit-count-panorama.png
  7. (Optional) View the policy rule hit-count data for individual appliances in the device group.
    1. Click Preview Rules.
    2. From the Device context, select the appliance for which you want to view the policy rule usage data.
      preview-rules-policy-rule-hit-count-data.png
  8. Select Policies, and in the Policy Optimizer window click Rule Usage to view the rule usage filter.
  9. Filter rules in the selected rulebase.
    You can filter the rule usage for rules pushed to firewalls from Panorama. Panorama cannot filter rule usage for rules configured locally on the firewall.
    Use the rule usage filter to evaluate the rule usage within a specified period of time. For example, filter the selected rulebase for Unused rules within the last 30 days. Additionally, you can also evaluate rule usage with other rule attributes, such as the Created and Modified dates, giving you the flexibility to filter for the correct set of rules to review. You can use this data to help manage your rule lifecycle and determine if a rule needs to be removed in order to reduce your network attack surface.
    1. Select the Timeframe you want to filter from the drop-down, or specify a Custom timeframe.
    2. Select the rule Usage to filter.
    3. (Optional) If you have reset the rule usage data for any rules, check the Exclude rules reset during the last <number of days> days, and within how many days the rules were reset in order to be excluded. Rules that were reset before the specified number of days are included in the filtered results.
      rule-usage-filter-panorama.png
    4. (Optional) Specify search filters based on additional rule data, other than the rule usage.
      1. Hover your mouse over the column header, and from the drop-down select Columns.
      2. Add any additional columns you want to filter with or to display.
        rule-usage-filter-add-columns.png
      3. Hover your mouse over the column data that you would like to filter, and select Filter from the drop-down. For data that contain dates, select whether to filter using This date, This date or earlier, or This date or later.
      4. Click Apply Filter ( green-arrow.png ).
        rule-usage-filter-additional-filter-panorama.png

Related Documentation