PaloAltoNetworks / pan.dev

Palo Alto Networks for Developers
https://pan.dev
MIT License
41 stars 56 forks source link

Issue/Help with "List Alerts V2 - POST" #403

Open roark-menezes opened 1 year ago

roark-menezes commented 1 year ago

Documentation link

https://pan.dev/prisma-cloud/api/cspm/post-alerts-v-2/

Describe the problem

The policy name and severity is not returned:

"items": [
        {
            "alertRules": [],
            "alertTime": 1680492646026,
            "firstSeen": 1680492646026,
            "history": [],
            "id": "P-26555938",
            "lastSeen": 1680492646026,
            "lastUpdated": 1687405310914,
            "metadata": {
                "saveSearchId": "id"
            },
            "policy": {
                "findingTypes": [],
                "name": "",
                "policyId": "id",
                "policyType": "config",
                "remediable": false,
                "restrictAlertDismissal": true,
                "rule": {
                    "criteria": "",
                    "name": "",
                    "parameters": null,
                    "type": ""
                },
                "severity": "",
                "systemDefault": false
            },...

Using the fields variable e.g.

fields = []string{"policy.name", "policy.severity"}

shows the name and severity, however everything else is omitted:

"items": [
        {
            "alertRules": [],
            "id": "id",
            "policy": {
                "findingTypes": [],
                "name": "name",
                "policyType": "",
                "remediable": false,
                "rule": {
                    "criteria": "",
                    "name": "",
                    "parameters": null,
                    "type": ""
                },
                "severity": "low"
            }
        },...

How can I return all the alert info as well as the policy name and severity?

welcome-to-palo-alto-networks[bot] commented 1 year ago

:tada: Thanks for opening your first issue here! Welcome to the community!