Prisma Cloud CLI
Project description
How to use this tool
This is a start of a Prisma Cloud CLI. It contains a script called pc which can be used to trigger API calls.
Make sure this folder is in your path and create the authentication file below.
Support
These scripts have been developed by Prisma Cloud SAs, they are not Supported by Palo Alto Networks. Nevertheless, the maintainers will make a best-effort to address issues, and (of course) contributors are encouraged to submit issues and pull requests.
Authentication
Create an access key from Settings then Access key
Get the path to console from Compute tab, System, Utilities
Create a file into home directory .prismacloud/credentials.json with the following structure
{
"api_endpoint": "__REDACTED__",
"pcc_api_endpoint": "__REDACTED__",
"access_key_id": "__REDACTED__",
"secret_key": "__REDACTED__"
}
Run the script
pc
Examples
pc policies -o csv
pc policies -o json | jq
pc tags
pc stats -t dashboard
pc stats -t dashboard -o json
pc users
pc cloud
pc reports -o json | jq
pc stats -t dashboard --columns defendersSummary.host --config local
Global options
The following global options are available
--debug, -d, Show debug output
--columns, Select columns to show
--config, Read custom config file ~/.prismacloud/[value].json
--limit, -l, Number of rows to show
--output, -o, Output mode (json/csv/html/markdown/columns)
Use -o columns to get a list of columns available for --columns, e.g.:
pc images -o columns
pc images -l 1 --columns hostname repoTag.repo osDistro -o csv
Use cases
Show twistcli latest scans of scanned images and their number of critical CVEs:
pc scans --columns time entityInfo.id entityInfo.repoTag.registry entityInfo.repoTag.repo entityInfo.repoTag.tag entityInfo.vulnerabilityDistribution.high entityInfo.vulnerabilityDistribution.critical
Get latest scan from image id
pc scans --columns entityInfo.id entityInfo.repoTag.registry entityInfo.repoTag.repo entityInfo.repoTag.tag entityInfo.vulnerabilityDistribution.critical time --config local --custom 'imageID=sha256:ef20bafd68d5e55da305c2289a58f367cd90f71ea97b5414a73b0be745f6aab9'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for prismacloud-cli-0.1.2.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f02ad1c1fc8bf5cde69f7b39e483093ddf059942859189d58a4a511879706bd2 |
|
MD5 | 5da21c36370afb444a967b0d781fc304 |
|
BLAKE2b-256 | 277b7c0a4ebe1a521ec0d40e15c43710d37e89a844568c638562c31b033aea57 |
Hashes for prismacloud_cli-0.1.2.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4620495b88a1ca592e1244cacae070db734ef12e5e7178b40a24b8bf559eac35 |
|
MD5 | a32455631c7ea350587d6d2420db79a4 |
|
BLAKE2b-256 | 0d90cc9cca9be618ae955edee8b605cdbd15d2c9c829a358107d3cce56dd0a96 |