<?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: XML API: Panorama: How to Create/Get/Update the field &amp;quot;Audit Comment&amp;quot; of a Security Policy rule? in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/xml-api-panorama-how-to-create-get-update-the-field-quot-audit/m-p/468598#M2952</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/89131"&gt;@HermanEdwards&lt;/a&gt;, audit comments are not stored in the configuration, hence you don't see it in the API browser. There is an operational CLI command that shows the audit comments (&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;show config list audit-comments xpath {{xpath to security policy rule}}&lt;/SPAN&gt;&lt;/FONT&gt;) and this translates to XML API call:&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;https://{{host}}/api/?key={{key}}&amp;amp;type=op&amp;amp;cmd=&amp;lt;show&amp;gt;&amp;lt;config&amp;gt;&amp;lt;list&amp;gt;&amp;lt;audit-comments&amp;gt;&amp;lt;xpath&amp;gt;/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='{{device-group-name}}']/pre-rulebase/security/rules/entry[@name='{{rule-name}}']&amp;lt;/xpath&amp;gt;&amp;lt;/audit-comments&amp;gt;&amp;lt;/list&amp;gt;&amp;lt;/config&amp;gt;&amp;lt;/show&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Sometimes external XML API calls are not exact replicas of the web GUI behaviour.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
    <pubDate>Fri, 25 Feb 2022 13:47:24 GMT</pubDate>
    <dc:creator>JimmyHolland</dc:creator>
    <dc:date>2022-02-25T13:47:24Z</dc:date>
    <item>
      <title>XML API: Panorama: How to Create/Get/Update the field "Audit Comment" of a Security Policy rule?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/xml-api-panorama-how-to-create-get-update-the-field-quot-audit/m-p/468468#M2948</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Settings&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Panorama version: 10.1 (latest)&lt;/LI&gt;&lt;LI&gt;When creating/updating a Security Policy rule (see attached images for more info), I'm able to add/update Audit comment for a rule via Web browser by following this guide&amp;nbsp;&lt;A href="https://docs.paloaltonetworks.com/pan-os/10-1/pan-os-web-interface-help/policies/audit-comment-archive.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.paloaltonetworks.com/pan-os/10-1/pan-os-web-interface-help/policies/audit-comment-archi...&lt;/A&gt;&amp;nbsp;. However, I fail to use XML API to simulate the same behaviours.&lt;/LI&gt;&lt;LI&gt;On Panorama XML API request, there is no option to get/set the field "audit-comment". I followed this guide&amp;nbsp;&amp;nbsp;&lt;A href="https://docs.paloaltonetworks.com/pan-os/9-0/pan-os-panorama-api/get-started-with-the-pan-os-xml-api/explore-the-api/use-the-api-browser.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://docs.paloaltonetworks.com/pan-os/9-0/pan-os-panorama-api/get-started-with-the-pan-os-xml-api...&lt;/A&gt;&amp;nbsp;to explore all fields for a given Policy rule. There is no "comment" or "audit-comment" field.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What's expected:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Similar to how we can edit/read the Description field of a Security Policy rule, we should be able to edit/read the Audit comment field of a rule as well.&lt;/LI&gt;&lt;LI&gt;I believe we should have xpath like "&lt;SPAN&gt;/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='paul']/pre-rulebase/security/rules/entry[@name='paul-feb-24']/audit-comment" to read or update here.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HermanEdwards_0-1645759483047.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/39323i4C6C81A27E88D148/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="HermanEdwards_0-1645759483047.png" alt="HermanEdwards_0-1645759483047.png" /&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;&lt;BR /&gt;&lt;STRONG&gt;What's happening:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;From viewing Chrome's network tab (see attached), you can see that we should be able to access "audit-comment" for a Policy rule. However, I cannot access that field via XML API browser or manually calling it via curl.&lt;/LI&gt;&lt;LI&gt;Could you tell me if this is something possible on Panorama?&lt;UL&gt;&lt;LI&gt;If yes, How do I access this Audit Comment field?&lt;/LI&gt;&lt;LI&gt;If yes, Is this feature available from Panorama 8.0 as well?&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HermanEdwards_1-1645759483043.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/39324i5E2172F5A3F0ED06/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="HermanEdwards_1-1645759483043.png" alt="HermanEdwards_1-1645759483043.png" /&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;Your help is much appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 03:25:30 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/xml-api-panorama-how-to-create-get-update-the-field-quot-audit/m-p/468468#M2948</guid>
      <dc:creator>HermanEdwards</dc:creator>
      <dc:date>2022-02-25T03:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: XML API: Panorama: How to Create/Get/Update the field "Audit Comment" of a Security Policy rule?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/xml-api-panorama-how-to-create-get-update-the-field-quot-audit/m-p/468473#M2949</link>
      <description>&lt;P&gt;Reposting the 2 images, since the first 2 look very blurry:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;1. Missing Audit comment field under the Policy rule&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HermanEdwards_0-1645759643867.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/39325iA0DFE87619D3C40A/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="HermanEdwards_0-1645759643867.png" alt="HermanEdwards_0-1645759643867.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Network tab proves that we should have that field&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HermanEdwards_1-1645759654949.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/39326i13ED9B3F8BF7733C/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="HermanEdwards_1-1645759654949.png" alt="HermanEdwards_1-1645759654949.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 03:28:10 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/xml-api-panorama-how-to-create-get-update-the-field-quot-audit/m-p/468473#M2949</guid>
      <dc:creator>HermanEdwards</dc:creator>
      <dc:date>2022-02-25T03:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: XML API: Panorama: How to Create/Get/Update the field "Audit Comment" of a Security Policy rule?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/xml-api-panorama-how-to-create-get-update-the-field-quot-audit/m-p/468598#M2952</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/89131"&gt;@HermanEdwards&lt;/a&gt;, audit comments are not stored in the configuration, hence you don't see it in the API browser. There is an operational CLI command that shows the audit comments (&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="s1"&gt;show config list audit-comments xpath {{xpath to security policy rule}}&lt;/SPAN&gt;&lt;/FONT&gt;) and this translates to XML API call:&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;https://{{host}}/api/?key={{key}}&amp;amp;type=op&amp;amp;cmd=&amp;lt;show&amp;gt;&amp;lt;config&amp;gt;&amp;lt;list&amp;gt;&amp;lt;audit-comments&amp;gt;&amp;lt;xpath&amp;gt;/config/devices/entry[@name='localhost.localdomain']/device-group/entry[@name='{{device-group-name}}']/pre-rulebase/security/rules/entry[@name='{{rule-name}}']&amp;lt;/xpath&amp;gt;&amp;lt;/audit-comments&amp;gt;&amp;lt;/list&amp;gt;&amp;lt;/config&amp;gt;&amp;lt;/show&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Sometimes external XML API calls are not exact replicas of the web GUI behaviour.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 13:47:24 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/xml-api-panorama-how-to-create-get-update-the-field-quot-audit/m-p/468598#M2952</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2022-02-25T13:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: XML API: Panorama: How to Create/Get/Update the field "Audit Comment" of a Security Policy rule?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/xml-api-panorama-how-to-create-get-update-the-field-quot-audit/m-p/468810#M2954</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/4294"&gt;@JimmyHolland&lt;/a&gt;&amp;nbsp; Thank you very much! This is working.&lt;BR /&gt;&lt;BR /&gt;It looks like Audit comment need to be created only after a policy has been created. This is b/c it relies on a separate API call (i.e. type='op') here.&lt;BR /&gt;&lt;BR /&gt;Also, the CLI is great! I find that we can perform the Audit comment create/update with `set audit-comment comment "my update via cli" xpath &amp;lt;path_to_policy_node"`&lt;BR /&gt;It's also displayed under Web API explorer:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HermanEdwards_0-1645817082732.png" style="width: 400px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/39345i5426F3908CF28E68/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="HermanEdwards_0-1645817082732.png" alt="HermanEdwards_0-1645817082732.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 19:30:46 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/xml-api-panorama-how-to-create-get-update-the-field-quot-audit/m-p/468810#M2954</guid>
      <dc:creator>HermanEdwards</dc:creator>
      <dc:date>2022-02-25T19:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: XML API: Panorama: How to Create/Get/Update the field "Audit Comment" of a Security Policy rule?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/xml-api-panorama-how-to-create-get-update-the-field-quot-audit/m-p/468922#M2956</link>
      <description>&lt;P&gt;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/4294"&gt;@JimmyHolland&lt;/a&gt;&amp;nbsp; When you have time, do you know if a Device entry name&amp;nbsp;(e.g.&amp;nbsp;'localhost.localdomain')&amp;nbsp;is always required in the xpath? Can it be left as blank? If blank, does it default to some values?&lt;BR /&gt;&lt;BR /&gt;For more info, when submitting the Audit comment update without specifying the Device entry name, the update is still successful. However, the update is applied to the wrong path, resulting in no update on the UI. This makes sense, as the xpath should represent a path to certain object.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;However, I see examples where Device entry name is left as blank on &lt;A href="https://docs.paloaltonetworks.com/pan-os/9-0/pan-os-panorama-api/pan-os-xml-api-request-types/run-operational-mode-commands-api.html" target="_self"&gt;XML API guide&lt;/A&gt;. I'm wondering if some default value get used when entry is blank. Or if I should always default the Device entry name to&amp;nbsp;&lt;STRONG&gt;'localhost.localdomain'&amp;nbsp;&lt;/STRONG&gt;(i.e. I assume all Panorama come with the device entry name&amp;nbsp;&lt;STRONG&gt;'localhost.localdomain')&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 02:24:41 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/xml-api-panorama-how-to-create-get-update-the-field-quot-audit/m-p/468922#M2956</guid>
      <dc:creator>HermanEdwards</dc:creator>
      <dc:date>2022-02-26T02:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: XML API: Panorama: How to Create/Get/Update the field "Audit Comment" of a Security Policy rule?</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/xml-api-panorama-how-to-create-get-update-the-field-quot-audit/m-p/470509#M2966</link>
      <description>&lt;P data-unlink="true"&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/89131"&gt;@HermanEdwards&lt;/a&gt;, I answered this in your &lt;A href="https://live.paloaltonetworks.com/t5/automation-api-discussions/xml-api-do-we-need-to-specify-quot-localhost-localdomain-quot-in/m-p/470501" target="_self"&gt;separate thread&lt;/A&gt;, and the localhost.localdomain is indeed required.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2022 12:27:27 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/xml-api-panorama-how-to-create-get-update-the-field-quot-audit/m-p/470509#M2966</guid>
      <dc:creator>JimmyHolland</dc:creator>
      <dc:date>2022-03-04T12:27:27Z</dc:date>
    </item>
  </channel>
</rss>

