<?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: Finding a URL in all custom Application/Sites rather than just one in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/190494#M7955</link>
    <description>&lt;P&gt;You cannot use a wildcard in an API call.&lt;BR /&gt;It's also not necessary as there is an endpoint that will list all the application-sites:&lt;BR /&gt;&lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/show-application-sites~v1.9%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/show-application-sites~v1.9%20&lt;/A&gt;&lt;BR /&gt;Note that you may have to make multiple calls to this endpoint (using limit/offset for paging) to retrieve all results.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Aug 2023 15:44:29 GMT</pubDate>
    <dc:creator>PhoneBoy</dc:creator>
    <dc:date>2023-08-24T15:44:29Z</dc:date>
    <item>
      <title>Finding a URL in all custom Application/Sites rather than just one</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/64164#M3992</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a script currently utilising the mgmt api to open a specific application/site and show all the URL's listed. I then can then grep a saved output to find a single URL. I look to add filtering built into the script but has anyone had any experience with looping over all application/sites to find a single URL?&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 13:42:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/64164#M3992</guid>
      <dc:creator>Tom_Cripps</dc:creator>
      <dc:date>2019-10-02T13:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a URL in all custom Application/Sites rather than just one</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/64229#M3993</link>
      <description>I assume at a high level, it something like:&lt;BR /&gt;1. List out the custom applications using show application-sites&lt;BR /&gt;2. For each application listed, run the code you've already written.</description>
      <pubDate>Wed, 02 Oct 2019 21:08:12 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/64229#M3993</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-10-02T21:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a URL in all custom Application/Sites rather than just one</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/64277#M3996</link>
      <description>&lt;P&gt;Makes sense in theory. Will wait to see if anyone else has any feedback.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 10:16:09 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/64277#M3996</guid>
      <dc:creator>Tom_Cripps</dc:creator>
      <dc:date>2019-10-03T10:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a URL in all custom Application/Sites rather than just one</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/69081#M4146</link>
      <description>&lt;P&gt;Hi Daemon,&lt;/P&gt;&lt;P&gt;Looking at this, show application-site appears to show too much or doesn't allow me to look at Custom app/sites we've already made.&lt;/P&gt;&lt;P&gt;Anyone in the community you know who could assist?&lt;/P&gt;&lt;P&gt;Thanks Tom&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 18:27:12 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/69081#M4146</guid>
      <dc:creator>Tom_Cripps</dc:creator>
      <dc:date>2019-12-02T18:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a URL in all custom Application/Sites rather than just one</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/69092#M4147</link>
      <description>&lt;P&gt;Not sure if I understand you correctly, but once you have created a custom application/site you can search for it via the "show application-site" command - you just need to have the name, uid or application id of the related object. So if you have the name and it is called "CustomTest" you an use the following command to receive your required Information; the contained URLs:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT&gt;&amp;gt; show application-site name "CustomTest" --format json&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;{&lt;BR /&gt;&amp;nbsp; "uid" : "e43c6931-8810-482c-836a-ffc5a2a2750a",&lt;BR /&gt;&amp;nbsp; "name" : "CustomTest",&lt;BR /&gt;&amp;nbsp; "type" : "application-site",&lt;BR /&gt;&amp;nbsp; "domain" : {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "uid" : "41e821a0-3720-11e3-aa6e-0800200c9fde",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "name" : "SMC User",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "domain-type" : "domain"&lt;BR /&gt;&amp;nbsp; },&lt;BR /&gt;&amp;nbsp; "application-id" : 0,&lt;BR /&gt;&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt; "primary-category" : "Custom_Application_Site",&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; "description" : "",&lt;BR /&gt;&amp;nbsp; "risk" : "Medium",&lt;BR /&gt;&amp;nbsp; "user-defined" : true,&lt;BR /&gt;&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt; "url-list" : [ "&lt;A href="http://www.test.org" target="_blank" rel="noopener"&gt;www.test.org&lt;/A&gt;", "&lt;A href="http://www.test.com" target="_blank" rel="noopener"&gt;www.test.com&lt;/A&gt;", "test.biz" ],&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; "urls-defined-as-regular-expression" : false,&lt;BR /&gt;&amp;nbsp; "groups" : [ ],&lt;BR /&gt;&amp;nbsp; "comments" : "",&lt;BR /&gt;&amp;nbsp; "color" : "black",&lt;BR /&gt;&amp;nbsp; "icon" : "Objects/application",&lt;BR /&gt;&amp;nbsp; "tags" : [ ],&lt;BR /&gt;&amp;nbsp; "meta-info" : {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "lock" : "locked by current session",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "validation-state" : "ok",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "last-modify-time" : {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "posix" : 1575322111151,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "iso-8601" : "2019-12-02T21:28+0000"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "last-modifier" : "admin",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "creation-time" : {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "posix" : 1575322111151,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "iso-8601" : "2019-12-02T21:28+0000"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "creator" : "admin"&lt;BR /&gt;&amp;nbsp; },&lt;BR /&gt;&amp;nbsp; "read-only" : false&lt;BR /&gt;}&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;If you want a list of all the custom application site objects that you have created you need to execute the command/query the api via "show application-sites" - this will return all related objects. Note; per default it returns 50 per call, this can be increased but should not exceed more than 200-300 per api call - in the best case you keep it at 50. In order to receive all objects you need to call this command over and over again and increase the related Offset parameters. More can be read in the API documentation. In parallel to that you also need to make sure to "take note" of all objects that have &lt;STRONG&gt;&lt;EM&gt;the primary-category of "Custom_Application_Site"&lt;/EM&gt;&lt;/STRONG&gt;, aka all obejcts that were created manually. To achieve this you can simply write down their related uid in a list, that can later be iterated over with the&amp;nbsp;&lt;FONT&gt;show application-site&lt;/FONT&gt; command.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;for identifier in customApplSiteUID_list&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;&amp;nbsp; &amp;nbsp; do "&lt;FONT&gt;show application-site&lt;/FONT&gt; uid identifier"&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;[Of course this is not real code, but it should give you an idea what needs to be done.]&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT&gt;Afterwards you have the output from above for all the required sites. Now you only need to take each of These Outputs and write the URLs into a list, which can be used for your searching purposes.&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 02 Dec 2019 21:53:49 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/69092#M4147</guid>
      <dc:creator>Maik</dc:creator>
      <dc:date>2019-12-02T21:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a URL in all custom Application/Sites rather than just one</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/69118#M4148</link>
      <description>&lt;P&gt;Hi Maik,&lt;/P&gt;&lt;P&gt;Thanks for that. The second option is more inline with what i'm trying to achieve. My issue though, is identifying what is custom and what is not without having the ability to search against the primary category in the api call. I'll have to see if there is some other way of doing it without looking at the uid as this requires manually updating of the uid.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the insight.&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 09:16:56 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/69118#M4148</guid>
      <dc:creator>Tom_Cripps</dc:creator>
      <dc:date>2019-12-03T09:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a URL in all custom Application/Sites rather than just one</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/189404#M7948</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;Following with the thread. A question that I cannot see in the webs about a searching in the whole checkpoint.&lt;/P&gt;&lt;P&gt;I have a 90 custom application / application site.&amp;nbsp; So, in one o several applications exists an URL called "redhat_test".&lt;BR /&gt;How we can find in which application is placed ?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I cannot use wildcard to show all applications&lt;BR /&gt;smartserver&amp;gt;mgmt_cli show application-site name *&lt;BR /&gt;I cannot use a filter as grep in case set one by one application&lt;BR /&gt;smartserver&amp;gt;mgmt_cli show application-site name destyapp_wsus | grep redhat_test&lt;/P&gt;&lt;P&gt;Are there easy way to receive an screen output as&lt;BR /&gt;smartserver&amp;gt;mgmt_cli show application-site name * | grep redhat_test&lt;BR /&gt;destyapp_wsus "url-list" : [ " redhat_test&lt;BR /&gt;destyapp_lin "url-list" : [ " redhat_test&lt;BR /&gt;destyapp_shop "url-list" : [ " redhat_test&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Aug 2023 11:51:27 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/189404#M7948</guid>
      <dc:creator>chymmmy</dc:creator>
      <dc:date>2023-08-14T11:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a URL in all custom Application/Sites rather than just one</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/190494#M7955</link>
      <description>&lt;P&gt;You cannot use a wildcard in an API call.&lt;BR /&gt;It's also not necessary as there is an endpoint that will list all the application-sites:&lt;BR /&gt;&lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/show-application-sites~v1.9%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/show-application-sites~v1.9%20&lt;/A&gt;&lt;BR /&gt;Note that you may have to make multiple calls to this endpoint (using limit/offset for paging) to retrieve all results.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2023 15:44:29 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/190494#M7955</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2023-08-24T15:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a URL in all custom Application/Sites rather than just one</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/192316#M8040</link>
      <description>&lt;P&gt;Following on from&amp;nbsp;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/7"&gt;@PhoneBoy&lt;/a&gt;&amp;nbsp;, you can use the API, but you'll need to be a little more creative with it. &amp;nbsp;If you have custom application sites, then you likely have them in a custom application group. &amp;nbsp;If not, put them in one.&lt;/P&gt;
&lt;P&gt;(nb: i have a bash shell function named 'mcli' to be the curl syntax and things to handle all the HTTPS communication to the mgmt API server; it's not meant to be human-interactive; it just takes a JSON input and sends it via HTTP POST.)&lt;/P&gt;
&lt;P&gt;First fetch your custom application site by name: &amp;nbsp;(here i have one named "Test_Site_Group")&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;echo '{ "name" : "Test_Site_Group" }' |mcli show-application-site-group
{
  "uid" : "9d36b14c-b7c9-4282-a5a4-19d83778c8f3",
  "name" : "Test_Site_Group",
  "type" : "application-site-group",
  "domain" : {
    "uid" : "41e821a0-3720-11e3-aa6e-0800200c9fde",
    "name" : "SMC User",
    "domain-type" : "domain"
  },
  "members" : [ {
    "uid" : "3d765aa4-2b3e-4d9e-a26b-26c20379da78",
    "name" : "Malicious_Sites",
    "type" : "application-site",
    "domain" : {
      "uid" : "41e821a0-3720-11e3-aa6e-0800200c9fde",
      "name" : "SMC User",
      "domain-type" : "domain"
    },
    "icon" : "Objects/application",
    "color" : "black"
  } ],
....
}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The ".members[]" key is a list of your custom sites. &amp;nbsp;This is where PhoneBoy said to iterate over that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$ echo '{ "name" : "Test_Site_Group" }' |mcli show-application-site-group |jq -r '.members[].name' |while read app_site;
do
  echo $app_site
done

Malicious_Sites
...

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output is the list of custom application sites you would have. &amp;nbsp;Here, my customer happened to have one like yours, with a list of URLs. &amp;nbsp;I just stole theirs for this demo. &amp;nbsp;Thus, you'll then call your API again for each of the custom application sites in that site group. &amp;nbsp;Then search the "url-list" key with a JQ filter:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$ echo '{ "name" : "Test_Site_Group" }' |\
  mcli show-application-site-group |\
  jq -r '.members[].name' |\
  while read app_site; do
    echo '{ "name" : "'${app_site}'" }' |\
    mcli show-application-site |\
    jq -r --arg url_search "chromeupdates.online" 'select(."url-list"[]|contains($url_search)).name';
  done

Malicious_Sites
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, the output is the name of the custom site that had an URL in the list that you wanted to find. &amp;nbsp;In this case, I passed a static string to JQ as an argument. &amp;nbsp;"chromeupdates.online" is the value of the variable in JQ as $url_search. &amp;nbsp;You can replace that string with whatever you want and however you want.&lt;/P&gt;
&lt;P&gt;Ansible can do this, too, but with a little more work with &amp;nbsp;JMESQuery.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you intend to run this same thing locally on the mgmt server with mgmt_cli, you can, but just replace my forceful JSON with parameters to mgmt_cli. &amp;nbsp;Oh, and be sure to do "export MGMT_CLI_FORMAT=json" &amp;nbsp;before you run mgmt_cli.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Sep 2023 20:44:35 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Finding-a-URL-in-all-custom-Application-Sites-rather-than-just/m-p/192316#M8040</guid>
      <dc:creator>Duane_Toler</dc:creator>
      <dc:date>2023-09-11T20:44:35Z</dc:date>
    </item>
  </channel>
</rss>

