<?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: Retrieving and Creating Alert rules via API in Prisma Cloud Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/retrieving-and-creating-alert-rules-via-api/m-p/514742#M684</link>
    <description>&lt;P&gt;Greeting,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;I highly recommend you review the following&amp;nbsp;doc before Prisma Cloud API.&lt;BR /&gt;1- &lt;A href="https://docs.paloaltonetworks.com/prisma/prisma-cloud/prisma-cloud-admin/get-started-with-prisma-cloud/access-the-prisma-cloud-api" target="_self"&gt;Access the Prisma Cloud REST API&lt;BR /&gt;2- &lt;/A&gt;&lt;A href="https://prisma.pan.dev/docs/cloud/cspm/cspm-gs" target="_self"&gt;Generate JWT Token in Prisma Cloud&lt;BR /&gt;3-&amp;nbsp;&lt;/A&gt;&lt;A class="" href="https://prisma.pan.dev/api/cloud/api-urls" target="_blank" rel="noopener"&gt;Stack API based on STACKs&lt;/A&gt;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have added the sample Payload for your convenience.&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"alertRuleNotificationConfig": [&lt;BR /&gt;{&lt;BR /&gt;"detailedReport": false,&lt;BR /&gt;"enabled": false,&lt;BR /&gt;"includeRemediation": false,&lt;BR /&gt;"recipients": [&lt;BR /&gt;"user@email.com"&lt;BR /&gt;],&lt;BR /&gt;"type": "email",&lt;BR /&gt;"withCompression": false,&lt;BR /&gt;"frequency": "as_it_happens"&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"allowAutoRemediate": false,&lt;BR /&gt;"delayNotificationMs": 0,&lt;BR /&gt;"description": "",&lt;BR /&gt;"enabled": true,&lt;BR /&gt;"name": "Test12",&lt;BR /&gt;"policies": [&lt;BR /&gt;"5cc78081-1006-4874-8b13-bd01583888c4"&lt;BR /&gt;],&lt;BR /&gt;"policyLabels": [],&lt;BR /&gt;"scanAll": false,&lt;BR /&gt;"target": {&lt;BR /&gt;"accountGroups": [&lt;BR /&gt;"41ec1962-2f54-49e7-b07e-d7ae1cacfd3d"&lt;BR /&gt;],&lt;BR /&gt;"excludedAccounts": [],&lt;BR /&gt;"regions": [],&lt;BR /&gt;"targetResourceList": {&lt;BR /&gt;"action": "AUTO_DISMISS",&lt;BR /&gt;"additionalNotes": "",&lt;BR /&gt;"approver": "",&lt;BR /&gt;"enabled": false,&lt;BR /&gt;"ids": [],&lt;BR /&gt;"reason": "",&lt;BR /&gt;"requestor": ""&lt;BR /&gt;},&lt;BR /&gt;"tags": []&lt;BR /&gt;},&lt;BR /&gt;"notifyOnDismissed": true,&lt;BR /&gt;"notifyOnOpen": true,&lt;BR /&gt;"notifyOnResolved": true,&lt;BR /&gt;"notifyOnSnoozed": true&lt;BR /&gt;}&lt;/P&gt;
&lt;P data-unlink="true"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;POST https://{{api-endpoint}}/v2/alert/rule &amp;gt;&amp;gt; 405&lt;BR /&gt;Can we post events on this API endpoint?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;No, we can't post to the above endpoint as API endpoint is missing.&lt;/P&gt;
&lt;P&gt;Prisma Cloud API call is mainly based on the STACK for instance if I am on STACK APP2 the link would be &lt;A href="https://api2.prismacloud.io/v2/alert/rule" target="_blank" rel="noopener"&gt;https://api2.prismacloud.io/v2/alert/rule&lt;BR /&gt;or If I am using APP.EU the API call link would be &lt;/A&gt;&lt;A href="https://api.eu.prismacloud.io/v2/alert/rule" target="_blank" rel="noopener"&gt;https://api.eu.prismacloud.io/v2/alert/rule&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;API call retrieving alert rule by ID:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;GET&lt;SPAN&gt;&amp;nbsp;&lt;SPAN&gt;https://&lt;SPAN class=""&gt;&lt;SPAN&gt;{{api-endpoint}}&lt;SPAN&gt;/v1/alert/&lt;SPAN class=""&gt;&lt;SPAN&gt;{{ruleid}}&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To run the following API call, firstly run the API call to get Alert ID.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My tenant is on APP3 so the API call would be &lt;A href="https://api3.prismacloud.io" target="_blank" rel="noopener"&gt;https://api3.prismacloud.io&lt;SPAN&gt;/v2/alert/rule&lt;BR /&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then use the following API call.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://api3.prismacloud.io/v1/alert/{{ruleid}}" target="_blank" rel="noopener"&gt;https://api3.prismacloud.io/v1/alert/{{ruleid}}&lt;BR /&gt;&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I hope this info will help.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2022 17:21:32 GMT</pubDate>
    <dc:creator>NNawaz</dc:creator>
    <dc:date>2022-09-13T17:21:32Z</dc:date>
    <item>
      <title>Retrieving and Creating Alert rules via API</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/retrieving-and-creating-alert-rules-via-api/m-p/505576#M507</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- Api call add alert rule:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to create alert rules via API for the CSPM. Are there any examples for this? It's not clear to me how to populate:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;alertRuleNotificationConfig&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="https://prisma.pan.dev/api/cloud/cspm/alert-rules#operation/add-alert-rule" target="_blank" rel="noopener"&gt;https://prisma.pan.dev/api/cloud/cspm/alert-rules#operation/add-alert-rule&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;POST https://&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;{{api-endpoint}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/v2/alert/rule &amp;gt;&amp;gt; 405&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can we post events on this API endpoint? &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- API call retrieving alert rule by ID:&lt;/P&gt;
&lt;P&gt;GET &lt;SPAN&gt;https://&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;{{api-endpoint}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;/v1/alert/&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;{{ruleid}}&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;gt;&amp;gt; 404&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The {id} which I retrieve with this API call:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://prisma.pan.dev/api/cloud/cspm/alert-rules#operation/get-alert-rules-v2" target="_blank" rel="noopener"&gt;https://prisma.pan.dev/api/cloud/cspm/alert-rules#operation/get-alert-rules-v2&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can any one verify that their api call are valid?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2022 15:38:59 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/retrieving-and-creating-alert-rules-via-api/m-p/505576#M507</guid>
      <dc:creator>Yifan</dc:creator>
      <dc:date>2022-07-07T15:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving and Creating Alert rules via API</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/retrieving-and-creating-alert-rules-via-api/m-p/510160#M542</link>
      <description>&lt;P&gt;Please follow&amp;nbsp;Instructions on how to setup the Postman Collections and Environments relating to Prisma Cloud (including Compute Console) API requests.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[1]&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://github.com/PaloAltoNetworks/pcs-postman" target="_blank"&gt;https://github.com/PaloAltoNetworks/pcs-postman&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;This is an easy way to use&amp;nbsp;create alert rules via API for the CSPM.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 08:43:48 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/retrieving-and-creating-alert-rules-via-api/m-p/510160#M542</guid>
      <dc:creator>ENwankwo1</dc:creator>
      <dc:date>2022-07-28T08:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieving and Creating Alert rules via API</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/retrieving-and-creating-alert-rules-via-api/m-p/514742#M684</link>
      <description>&lt;P&gt;Greeting,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;I highly recommend you review the following&amp;nbsp;doc before Prisma Cloud API.&lt;BR /&gt;1- &lt;A href="https://docs.paloaltonetworks.com/prisma/prisma-cloud/prisma-cloud-admin/get-started-with-prisma-cloud/access-the-prisma-cloud-api" target="_self"&gt;Access the Prisma Cloud REST API&lt;BR /&gt;2- &lt;/A&gt;&lt;A href="https://prisma.pan.dev/docs/cloud/cspm/cspm-gs" target="_self"&gt;Generate JWT Token in Prisma Cloud&lt;BR /&gt;3-&amp;nbsp;&lt;/A&gt;&lt;A class="" href="https://prisma.pan.dev/api/cloud/api-urls" target="_blank" rel="noopener"&gt;Stack API based on STACKs&lt;/A&gt;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have added the sample Payload for your convenience.&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"alertRuleNotificationConfig": [&lt;BR /&gt;{&lt;BR /&gt;"detailedReport": false,&lt;BR /&gt;"enabled": false,&lt;BR /&gt;"includeRemediation": false,&lt;BR /&gt;"recipients": [&lt;BR /&gt;"user@email.com"&lt;BR /&gt;],&lt;BR /&gt;"type": "email",&lt;BR /&gt;"withCompression": false,&lt;BR /&gt;"frequency": "as_it_happens"&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;"allowAutoRemediate": false,&lt;BR /&gt;"delayNotificationMs": 0,&lt;BR /&gt;"description": "",&lt;BR /&gt;"enabled": true,&lt;BR /&gt;"name": "Test12",&lt;BR /&gt;"policies": [&lt;BR /&gt;"5cc78081-1006-4874-8b13-bd01583888c4"&lt;BR /&gt;],&lt;BR /&gt;"policyLabels": [],&lt;BR /&gt;"scanAll": false,&lt;BR /&gt;"target": {&lt;BR /&gt;"accountGroups": [&lt;BR /&gt;"41ec1962-2f54-49e7-b07e-d7ae1cacfd3d"&lt;BR /&gt;],&lt;BR /&gt;"excludedAccounts": [],&lt;BR /&gt;"regions": [],&lt;BR /&gt;"targetResourceList": {&lt;BR /&gt;"action": "AUTO_DISMISS",&lt;BR /&gt;"additionalNotes": "",&lt;BR /&gt;"approver": "",&lt;BR /&gt;"enabled": false,&lt;BR /&gt;"ids": [],&lt;BR /&gt;"reason": "",&lt;BR /&gt;"requestor": ""&lt;BR /&gt;},&lt;BR /&gt;"tags": []&lt;BR /&gt;},&lt;BR /&gt;"notifyOnDismissed": true,&lt;BR /&gt;"notifyOnOpen": true,&lt;BR /&gt;"notifyOnResolved": true,&lt;BR /&gt;"notifyOnSnoozed": true&lt;BR /&gt;}&lt;/P&gt;
&lt;P data-unlink="true"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-unlink="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;POST https://{{api-endpoint}}/v2/alert/rule &amp;gt;&amp;gt; 405&lt;BR /&gt;Can we post events on this API endpoint?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;No, we can't post to the above endpoint as API endpoint is missing.&lt;/P&gt;
&lt;P&gt;Prisma Cloud API call is mainly based on the STACK for instance if I am on STACK APP2 the link would be &lt;A href="https://api2.prismacloud.io/v2/alert/rule" target="_blank" rel="noopener"&gt;https://api2.prismacloud.io/v2/alert/rule&lt;BR /&gt;or If I am using APP.EU the API call link would be &lt;/A&gt;&lt;A href="https://api.eu.prismacloud.io/v2/alert/rule" target="_blank" rel="noopener"&gt;https://api.eu.prismacloud.io/v2/alert/rule&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;API call retrieving alert rule by ID:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;GET&lt;SPAN&gt;&amp;nbsp;&lt;SPAN&gt;https://&lt;SPAN class=""&gt;&lt;SPAN&gt;{{api-endpoint}}&lt;SPAN&gt;/v1/alert/&lt;SPAN class=""&gt;&lt;SPAN&gt;{{ruleid}}&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;To run the following API call, firstly run the API call to get Alert ID.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My tenant is on APP3 so the API call would be &lt;A href="https://api3.prismacloud.io" target="_blank" rel="noopener"&gt;https://api3.prismacloud.io&lt;SPAN&gt;/v2/alert/rule&lt;BR /&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then use the following API call.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://api3.prismacloud.io/v1/alert/{{ruleid}}" target="_blank" rel="noopener"&gt;https://api3.prismacloud.io/v1/alert/{{ruleid}}&lt;BR /&gt;&lt;BR /&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I hope this info will help.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 17:21:32 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/retrieving-and-creating-alert-rules-via-api/m-p/514742#M684</guid>
      <dc:creator>NNawaz</dc:creator>
      <dc:date>2022-09-13T17:21:32Z</dc:date>
    </item>
  </channel>
</rss>

