Prisma Cloud CLI
Project description
Prisma Cloud CLI
This is the Prisma Cloud CLI, a command line for Prisma Cloud by Palo Alto Networks The project is work in progress.
:warning: 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.
Getting started
Requirements
- Python >= 3.7 (Data classes are available for Python 3.7+)
Installation
pip3 install prismacloud-cli
Installation on Alpine:
pip3 install --upgrade pip && pip3 install --upgrade setuptools
pip3 install prismacloud-cli
Run the script
Run the pc cli script. If you don't have a config file yet, it will help you to create one.
pc -h
Create your own configuration
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__"
}
You can add additional configurations which you can call by using --config. For example, create a file called ~/.prismacloud/demo.json with the contents above.
Add --config demo
to your cli commands.
For example:
pc policies -o csv --config demo
Examples
pc policies -o csv
pc policies -o json | jq
pc tags
pc stats -t dashboard
pc stats -o json -t dashboard
pc users
pc cloud
pc reports -o json | jq
pc stats --config local -t dashboard --columns defendersSummary.host
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.8.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b3c3df796f07e0a18c9402e4b8f2a003e6c5d400dbeb6806f00a2c4bc978f02 |
|
MD5 | b74f5ea750d9eb06493a8a8ccca2e0bd |
|
BLAKE2b-256 | c90e03ae8269dd495e6438d98b8268af83d84365189731dc0066a540b6153a7b |
Hashes for prismacloud_cli-0.1.8.dev0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 053c3d7a8ead8877fa6e078401203602dcd4b22fcf46af7b56d33a72cb83b669 |
|
MD5 | f4048fec02874a7f3c4e48f031d7fb14 |
|
BLAKE2b-256 | 26ffd30bb24f2045828945f0bc4207fe6bc0df4a0060a2ac5e3355e09d9d8028 |