: Monitor Policy Rule Usage
Focus
Focus

Monitor Policy Rule Usage

Table of Contents

Monitor Policy Rule Usage

How to view rule usage for policy rules pushed to a device group from Panorama.
As your policies change, 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 being able to monitor only the total number of hits across all firewalls in a device group. You can quickly filter rules using the rule usage data, such as Created and Modified dates, within a customizable time frame. The displayed rule usage information persists across reboot, dataplane restarts, and upgrades.
On Panorama, you can view the rule usage details for managed firewalls that are running a PAN-OS 8.1 or later release, that have policy rule hit count enabled (default), and for 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.
After filtering your policy rulebase, administrators can take action to delete, disable, enable, and tag policy rules directly from the policy optimizer. For example, you can filter for unused rules and then tag them for review to determine whether they can be safely deleted or kept in the rulebase. By enabling administrators to take action directly from the policy optimizer, you reduce the management overhead required to further assist in simplifying your rule lifecycle management and ensure that your firewalls are not over-provisioned.
Policy rule usage data may also be useful when using Policy Optimizer to prioritize which rules to migrate or clean up first.
Policy rule usage data is not preserved when you transition to a different Panorama model. This means that all existing policy rule usage data from the old Panorama is no longer displayed after a successful migration to a new Panorama model. After a successful migration, Panorama begins tracking policy rule usage data based on the date the migration was completed. For example, the
Created
date displays the date the migration was completed.
To view the rule usage across any Shared rule or for a specific device group:
  1. Verify that the
    Policy Rule Hit Count
    is enabled.
    1. Navigate to Policy Rulebase Settings (
      Panorama
      Setup
      Management
      .
    2. Verify that
      Policy Rule Hit Count
      is enabled.
  2. Select
    Policies
    <policy rule>
    to view a rule.
  3. Change the Device Group context to
    Shared
    or to the specific device group you want to view.
  4. Determine whether the rule is being used (Rule Usage). 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 or later releases. If the rule was created in PAN-OS 8.1 when the Policy Rule Hit Count setting was disabled or if the rule was created when Panorama was running PAN-OS 8.0 or an earlier release, the Created date for the rule will be the date and time you successfully upgraded Panorama to PAN-OS 9.0 or later releases.
  5. Click the Rule Usage status to view the list of firewalls using the rule and the hit-count data for traffic that matches that rule on each firewall.
  6. (
    Optional
    ) View the policy rule hit-count data for individual firewalls in the device group.
    1. Click
      Preview Rules
      .
    2. From the Device context, select the firewall for which you want to view the policy rule usage data.
  7. Select
    Policies
    and, in the Policy Optimizer dialog, view the
    Rule Usage
    filter.
  8. 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. You can also evaluate rule usage with other rule attributes, such as the Created and Modified dates, which enables you to filter for the correct set of rules to review. You can use this data to help manage your rule lifecycle and to determine if a rule needs to be removed to reduce your network attack surface.
    1. Select the
      Timeframe
      you want to filter on, or specify a
      Custom
      time frame.
    2. Select the rule
      Usage
      on which you want to filter.
    3. (
      Optional
      ) If you have reset the rule usage data for any rules, check for
      Exclude rules reset during the last
      <number of days>
      days
      and decide when to exclude a rule based on the number of days you specify since the rule was reset. Only rules that were reset before your specified number of days are included in the filtered results.
    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.
      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
        ( ).
  9. Take action on one or more unused policy rules.
    1. Select one or more unused policy rules.
    2. Perform one of the following actions:
      • Delete
        —Delete one or more selected policy rules.
      • Enable
        —Enable one or more selected policy rules when disabled.
      • Disable
        —Disable one or more selected policy rules.
      • Tag
        —Apply one or more group tags to one or more selected policy rules. The group tag must already exist in order to tag policy rule.
      • Untag
        —Remove one or more group tags from one or more selected policy rules.
    3. Select
      Commit
      and
      Commit and Push
      your changes.

Recommended For You