<?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 Re: Verify if a firewall stealth rule exists in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255916#M9188</link>
    <description>&lt;P&gt;Not sure if this may suffice, but seems like a aomewhat okay option to me. I just tried it in the lab.&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;
&lt;P&gt;[Expert@CP-MANAGEMENT:0]# mgmt_cli show access-rulebase name "network" filter "stealth"&lt;BR /&gt;Username: admin&lt;BR /&gt;Password:&lt;BR /&gt;uid: "38271c2f-ab44-4e25-9aa4-e219cb6e12cf"&lt;BR /&gt;name: "network"&lt;BR /&gt;rulebase: []&lt;BR /&gt;total: 0&lt;/P&gt;
&lt;P&gt;[Expert@CP-MANAGEMENT:0]#&lt;/P&gt;</description>
    <pubDate>Mon, 25 Aug 2025 15:20:50 GMT</pubDate>
    <dc:creator>the_rock</dc:creator>
    <dc:date>2025-08-25T15:20:50Z</dc:date>
    <item>
      <title>Verify if a firewall stealth rule exists</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255832#M9179</link>
      <description>&lt;P&gt;I'm working on a firewall audit script and I'm looking for a way to verify if a firewall stealth rule (&lt;EM&gt;Src: Any, Dst: Firewall Gateway, Service: Any, Action: Drop or Reject&lt;/EM&gt;) exists.&lt;/P&gt;
&lt;P&gt;The check should work on:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;on SmartCenter Servers via &lt;CODE&gt;mgmt_cli&lt;/CODE&gt; on all configured security policies&lt;/LI&gt;
&lt;LI&gt;on Firewall Gateways via &lt;CODE&gt;grep&amp;nbsp;&lt;SPAN&gt;$FWDIR/state/local/FW1&lt;/SPAN&gt;&lt;/CODE&gt; as &lt;A href="https://community.checkpoint.com/t5/Management/How-to-check-the-access-list-in-Check-Point-via-CLI/m-p/239949/highlight/true#M41041" target="_self"&gt;db_tool&lt;/A&gt; isn't supported anymore&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Sun, 24 Aug 2025 19:06:12 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255832#M9179</guid>
      <dc:creator>Danny</dc:creator>
      <dc:date>2025-08-24T19:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Verify if a firewall stealth rule exists</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255835#M9180</link>
      <description>&lt;P&gt;Maybe this?&lt;/P&gt;
&lt;P&gt;clish -c "show access-rulebase name &amp;lt;policy-package&amp;gt; details-level full" | grep &amp;lt;gateway_name&amp;gt;&lt;/P&gt;</description>
      <pubDate>Sun, 24 Aug 2025 20:49:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255835#M9180</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2025-08-24T20:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Verify if a firewall stealth rule exists</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255838#M9181</link>
      <description>&lt;P&gt;This gets complicated if you potentially have multiple access layers in a policy package. I guess you could check each access layer one by one to see if at least one has such a rule.&lt;/P&gt;
&lt;P&gt;It would likely be in the first 500, so you can probably get away with only fetching the one page.&lt;/P&gt;
&lt;P&gt;It also gets complicated if you use a different form of stealth rule: an inner layer. Say the outer layer has "Any source to firewall object, send to firewall management layer". As long as the firewall management layer ends in drop or reject, that functions as a stealth rule, though it doesn't obviously look like one at first glance. The advantage of this pattern is you can manage all administrative access to all of your firewalls in the firewall management layer, regardless of which policy package they run. Add a new SNMP client? You just need to stick it into a rule in one place.&lt;/P&gt;
&lt;P&gt;I would probably do something like this:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Get a list of all domains. If this is a SmartCenter rather than an MDS (no domain), treat it like an MDS with only the one domain to scrub.&lt;/LI&gt;
&lt;LI&gt;For each domain, get a list of all policy packages. For each policy package:
&lt;OL&gt;
&lt;LI&gt;Record the policy package's installation targets.&lt;/LI&gt;
&lt;LI&gt;For each access layer in the policy package, get a list of the first 500 rules (&lt;BR /&gt;.rulebase[]|if has("rulebase") then .rulebase[] else . end| ... can help here).
&lt;OL&gt;
&lt;LI&gt;For each installation target, select all the rules with a source of&amp;nbsp;"97aeb369-9aea-11d5-bd16-0090272ccb30" (UUID for Any), a destination of that target, and an action of "Drop", "Reject", or "Inner Layer".&lt;/LI&gt;
&lt;LI&gt;If the action is "Inner Layer", dump the access layer in the rule's "inline-layer" key and check to be sure either the last rule's action is Drop or Reject, or the layer's "implicit-cleanup-action" is "drop".&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;As long as at least one layer in the policy package has at least one matching rule for every installation target, you're good.&lt;/P&gt;
&lt;/LI&gt;
&lt;/OL&gt;
&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Sun, 24 Aug 2025 21:11:04 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255838#M9181</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2025-08-24T21:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Verify if a firewall stealth rule exists</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255856#M9182</link>
      <description>&lt;P&gt;Also, What I often see is we have a stealth rule in the top ten rules, but over time this rule gets pushed down due to inexperienced admins, rushed projects or just because, basically making the drop useless because the packet was accepted above.&lt;/P&gt;
&lt;P&gt;Of course also be aware of implicit rules like remote vpn ports being opened by default on VPN gateways if not unselected.&lt;/P&gt;
&lt;P&gt;Just something to keep in mind, when evaluating the value of the output of a simple grep.&lt;/P&gt;
&lt;P&gt;/Henrik&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 07:13:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255856#M9182</guid>
      <dc:creator>Henrik_Noerr1</dc:creator>
      <dc:date>2025-08-25T07:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Verify if a firewall stealth rule exists</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255890#M9183</link>
      <description>&lt;P&gt;Is there a way to say search for rule where fw is dst itself and action is drop?&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 12:41:05 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255890#M9183</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2025-08-25T12:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Verify if a firewall stealth rule exists</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255908#M9184</link>
      <description>&lt;P&gt;Yes, but that doesn't tell you if the policy runs on the firewall in the destination of the rule. That's the difficult part.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 14:20:32 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255908#M9184</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2025-08-25T14:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Verify if a firewall stealth rule exists</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255909#M9185</link>
      <description>&lt;P&gt;Would you mind put the command? I would still like to test it in the lab.&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 14:31:41 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255909#M9185</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2025-08-25T14:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Verify if a firewall stealth rule exists</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255910#M9186</link>
      <description>&lt;P&gt;I haven't written one. It would be a non-trivial amount of work, and isn't adjacent to anything I'm currently doing, so I can't really spend the time.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 14:50:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255910#M9186</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2025-08-25T14:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Verify if a firewall stealth rule exists</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255911#M9187</link>
      <description>&lt;P&gt;K, no worries, let me play around with it in the lab, see how far I get.&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 14:52:14 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255911#M9187</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2025-08-25T14:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: Verify if a firewall stealth rule exists</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255916#M9188</link>
      <description>&lt;P&gt;Not sure if this may suffice, but seems like a aomewhat okay option to me. I just tried it in the lab.&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;
&lt;P&gt;[Expert@CP-MANAGEMENT:0]# mgmt_cli show access-rulebase name "network" filter "stealth"&lt;BR /&gt;Username: admin&lt;BR /&gt;Password:&lt;BR /&gt;uid: "38271c2f-ab44-4e25-9aa4-e219cb6e12cf"&lt;BR /&gt;name: "network"&lt;BR /&gt;rulebase: []&lt;BR /&gt;total: 0&lt;/P&gt;
&lt;P&gt;[Expert@CP-MANAGEMENT:0]#&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 15:20:50 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255916#M9188</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2025-08-25T15:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Verify if a firewall stealth rule exists</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255917#M9189</link>
      <description>&lt;P&gt;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/687"&gt;@Danny&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AFTER creating stealth rule. I just named it stealth rule.&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;
&lt;P&gt;**********************************&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[Expert@CP-MANAGEMENT:0]# mgmt_cli show access-rulebase name "network" filter "stealth"&lt;BR /&gt;Username: admin&lt;BR /&gt;Password:&lt;BR /&gt;uid: "38271c2f-ab44-4e25-9aa4-e219cb6e12cf"&lt;BR /&gt;name: "network"&lt;BR /&gt;rulebase:&lt;BR /&gt;- uid: "1061f0d8-516f-4af3-b388-74ba735f5e44"&lt;BR /&gt;name: "stealth rule"&lt;BR /&gt;type: "access-rule"&lt;BR /&gt;domain:&lt;BR /&gt;uid: "41e821a0-3720-11e3-aa6e-0800200c9fde"&lt;BR /&gt;name: "SMC User"&lt;BR /&gt;domain-type: "domain"&lt;BR /&gt;rule-number: 12&lt;BR /&gt;filter-match-details:&lt;BR /&gt;- column: "name"&lt;BR /&gt;track:&lt;BR /&gt;type: "598ead32-aa42-4615-90ed-f51a5928d41d"&lt;BR /&gt;per-session: false&lt;BR /&gt;per-connection: true&lt;BR /&gt;accounting: false&lt;BR /&gt;enable-firewall-session: false&lt;BR /&gt;alert: "none"&lt;BR /&gt;source:&lt;BR /&gt;- "97aeb369-9aea-11d5-bd16-0090272ccb30"&lt;BR /&gt;source-negate: false&lt;BR /&gt;destination:&lt;BR /&gt;- "1d825439-7eff-42ff-bee2-f091dad7aa83"&lt;BR /&gt;destination-negate: false&lt;BR /&gt;service:&lt;BR /&gt;- "97aeb369-9aea-11d5-bd16-0090272ccb30"&lt;BR /&gt;service-negate: false&lt;BR /&gt;service-resource: ""&lt;BR /&gt;vpn:&lt;BR /&gt;- "97aeb369-9aea-11d5-bd16-0090272ccb30"&lt;BR /&gt;action: "6c488338-8eec-4103-ad21-cd461ac2c473"&lt;BR /&gt;action-settings: {}&lt;BR /&gt;content:&lt;BR /&gt;- "97aeb369-9aea-11d5-bd16-0090272ccb30"&lt;BR /&gt;content-negate: false&lt;BR /&gt;content-direction: "any"&lt;BR /&gt;time:&lt;BR /&gt;- "97aeb369-9aea-11d5-bd16-0090272ccb30"&lt;BR /&gt;custom-fields:&lt;BR /&gt;field-1: ""&lt;BR /&gt;field-2: ""&lt;BR /&gt;field-3: ""&lt;BR /&gt;meta-info:&lt;BR /&gt;lock: "unlocked"&lt;BR /&gt;validation-state: "ok"&lt;BR /&gt;last-modify-time:&lt;BR /&gt;posix: 1756135560299&lt;BR /&gt;iso-8601: "2025-08-25T11:26-0400"&lt;BR /&gt;last-modifier: "admin"&lt;BR /&gt;creation-time:&lt;BR /&gt;posix: 1756135534952&lt;BR /&gt;iso-8601: "2025-08-25T11:25-0400"&lt;BR /&gt;creator: "admin"&lt;BR /&gt;comments: ""&lt;BR /&gt;enabled: true&lt;BR /&gt;install-on:&lt;BR /&gt;- "6c488338-8eec-4103-ad21-cd461ac2c476"&lt;BR /&gt;available-actions:&lt;BR /&gt;edit: "true"&lt;BR /&gt;delete: "true"&lt;BR /&gt;clone: "not_supported"&lt;BR /&gt;tags: []&lt;BR /&gt;objects-dictionary:&lt;BR /&gt;- uid: "97aeb369-9aea-11d5-bd16-0090272ccb30"&lt;BR /&gt;name: "Any"&lt;BR /&gt;type: "CpmiAnyObject"&lt;BR /&gt;domain:&lt;BR /&gt;uid: "a0bbbc99-adef-4ef8-bb6d-defdefdefdef"&lt;BR /&gt;name: "Check Point Data"&lt;BR /&gt;domain-type: "data domain"&lt;BR /&gt;icon: "General/globalsAny"&lt;BR /&gt;color: "black"&lt;BR /&gt;- uid: "1d825439-7eff-42ff-bee2-f091dad7aa83"&lt;BR /&gt;name: "CP-FW-CLUSTER"&lt;BR /&gt;type: "simple-cluster"&lt;BR /&gt;domain:&lt;BR /&gt;uid: "41e821a0-3720-11e3-aa6e-0800200c9fde"&lt;BR /&gt;name: "SMC User"&lt;BR /&gt;domain-type: "domain"&lt;BR /&gt;icon: "NetworkObjects/cluster"&lt;BR /&gt;color: "sea green"&lt;BR /&gt;- uid: "6c488338-8eec-4103-ad21-cd461ac2c473"&lt;BR /&gt;name: "Drop"&lt;BR /&gt;type: "RulebaseAction"&lt;BR /&gt;domain:&lt;BR /&gt;uid: "a0bbbc99-adef-4ef8-bb6d-defdefdefdef"&lt;BR /&gt;name: "Check Point Data"&lt;BR /&gt;domain-type: "data domain"&lt;BR /&gt;icon: "Actions/actionsDrop"&lt;BR /&gt;color: "none"&lt;BR /&gt;- uid: "598ead32-aa42-4615-90ed-f51a5928d41d"&lt;BR /&gt;name: "Log"&lt;BR /&gt;type: "Track"&lt;BR /&gt;domain:&lt;BR /&gt;uid: "a0bbbc99-adef-4ef8-bb6d-defdefdefdef"&lt;BR /&gt;name: "Check Point Data"&lt;BR /&gt;domain-type: "data domain"&lt;BR /&gt;icon: "Track/tracksLog"&lt;BR /&gt;color: "none"&lt;BR /&gt;- uid: "6c488338-8eec-4103-ad21-cd461ac2c476"&lt;BR /&gt;name: "Policy Targets"&lt;BR /&gt;type: "Global"&lt;BR /&gt;domain:&lt;BR /&gt;uid: "a0bbbc99-adef-4ef8-bb6d-defdefdefdef"&lt;BR /&gt;name: "Check Point Data"&lt;BR /&gt;domain-type: "data domain"&lt;BR /&gt;icon: "General/globalsAny"&lt;BR /&gt;color: "none"&lt;BR /&gt;from: 1&lt;BR /&gt;to: 1&lt;BR /&gt;total: 1&lt;/P&gt;</description>
      <pubDate>Mon, 25 Aug 2025 15:41:19 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/255917#M9189</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2025-08-25T15:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Verify if a firewall stealth rule exists</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/256271#M9224</link>
      <description>&lt;P&gt;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/27871"&gt;@Bob_Zimmerman&lt;/a&gt;&amp;nbsp;: That's my current code to quickly identify all types of stealth rules on a security management:&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;psql_client cpm postgres -c "&lt;BR /&gt;SELECT COUNT(*) FROM accessctrlrule_data&lt;BR /&gt;WHERE deleted = false&lt;BR /&gt;AND srcs LIKE '%97aeb369-9aea-11d5-bd16-0090272ccb30%'&lt;BR /&gt;AND dsts NOT LIKE '%97aeb369-9aea-11d5-bd16-0090272ccb30%'&lt;BR /&gt;AND svcs LIKE '%97aeb369-9aea-11d5-bd16-0090272ccb30%'&lt;BR /&gt;AND src_negated = false&lt;BR /&gt;AND dst_negated = false&lt;BR /&gt;AND svc_negated = false&lt;BR /&gt;AND ruleactionsetting_action IN (SELECT objid FROM rulebaseaction_data WHERE name IN ('Drop','Reject') AND deleted = false);&lt;BR /&gt;"&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm currently trying (i.e. struggling) to verify whether the destinations (dsts) defined in the identified rules match the installation target of the security policy they belong to. This would finally let me drill down to firewall stealth rules only.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2025 08:51:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Verify-if-a-firewall-stealth-rule-exists/m-p/256271#M9224</guid>
      <dc:creator>Danny</dc:creator>
      <dc:date>2025-09-01T08:51:53Z</dc:date>
    </item>
  </channel>
</rss>

