<?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: Management API: service object port value syntax not documented completely in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Management-API-service-object-port-value-syntax-not-documented/m-p/109495#M5549</link>
    <description>&lt;P&gt;I believe that works in SMB appliances (the ports separated by commas), just never thought to try it in regular gateways &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Feb 2021 22:23:58 GMT</pubDate>
    <dc:creator>PhoneBoy</dc:creator>
    <dc:date>2021-02-01T22:23:58Z</dc:date>
    <item>
      <title>Management API: service object port value syntax not documented completely</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Management-API-service-object-port-value-syntax-not-documented/m-p/109459#M5542</link>
      <description>&lt;P&gt;The predefined &lt;STRONG&gt;service-tcp&lt;/STRONG&gt; and &lt;STRONG&gt;service-udp&lt;/STRONG&gt; objects on the Security Management do not use only plain integer numbers for the &lt;STRONG&gt;port&lt;/STRONG&gt; property. They use also:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ranges like: "&lt;STRONG&gt;18190-19191&lt;/STRONG&gt;"&lt;/LI&gt;&lt;LI&gt;greater than operator like: "&lt;STRONG&gt;&amp;gt;1023&lt;/STRONG&gt;"&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Unfortunately the documentation is incomplete and it describes only plain numbers and ranges:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/#cli/add-service-tcp" target="_blank" rel="noopener"&gt;https://sc1.checkpoint.com/documents/latest/APIs/#cli/add-service-tcp&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/#cli/add-service-udp" target="_blank" rel="noopener"&gt;https://sc1.checkpoint.com/documents/latest/APIs/#cli/add-service-udp&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Where is the greater than operator documented? What is the complete syntax of the port number property? Are all the INSPECT language operators supported? (&lt;STRONG&gt;&amp;lt;&lt;/STRONG&gt;, &lt;STRONG&gt;&amp;lt;=&lt;/STRONG&gt;, &lt;STRONG&gt;&amp;gt;&lt;/STRONG&gt;, &lt;STRONG&gt;&amp;gt;=&lt;/STRONG&gt;, &lt;STRONG&gt;!=&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;Here is an example of &lt;STRONG&gt;service-tcp&lt;/STRONG&gt; with the greater-than operator:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;gt; show service-tcp name tcp-high-ports

uid: "97aeb3dd-9aea-11d5-bd16-0090272ccb30"
name: "tcp-high-ports"
type: "service-tcp"
domain: 
  uid: "a0bbbc99-adef-4ef8-bb6d-defdefdefdef"
  name: "Check Point Data"
  domain-type: "data domain"
port: "&amp;gt;1023"
match-by-protocol-signature: false
override-default-settings: false
session-timeout: 3600
use-default-session-timeout: true
match-for-any: false
sync-connections-on-cluster: true
aggressive-aging: 
  enable: true
  timeout: 600
  use-default-timeout: true
  default-timeout: 0
keep-connections-open-after-policy-installation: false
groups: []
comments: "TCP Ports 1024-65535"
color: "yellow"
icon: "Services/TCPService"
tags: []
meta-info: 
  lock: "unlocked"
  validation-state: "ok"
  last-modify-time: 
    posix: 1598366251916
    iso-8601: "2020-08-25T16:37+0200"
  last-modifier: "System"
  creation-time: 
    posix: 1598366251916
    iso-8601: "2020-08-25T16:37+0200"
  creator: "System"
read-only: false&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 17:22:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Management-API-service-object-port-value-syntax-not-documented/m-p/109459#M5542</guid>
      <dc:creator>Václav_Brožík</dc:creator>
      <dc:date>2021-02-01T17:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Management API: service object port value syntax not documented completely</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Management-API-service-object-port-value-syntax-not-documented/m-p/109482#M5546</link>
      <description>&lt;P&gt;Not sure where it's documented, but it's really quick to test:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[Expert@LabSC]# mgmt_cli -s session.txt --format json set service-tcp uid "72b65d82-c1d7-4c9f-add2-906dee45d8a6" port "&amp;lt;1023" | wc -l
45
[Expert@LabSC]# mgmt_cli -s session.txt --format json set service-tcp uid "72b65d82-c1d7-4c9f-add2-906dee45d8a6" port "&amp;lt;=1023" | wc -l
7
[Expert@LabSC]# mgmt_cli -s session.txt --format json set service-tcp uid "72b65d82-c1d7-4c9f-add2-906dee45d8a6" port "&amp;gt;1023" | wc -l
45
[Expert@LabSC]# mgmt_cli -s session.txt --format json set service-tcp uid "72b65d82-c1d7-4c9f-add2-906dee45d8a6" port "&amp;gt;=1023" | wc -l
7
[Expert@LabSC]# mgmt_cli -s session.txt --format json set service-tcp uid "72b65d82-c1d7-4c9f-add2-906dee45d8a6" port "!=1023" | wc -l
7
[Expert@LabSC]# mgmt_cli -s session.txt --format json set service-tcp uid "72b65d82-c1d7-4c9f-add2-906dee45d8a6" port "!=1023"        
{
  "code" : "err_validation_failed",
  "message" : "Validation failed with 1 blocking-error",
  "blocking-errors" : [ {
    "message" : "'Port' value is not 'any' or a valid port or port range"
  } ]
}
[Expert@LabSC]# mgmt_cli -s session.txt --format json set service-tcp uid "72b65d82-c1d7-4c9f-add2-906dee45d8a6" port "1023,1025" | wc -l
7&lt;/LI-CODE&gt;
&lt;P&gt;Looks like it only allows &amp;lt; or &amp;gt; as prefixes. No &amp;lt;=, &amp;gt;=, or !=. I think &amp;lt; and &amp;gt; are technically considered single-ended ranges (where the 0 or 65535 is implied). Not sure why &amp;lt;= and &amp;gt;= wouldn't work, but it's not hard to just change the port number by one.&lt;/P&gt;
&lt;P&gt;!= would create a discontiguous range, which I also tested with the comma case at the end. Evidently ranges must be contiguous.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 19:00:01 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Management-API-service-object-port-value-syntax-not-documented/m-p/109482#M5546</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2021-02-01T19:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: Management API: service object port value syntax not documented completely</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Management-API-service-object-port-value-syntax-not-documented/m-p/109485#M5547</link>
      <description>&lt;P&gt;It’s true that the values for port number have their basis in INSPECT.&lt;BR /&gt;However, I’ve never seen formal documentation for what can be in the port number.&lt;BR /&gt;Have to admit, I didn’t know about the ports separated by commas one.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 19:39:26 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Management-API-service-object-port-value-syntax-not-documented/m-p/109485#M5547</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2021-02-01T19:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Management API: service object port value syntax not documented completely</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Management-API-service-object-port-value-syntax-not-documented/m-p/109491#M5548</link>
      <description>&lt;P&gt;I had never actually seen ports separated by commas, it just made sense as another thing worth trying. Numbers separated by a dash makes a contiguous range, so could you do "21,1024-2048" to include multiple blocks of ports with gaps between them? Turns out no.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 20:26:04 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Management-API-service-object-port-value-syntax-not-documented/m-p/109491#M5548</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2021-02-01T20:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Management API: service object port value syntax not documented completely</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Management-API-service-object-port-value-syntax-not-documented/m-p/109495#M5549</link>
      <description>&lt;P&gt;I believe that works in SMB appliances (the ports separated by commas), just never thought to try it in regular gateways &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2021 22:23:58 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Management-API-service-object-port-value-syntax-not-documented/m-p/109495#M5549</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2021-02-01T22:23:58Z</dc:date>
    </item>
  </channel>
</rss>

