<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Bash application to find and fix conflicting rules in a SMS in Scripts</title>
    <link>https://community.checkpoint.com/t5/Scripts/Bash-application-to-find-and-fix-conflicting-rules-in-a-SMS/m-p/275493#M1544</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sharing my solution for the issue where trying to install a huge policy with more then 13 conflicting rules and getting:&lt;BR /&gt;&lt;SPAN data-teams="true"&gt;{&lt;BR /&gt;&amp;nbsp; "tasks" : [ {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "task-id" : "0123....",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "task-name" : "Verify policy operation",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "status" : "failed",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "progress-percentage" : 100,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "suppressed" : false,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "task-details" : [ {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "workSession" : "34e7.....",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "title" : "Verification of policy 'K....' completed with errors",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "notifications" : [ ],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "warnings" : [ ],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "errors" : [ "Error: Layer ......."&amp;nbsp;&amp;nbsp;&amp;nbsp; Too many errors." ]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } ]&lt;BR /&gt;&amp;nbsp; } ]&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;Documentation:&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;# =============================================================================&lt;BR /&gt;# Check Point Rulebase Overlap &amp;amp; Validation Fixer&lt;BR /&gt;# Version: 2.0&lt;BR /&gt;#&lt;BR /&gt;# Identifies and optionally disables:&lt;BR /&gt;# 1. Rules failing policy verification (via verify-policy API)&lt;BR /&gt;# 2. Exact duplicate rules (same source/dest/service/action)&lt;BR /&gt;# 3. Conflicting rules (overlapping traffic, opposite terminal actions)&lt;BR /&gt;# 4. Shadowed rules (entirely covered by a preceding Any/Any/Any rule)&lt;BR /&gt;# 5. Rules with empty source/destination/service&lt;BR /&gt;#&lt;BR /&gt;# MODES:&lt;BR /&gt;# Default (dry-run) : Analyse and report only — no changes made&lt;BR /&gt;# --disable : Disable flagged rules and publish the session&lt;BR /&gt;#&lt;BR /&gt;# USAGE:&lt;BR /&gt;# ./rulebase_cleanup.sh [OPTIONS]&lt;BR /&gt;#&lt;BR /&gt;# OPTIONS:&lt;BR /&gt;# -H, --host HOST Management server IP/hostname (default: 127.0.0.1)&lt;BR /&gt;# -u, --user USER API username (default: admin)&lt;BR /&gt;# -p, --pass PASS API password (prompted if omitted)&lt;BR /&gt;# -r, --root Use local root credentials, no user/pass needed&lt;BR /&gt;# -P, --policy NAME Policy package name (default: Standard)&lt;BR /&gt;# -l, --layer NAME Access layer name (default: Network)&lt;BR /&gt;# --disable Actually disable flagged rules (default: dry-run)&lt;BR /&gt;# --skip-verify Skip the verify-policy API call (faster re-runs)&lt;BR /&gt;# --rules-file FILE Use an existing rules_raw.json (skip fetch)&lt;BR /&gt;# -h, --help Show this help&lt;BR /&gt;#&lt;BR /&gt;# REQUIREMENTS:&lt;BR /&gt;# - Run on the Check Point Management Server (SMS)&lt;BR /&gt;# - mgmt_cli must be in PATH&lt;BR /&gt;# - jq must be installed (yum install jq)&lt;BR /&gt;# - Python 3&lt;BR /&gt;#&lt;BR /&gt;# OUTPUT FILES (written to ./cp_cleanup_&amp;lt;timestamp&amp;gt;/):&lt;BR /&gt;# rules_raw.json All rules fetched from the API&lt;BR /&gt;# validation_errors.json verify-policy raw output&lt;BR /&gt;# validation_issues.json Parsed conflict/warning list from verify-policy&lt;BR /&gt;# overlap_analysis.json Duplicates, conflicts, shadows from analysis&lt;BR /&gt;# all_issues.json Merged, deduplicated findings&lt;BR /&gt;# flagged_rules.txt UIDs to disable&lt;BR /&gt;# cleanup_report.txt Human-readable summary&lt;BR /&gt;# =============================================================================&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 11 May 2026 08:25:29 GMT</pubDate>
    <dc:creator>tomshw</dc:creator>
    <dc:date>2026-05-11T08:25:29Z</dc:date>
    <item>
      <title>Bash application to find and fix conflicting rules in a SMS</title>
      <link>https://community.checkpoint.com/t5/Scripts/Bash-application-to-find-and-fix-conflicting-rules-in-a-SMS/m-p/275493#M1544</link>
      <description>2</description>
      <pubDate>Mon, 11 May 2026 08:25:29 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Scripts/Bash-application-to-find-and-fix-conflicting-rules-in-a-SMS/m-p/275493#M1544</guid>
      <dc:creator>tomshw</dc:creator>
      <dc:date>2026-05-11T08:25:29Z</dc:date>
    </item>
  </channel>
</rss>

