<?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 Threat Prevention Profile API Malware DNS Trap in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Threat-Prevention-Profile-API-Malware-DNS-Trap/m-p/78095#M4577</link>
    <description>&lt;P&gt;Hello Guys,&lt;/P&gt;&lt;P&gt;I'm trying to create a query in order to show and modify (adding/removing) entries on the "Malware DNS Trap" feature on Threat Prevention Profiles.&lt;/P&gt;&lt;P&gt;The problem is that from both documentation on:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#web/show-threat-profile~v1.3%20" target="_blank" rel="nofollow noopener noreferrer"&gt;https://sc1.checkpoint.com/documents/latest/APIs/index.html#web/show-threat-profile~v1.3%20&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and querying with "show-threat-profile" in FULL detail-levels, I cannot see any output reminding to that.&lt;/P&gt;&lt;P&gt;Is there someone that already experienced it and came out with a solution or is there simply someone that could help me out?&lt;SPAN&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;Luca&lt;/P&gt;</description>
    <pubDate>Thu, 12 Mar 2020 10:05:25 GMT</pubDate>
    <dc:creator>Luca_Tinelli</dc:creator>
    <dc:date>2020-03-12T10:05:25Z</dc:date>
    <item>
      <title>Threat Prevention Profile API Malware DNS Trap</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Threat-Prevention-Profile-API-Malware-DNS-Trap/m-p/78095#M4577</link>
      <description>&lt;P&gt;Hello Guys,&lt;/P&gt;&lt;P&gt;I'm trying to create a query in order to show and modify (adding/removing) entries on the "Malware DNS Trap" feature on Threat Prevention Profiles.&lt;/P&gt;&lt;P&gt;The problem is that from both documentation on:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#web/show-threat-profile~v1.3%20" target="_blank" rel="nofollow noopener noreferrer"&gt;https://sc1.checkpoint.com/documents/latest/APIs/index.html#web/show-threat-profile~v1.3%20&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and querying with "show-threat-profile" in FULL detail-levels, I cannot see any output reminding to that.&lt;/P&gt;&lt;P&gt;Is there someone that already experienced it and came out with a solution or is there simply someone that could help me out?&lt;SPAN&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;Luca&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 10:05:25 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Threat-Prevention-Profile-API-Malware-DNS-Trap/m-p/78095#M4577</guid>
      <dc:creator>Luca_Tinelli</dc:creator>
      <dc:date>2020-03-12T10:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: Threat Prevention Profile API Malware DNS Trap</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Threat-Prevention-Profile-API-Malware-DNS-Trap/m-p/78317#M4585</link>
      <description>&lt;P&gt;Unfortunately, there is no official API for these settings.&lt;BR /&gt;You can see and modify it with the generic-object API.&lt;BR /&gt;Once you have the UID of your threat profile, you can see the settings as follows:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;[Expert@MGMT:0]# &lt;STRONG&gt;mgmt_cli -r true --format json show generic-object uid 079c86f0-0c53-4518-9a4e-167a9c1c492e | jq '.malwareDnsTrapSettings'&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "objId": "292e317a-88a8-4e74-a33f-0e20d871e5cd",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "checkPointObjId": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "domainsPreset": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "domainId": "41e821a0-3720-11e3-aa6e-0800200c9fde",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "resolveIpv4RequestsTo": true,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "specificIpaddr": "5.5.5.5",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "ipv4ModeSelection": "SPECIFIED_IP",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "folderPath": "1dc7816c-2c8e-40a3-a4ed-34dd462ebf4f",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "text": null,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "folder": "1dc7816c-2c8e-40a3-a4ed-34dd462ebf4f",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "is_owned": false,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; "ownedName": ""&lt;BR /&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;To change the IP of the DNS trap:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;[Expert@MGMT:0]# &lt;STRONG&gt;mgmt_cli -r true set generic-object uid 079c86f0-0c53-4518-9a4e-167a9c1c492e malwareDnsTrapSettings.specificIpaddr "6.6.6.6"&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Of course, now that I've read the question again, I realize this &lt;EM&gt;&lt;STRONG&gt;wasn't&lt;/STRONG&gt;&lt;/EM&gt; the question you asked.&lt;BR /&gt;However, because I did go to some effort to figure this out, I'm leaving the answer here in case anyone else wants to know.&lt;/P&gt;
&lt;P&gt;It turns out, the objects that show up in the "Internal DNS Servers" part of the profile is not set in the profile anywhere.&lt;BR /&gt;It is a flag that is set in those specific host objects.&lt;BR /&gt;Which would mean querying all the host objects to see which ones have the flag set (dns-server true).&lt;BR /&gt;Haven't worked out the exact syntax to&amp;nbsp;accomplish this with jq, but I assume it can be done.&lt;/P&gt;
&lt;P&gt;To turn an existing host object into a DNS server (and thus show up on this tab):&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;[Expert@MGMT:0]# &lt;STRONG&gt;mgmt_cli -r true set host name "DNS Server" host-servers.dns-server true&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Making something not a DNS server (and thus disappear from this tab) would be:&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;&lt;FONT face="courier new,courier"&gt;[Expert@MGMT:0]# &lt;STRONG&gt;mgmt_cli -r true set host name "DNS Server" host-servers.dns-server false&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Hope that helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Mar 2020 02:47:12 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Threat-Prevention-Profile-API-Malware-DNS-Trap/m-p/78317#M4585</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2020-03-15T02:47:12Z</dc:date>
    </item>
  </channel>
</rss>

