Cortex XDR - API Automation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Cortex XDR - API Automation

L0 Member

Hello,

I am currently trying to code a Script with Cortex API in order to check the version of the latest available Agent. I am talking the precise agent version not like 5.X but the 5.X.XXXX.
I haven't seen anything in their actual documentation, perhaps I missed something.

Hope someone can help me out

Thanks a lot!

1 accepted solution

Accepted Solutions

L2 Linker

Should be possible with this API: https://cortex-panw.stoplight.io/docs/cortex-xdr/30237841cb254-get-distribution-version

 

import requests

def get_cortex_distribution_version(tenant_name, tenant_region, api_key_id, api_key):
    url = f"https://api-{tenant_name}.xdr.{tenant_region}.paloaltonetworks.com/public_api/v1/distributions/get_versions"
    headers = {
        "x-xdr-auth-id": api_key_id,
        "Authorization": api_key
    }
    response = requests.post(url, headers=headers, json={"request_data": {}})
    return response.json()

View solution in original post

2 REPLIES 2

L2 Linker

Should be possible with this API: https://cortex-panw.stoplight.io/docs/cortex-xdr/30237841cb254-get-distribution-version

 

import requests

def get_cortex_distribution_version(tenant_name, tenant_region, api_key_id, api_key):
    url = f"https://api-{tenant_name}.xdr.{tenant_region}.paloaltonetworks.com/public_api/v1/distributions/get_versions"
    headers = {
        "x-xdr-auth-id": api_key_id,
        "Authorization": api_key
    }
    response = requests.post(url, headers=headers, json={"request_data": {}})
    return response.json()

L0 Member

Thanks a lot!

I totally missed it. you saved me

  • 1 accepted solution
  • 243 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!