<?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: IOC Upload through API - Security Level Advanced in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/ioc-upload-through-api-security-level-advanced/m-p/540617#M4262</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/190671"&gt;@RFeyertag&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank for reaching out through LIVEcommunity!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I understand correctly you're wanting to know the security risks for not using the advanced security level and looking for an example of hashing the API as required with powershell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, one of the biggest reasons for hashing the API Key is to prevent &lt;A href="https://csrc.nist.gov/glossary/term/replay_attack#:~:text=Definition(s)%3A,effect%20or%20gaining%20unauthorized%20access." target="_self"&gt;replay and similar attacks&lt;/A&gt; while using the API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for how to properly encrypt the API key using powershell &lt;A href="https://www.pdq.com/blog/secure-password-with-powershell-encrypting-credentials-part-1/" target="_self"&gt;this&lt;/A&gt; may be a good resource to get you started.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
    <pubDate>Mon, 01 May 2023 16:24:34 GMT</pubDate>
    <dc:creator>anlynch</dc:creator>
    <dc:date>2023-05-01T16:24:34Z</dc:date>
    <item>
      <title>IOC Upload through API - Security Level Advanced</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/ioc-upload-through-api-security-level-advanced/m-p/540563#M4253</link>
      <description>&lt;P&gt;Hello dear community,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;my ps script is ready to upload IOCs with least privilege.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I want to know, what kind of security risks we have if we don't use the Advanced security level?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Has anybody of you a ps snippet where the api key is hased like it is required?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;additionally I found this example, but not in ps, just only python 3:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;from datetime import datetime, timezone import secrets import string import hashlib import requests def test_advanced_authentication(api_key_id, api_key): # Generate a 64 bytes random string nonce = "".join([secrets.choice(string.ascii_letters + string.digits) for _ in range(64)]) # Get the current timestamp as milliseconds. timestamp = int(datetime.now(timezone.utc).timestamp()) * 1000 # Generate the auth key: auth_key = "%s%s%s" % (api_key, nonce, timestamp) # Convert to bytes object auth_key = auth_key.encode("utf-8") # Calculate sha256: api_key_hash = hashlib.sha256(auth_key).hexdigest() # Generate HTTP call headers headers = { "x-xdr-timestamp": str(timestamp), "x-xdr-nonce": nonce, "x-xdr-auth-id": str(api_key_id), "Authorization": api_key_hash } parameters = {} res = requests.post(url="&lt;A href="https://api-xdr.xdr.de.paloaltonetworks.com/api_keys/validate/" target="_blank"&gt;https://api-xdr.xdr.de.paloaltonetworks.com/api_keys/validate/&lt;/A&gt;", headers=headers, json=parameters) return res&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rob&lt;/P&gt;</description>
      <pubDate>Sun, 30 Apr 2023 22:43:03 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/ioc-upload-through-api-security-level-advanced/m-p/540563#M4253</guid>
      <dc:creator>RFeyertag</dc:creator>
      <dc:date>2023-04-30T22:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: IOC Upload through API - Security Level Advanced</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/ioc-upload-through-api-security-level-advanced/m-p/540617#M4262</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/190671"&gt;@RFeyertag&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank for reaching out through LIVEcommunity!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I understand correctly you're wanting to know the security risks for not using the advanced security level and looking for an example of hashing the API as required with powershell.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, one of the biggest reasons for hashing the API Key is to prevent &lt;A href="https://csrc.nist.gov/glossary/term/replay_attack#:~:text=Definition(s)%3A,effect%20or%20gaining%20unauthorized%20access." target="_self"&gt;replay and similar attacks&lt;/A&gt; while using the API.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for how to properly encrypt the API key using powershell &lt;A href="https://www.pdq.com/blog/secure-password-with-powershell-encrypting-credentials-part-1/" target="_self"&gt;this&lt;/A&gt; may be a good resource to get you started.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 16:24:34 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/ioc-upload-through-api-security-level-advanced/m-p/540617#M4262</guid>
      <dc:creator>anlynch</dc:creator>
      <dc:date>2023-05-01T16:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: IOC Upload through API - Security Level Advanced</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/ioc-upload-through-api-security-level-advanced/m-p/571240#M5821</link>
      <description>&lt;P&gt;Thank you! I already have the answer to my question. The PS script got all the functions to communicate through advanced.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Rob&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2023 18:33:15 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/ioc-upload-through-api-security-level-advanced/m-p/571240#M5821</guid>
      <dc:creator>RFeyertag</dc:creator>
      <dc:date>2023-12-29T18:33:15Z</dc:date>
    </item>
  </channel>
</rss>

