CWPP API Documentation or Examples on usage of query parameters search and fields

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

CWPP API Documentation or Examples on usage of query parameters search and fields

L3 Networker

I want to see ALL of the docker labels for a scanned image so I am trying this API, https://prisma.pan.dev/api/cloud/cwpp/registry#operation/get-registry

 

Invoking that API with query parameter name...

curl -k \
-u "${PRISMA_KEY_ID}:${PGE_PRISMA_SECRET}" \
-H 'Content-Type: application/json' \
-X GET \
"${PRISMA_CLOUD_COMPUTE_CONSOLE_API_ADDR}/api/v22.06/registry?name=https://jfrog.nonprod.secret.com/artifactory/cscoe-prisma-automation-docker-virtual/simple-ecs-task:latest

... returns a HUGE json object containing a field called labels which is the only field that I am interested in testing...

TommyHunt_1-1666375869052.png

So, I see that there is a query parameter called "fields" then I invoke the API like this hoping to see only the json array, labels...

curl -k \
-u "${PRISMA_KEY_ID}:${PGE_PRISMA_SECRET}" \
-H 'Content-Type: application/json' \
-X GET \
"${PRISMA_CLOUD_COMPUTE_CONSOLE_API_ADDR}/api/v22.06/registry?name=https://jfrog.nonprod.secret.com/artifactory/cscoe-prisma-automation-docker-virtual/simple-ecs-task:latest&fields=labels"

but that returns some odd JSON of null values...

{"_id":"jfrog.nonprod.secret.com/artifactory/cscoe-prisma-automation-docker-virtual/simple-ecs-task:latest","type":"","hostname":"","scanTime":"0001-01-01T00:00:00Z","binaries":null,"Secrets":null,"startupBinaries":null,"osDistro":"","osDistroVersion":"","osDistroRelease":"","distro":"","packages":null,"files":null,"packageManager":false,"isARM64":false,"image":{"created":"0001-01-01T00:00:00Z"},"history":null,"complianceIssues":null,"allCompliance":{},"vulnerabilities":null,"repoTag":null,"tags":null,"repoDigests":null,"creationTime":"0001-01-01T00:00:00Z","vulnerabilitiesCount":0,"complianceIssuesCount":0,"vulnerabilityDistribution":{"critical":0,"high":0,"medium":0,"low":0,"total":0},"complianceDistribution":{"critical":0,"high":0,"medium":0,"low":0,"total":0},"vulnerabilityRiskScore":0,"complianceRiskScore":0,"riskFactors":null,"installedProducts":{},"firstScanTime":"0001-01-01T00:00:00Z","cloudMetadata":{},"instances":null,"hosts":{},"err":"","collections":null,"scanID":0,"trustStatus":"","firewallProtection":{"enabled":false,"supported":false,"outOfBandMode":""},"appEmbedded":false,"wildFireUsage":null,"agentless":false}

what am I doing wrong?

how do i get query parameter, "fields", to work?

is there some documenation / examples of how query parameters, fields and search, are to be specified in the URL?

Tommy Hunt AWS-CSA, Java-CEA, PMP, SAFe Program Consultant
thunt@citrusoft.org
https://www.citrusoft.org
1 accepted solution

Accepted Solutions

FYI... there exists a prisma cli tool on github,  https://github.com/PaloAltoNetworks/prismacloud-cli

You can use the --help option of that CLI tool...

TommyHunt_0-1669740727619.png

and I am interested in searching the scan reports...

TommyHunt_1-1669740791962.png

At this point, I have a quick feedback cycle to experiment with search terms...

 

Tommy Hunt AWS-CSA, Java-CEA, PMP, SAFe Program Consultant
thunt@citrusoft.org
https://www.citrusoft.org

View solution in original post

5 REPLIES 5

L2 Linker

Hi TommyHunt,

 

I hope you are doing well. Thank you for letting us know. It is indeed not working as expected. I have tested it on my end as well and it is not returning a proper output. Please go ahead and create a support case for us and the next available support engineer can assist you with it.

 

Regards,

Muhammad Wahaaj Siddiqui | Sr. Technical Support Engineer - Prisma Cloud Compute | PCCSE, CKA, CKS, AWS SysOps, AWS DevOps Professional

L3 Networker

CASE 02355270

Tommy Hunt AWS-CSA, Java-CEA, PMP, SAFe Program Consultant
thunt@citrusoft.org
https://www.citrusoft.org

L0 Member

We already created a support case for this. The reply was, the documentation is wrong and rather than fixing the tool, they will change the documentation. 😀

L3 Networker

Thanks @RahulMeedaboina  but here is an example of a GET scans API invocation.  https://github.com/PaloAltoNetworks/prismacloud-cli/blob/39b60c85882919f1d12115c29f0b5123622e8f88/pr...

 

Now, how is the search criteria specified?

 

Tommy Hunt AWS-CSA, Java-CEA, PMP, SAFe Program Consultant
thunt@citrusoft.org
https://www.citrusoft.org

FYI... there exists a prisma cli tool on github,  https://github.com/PaloAltoNetworks/prismacloud-cli

You can use the --help option of that CLI tool...

TommyHunt_0-1669740727619.png

and I am interested in searching the scan reports...

TommyHunt_1-1669740791962.png

At this point, I have a quick feedback cycle to experiment with search terms...

 

Tommy Hunt AWS-CSA, Java-CEA, PMP, SAFe Program Consultant
thunt@citrusoft.org
https://www.citrusoft.org
  • 1 accepted solution
  • 2882 Views
  • 5 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!