Skip to main content

Posture

The scm posture commands perform Best Practice Assessments (BPA) against PAN-OS firewall configurations. You can export a running config from a firewall, upload it for assessment, and score the results in multiple output formats.

Overview​

The posture workflow has three stages:

  1. Export — Retrieve a PAN-OS configuration XML from a live firewall
  2. Assess — Upload the config to the BPA API, poll for completion, and save the report
  3. Score — Parse a saved BPA report and output scored results

Export​

Export running or candidate configuration from a PAN-OS firewall via the XML API.

Syntax​

scm posture export [OPTIONS]

Options​

OptionDescriptionRequired
--host TEXTPAN-OS firewall hostname or IP address (env: PANOS_HOST)Yes
--user TEXTAdmin username (default: automation, env: PANOS_USER)No
--password TEXTAdmin password (env: PANOS_PASSWORD)Yes
--output TEXTOutput file path (default: config.xml)No
--category TEXTConfig category: running or candidate (default: running)No

Examples​

Export Running Config​

$ scm posture export \
--host 10.0.0.1 \
--user automation \
--password $PANOS_PASSWORD \
--output config.xml
Generated API key for automation@10.0.0.1
Exported running config to config.xml

Export Candidate Config​

$ scm posture export \
--host 10.0.0.1 \
--password $PANOS_PASSWORD \
--output candidate.xml \
--category candidate
Generated API key for automation@10.0.0.1
Exported candidate config to candidate.xml

Assess​

Upload a PAN-OS configuration to the BPA API, poll for completion, save the raw report, and output formatted results.

The raw BPA report JSON is saved to --output. Formatted results are printed to stdout. Progress messages go to stderr so stdout can be piped cleanly by agents.

Syntax​

scm posture assess [OPTIONS]

Options​

OptionDescriptionRequired
--config TEXTPath to PAN-OS config XML fileYes
--output TEXTOutput file path for raw report JSON (default: report.json)No
--format TEXTOutput format: json, markdown, or csv (default: json)No
--delete-after / --keepDelete config from cloud after assessment (default: delete)No
--timeout INTMax seconds to wait for processing (default: 300, range: 30-600)No

Examples​

Assess with JSON Output​

$ scm posture assess \
--config config.xml \
--output report.json \
--format json
Initiating BPA upload...
Task ID: 1620f87f-99f6-4e10-adf4-38e2f1b71d1a
Uploading config...
Upload complete. Waiting for processing...
Status: UPLOAD_COMPLETE (processing...)
Status: IN_PROGRESS (processing...)
Fetching report...
BPA report saved to report.json
{
"score": 71.3,
"total": 303,
"passed": 216,
"failed": 87,
"by_type": {
"Critical": {"total": 100, "passed": 82, "failed": 18},
"Warning": {"total": 94, "passed": 60, "failed": 34},
"Informational": {"total": 109, "passed": 74, "failed": 35}
},
"checks": [...]
}

Assess with Markdown Output​

$ scm posture assess \
--config config.xml \
--format markdown
Initiating BPA upload...
...
## BPA Score: 71.3% (216/303)

### Summary by Severity
| Severity | Passed | Failed | Total |
|---|---|---|---|
| Critical | 82 | 18 | 100 |
| Warning | 60 | 34 | 94 |
| Informational | 74 | 35 | 109 |

### Failing Checks (87)
| ID | Name | Severity | Category | Message |
|---|---|---|---|---|
| 223 | Client communication with secure custom certificates | Warning | device | Configure Local or SCEP Certificate Type |
...

Pipe JSON to an Agent​

$ scm posture assess --config config.xml --format json 2>/dev/null | jq '.score'
71.3

Score​

Parse a saved BPA report JSON and output scored results. Use this to re-score a previously saved report in different formats or with different scope filters without re-running the assessment.

Syntax​

scm posture score [OPTIONS]

Options​

OptionDescriptionRequired
--report TEXTPath to BPA report JSON fileYes
--scope TEXTCategory filter: all, device, service_health, network, policies, objects (default: all)No
--format TEXTOutput format: json, markdown, or csv (default: json)No

Examples​

Score All Checks as JSON​

$ scm posture score --report report.json --format json
{
"score": 71.3,
"total": 303,
"passed": 216,
"failed": 87,
"by_type": {
"Critical": {"total": 100, "passed": 82, "failed": 18},
"Warning": {"total": 94, "passed": 60, "failed": 34},
"Informational": {"total": 109, "passed": 74, "failed": 35}
},
"checks": [...]
}

Score by Category​

$ scm posture score --report report.json --scope policies --format json
{
"score": 45.5,
"total": 11,
"passed": 5,
"failed": 6,
...
}

Export as CSV​

$ scm posture score --report report.json --format csv > checks.csv

CSV output includes a header row and one row per check:

check_id,check_name,check_type,check_passed,category,subcategory,check_message,remediation
223,"Client communication with secure custom certificates",Warning,False,device,device_setup_secure_communication,"Configure Local or SCEP Certificate Type","Enable secure communication"

Output Formats​

All three formats are available on both assess and score commands via --format.

FormatUse Case
jsonDefault. Agent-friendly structured output with score, totals, per-severity breakdown, and all checks
markdownHuman-readable tables with summary, failing checks, and passing checks sections
csvSpreadsheet/pipeline consumption. Header row + one row per check

BPA Categories​

The --scope filter on the score command maps to the BPA report's top-level categories:

ScopeDescription
allAll checks across all categories (default)
deviceDevice setup, certificates, WildFire, logging, sessions
service_healthPrisma Access service health checks
networkIPSec, IKE, GlobalProtect, interface management
policiesSecurity rules, decryption rules, NAT, QoS, DoS
objectsSecurity profiles, URL filtering, application filters

AI Agent Integration​

The posture commands are designed for agent consumption:

  • JSON output provides structured data agents can parse directly
  • Progress on stderr means agents can pipe stdout without noise: scm posture assess --config config.xml --format json 2>/dev/null
  • Separated workflow allows agents to cache reports and re-score with different scopes without re-uploading
  • CSV output enables agents to load results into dataframes or spreadsheets