<?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: Query 'Any' network- and service-objects by uid in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185469#M7815</link>
    <description>&lt;P&gt;Thank you for your responses!&lt;/P&gt;&lt;P&gt;First of all: You are correct Bob. The 'show-object' command resolves these objects. Thank you for pointing this out. I was sure to have testet for it.&lt;/P&gt;&lt;P&gt;Nevertheless abraxxa is correct, that there is no way to query the 'Any' object before it is encountered in the policy afaik.&lt;/P&gt;&lt;P&gt;For performance reasons I query all network and service objects before querying the ruleset, so I can resolve all uids I encounter on the fly. Only the 'Any' objects are not queryable beforehand, so I need to dynamically load them while parsing the ruleset.&lt;/P&gt;&lt;P&gt;I just rechecked: The 'show-objects' command does not show the 'Any' objects.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;'show-objects', {'filter': 'Any'}&lt;/LI-CODE&gt;&lt;P&gt;So is there a way to query these 'Any' objects via the web-api before knowing their uid?&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jul 2023 15:03:16 GMT</pubDate>
    <dc:creator>nildi</dc:creator>
    <dc:date>2023-07-03T15:03:16Z</dc:date>
    <item>
      <title>Query 'Any' network- and service-objects by uid</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185417#M7811</link>
      <description>&lt;P&gt;Greetings!&lt;/P&gt;&lt;P&gt;I am currently trying to export a rulebase via the web-api via&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;'show-access-rulebase', {'name': 'my firewall rulebase'}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This results in a json representation of my ruleset. A rule in this result set might look like this (uids manually changed):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
    "uid": "11111111-2222-3333-4444-555555555555",
    "name": "Test-Rule",
    "type": "access-rule",
    "domain": {
        "uid": "11111111-2222-3333-4444-555555555555",
        "name": "SMC User",
        "domain-type": "domain"
    },
    "rule-number": 40,
    "track": {...}
    "source": [
        "11111111-2222-3333-4444-555555555555"
    ],
    "source-negate": false,
    "destination": [
        "11111111-2222-3333-4444-555555555555"
    ],
    "destination-negate": false,
    "service": [
        "11111111-2222-3333-4444-555555555555"
    ],
    "service-negate": false,
    "service-resource": "",
    "vpn": [
        "11111111-2222-3333-4444-555555555555"
    ],
    "action": "11111111-2222-3333-4444-555555555555",
    "action-settings": {
        "enable-identity-captive-portal": false
    },
    "content": [
        "11111111-2222-3333-4444-555555555555"
    ],
    "content-negate": false,
    ...
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can resolve the uids given in the "source", "destination" and "service" fields via commands like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;'show-host', {'uid': '11111111-2222-3333-4444-555555555555'}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or similar (show-group, show-network, ...) commands.&lt;/P&gt;&lt;P&gt;Some uids however I can &lt;STRONG&gt;not&lt;/STRONG&gt; resolve via these commands. Even the command 'show-object' does not work for these uids. When I check the rules in the Smart Console, the source, destination or service fields contain the 'Any' object.&lt;/P&gt;&lt;P&gt;How can I query these 'Any' objects via the web-api by their uid?&lt;/P&gt;&lt;P&gt;Tank you very much in advance!&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nils&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 13:33:33 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185417#M7811</guid>
      <dc:creator>nildi</dc:creator>
      <dc:date>2023-07-03T13:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Query 'Any' network- and service-objects by uid</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185447#M7812</link>
      <description>&lt;P&gt;We're currently facing the same issue.&lt;/P&gt;&lt;P&gt;The show-objects API does return the CpmiAnyObject when queried for its uid, which seems to be 97aeb369-9aea-11d5-bd16-0090272ccb30 on all our managers. We still don't want to hardcode it for rule generation as it might change.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 13:35:20 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185447#M7812</guid>
      <dc:creator>abraxxa</dc:creator>
      <dc:date>2023-07-03T13:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Query 'Any' network- and service-objects by uid</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185459#M7813</link>
      <description>&lt;P&gt;'show object' definitely works for the UUID for Any:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[Expert@DallasSA]# mgmt_cli -f json -r true show object uid 97aeb369-9aea-11d5-bd16-0090272ccb30
{
  "object" : {
    "uid" : "97aeb369-9aea-11d5-bd16-0090272ccb30",
    "name" : "Any",
    "type" : "CpmiAnyObject",
    "domain" : {
      "uid" : "a0bbbc99-adef-4ef8-bb6d-defdefdefdef",
      "name" : "Check Point Data",
      "domain-type" : "data domain"
    },
    "icon" : "General/globalsAny",
    "color" : "black"
  }
}&lt;/LI-CODE&gt;
&lt;P&gt;There are a number of special objects like that:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;6c488338-8eec-4103-ad21-cd461ac2c476: Policy Targets
85c0f50f-6d8a-4528-88ab-5fb11d8fe16c: Original
97aeb36a-9aea-11d5-bd16-0090272ccb30: None
97aeb36a-9aeb-11d5-bd16-0090272ccb30: All Users
97aeb36a-9aed-11d5-bd16-0090272ccb30: All_GwToGw (all site-to-site VPNs)
97aeb368-9aea-11d5-bd16-0090272ccb30: All
97aeb369-9aea-11d5-bd16-0090272ccb30: Any
213f0a22-49da-4719-94b3-f2d74623f3fb: Policy HTTPS Targets&lt;/LI-CODE&gt;
&lt;P&gt;There are probably some others which I haven't run into yet.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 14:12:31 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185459#M7813</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2023-07-03T14:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: Query 'Any' network- and service-objects by uid</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185460#M7814</link>
      <description>&lt;P&gt;Yes, but the question is how to get its UID without knowing it.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 14:35:33 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185460#M7814</guid>
      <dc:creator>abraxxa</dc:creator>
      <dc:date>2023-07-03T14:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Query 'Any' network- and service-objects by uid</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185469#M7815</link>
      <description>&lt;P&gt;Thank you for your responses!&lt;/P&gt;&lt;P&gt;First of all: You are correct Bob. The 'show-object' command resolves these objects. Thank you for pointing this out. I was sure to have testet for it.&lt;/P&gt;&lt;P&gt;Nevertheless abraxxa is correct, that there is no way to query the 'Any' object before it is encountered in the policy afaik.&lt;/P&gt;&lt;P&gt;For performance reasons I query all network and service objects before querying the ruleset, so I can resolve all uids I encounter on the fly. Only the 'Any' objects are not queryable beforehand, so I need to dynamically load them while parsing the ruleset.&lt;/P&gt;&lt;P&gt;I just rechecked: The 'show-objects' command does not show the 'Any' objects.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;'show-objects', {'filter': 'Any'}&lt;/LI-CODE&gt;&lt;P&gt;So is there a way to query these 'Any' objects via the web-api before knowing their uid?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 15:03:16 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185469#M7815</guid>
      <dc:creator>nildi</dc:creator>
      <dc:date>2023-07-03T15:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Query 'Any' network- and service-objects by uid</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185470#M7816</link>
      <description>&lt;P&gt;No it's not. The question as originally stated:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/58121"&gt;@nildi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Some uids however I can &lt;STRONG&gt;not&lt;/STRONG&gt; resolve via these commands. Even the command 'show-object' does not work for these uids. When I check the rules in the Smart Console, the source, destination or service fields contain the 'Any' object.&lt;/P&gt;
&lt;P&gt;How can I query these 'Any' objects via the web-api by their uid?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And the answer is to use 'show object' with the UUID. It definitely works. I've used it for Any back to R80.20, though I don't have any management servers that old anymore to confirm the other UUIDs in my list, but I would expect all of them to work as well.&lt;/P&gt;
&lt;P&gt;The objects referenced in rules should also show up in the 'show access-rulebase' call's objects dictionary. The objects I listed above don't show up in 'show objects' and may not show up in rules, but they're still valid destinations for certain object relationships.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 15:04:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185470#M7816</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2023-07-03T15:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Query 'Any' network- and service-objects by uid</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185478#M7818</link>
      <description>&lt;P&gt;'show objects' does not include these, yes. It also doesn't include rule actions (Accept, Drop, etc. all have UUIDs), rule track settings (Log, Alert, etc.), tags, or a few other things. The list of UUIDs I provided is what I've found I have to download by hand to ensure I have every valid option for the various fields.&lt;/P&gt;
&lt;P&gt;I forget if QoS limits show up in 'show objects', but I do end up with them after recursively downloading everything I can.&lt;/P&gt;
&lt;P&gt;I definitely wouldn't mind a 'show special-objects' or similar call which shows all of the weird things like these. I requested something like that a while ago, but never heard if it's on the roadmap. Fortunately, their UUIDs never change since they're built-in, so I just built that manual list to download.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 16:05:44 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185478#M7818</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2023-07-03T16:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Query 'Any' network- and service-objects by uid</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185526#M7820</link>
      <description>&lt;P&gt;Thank you very much for the clarification. Seems I will hard-code these objects into my code for now, until there is such a 'show-special-objects' function.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2023 06:45:56 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Query-Any-network-and-service-objects-by-uid/m-p/185526#M7820</guid>
      <dc:creator>nildi</dc:creator>
      <dc:date>2023-07-04T06:45:56Z</dc:date>
    </item>
  </channel>
</rss>

