Cortex CLI usage
Run Cortex CLI commands for security scans in Cortex XSIAM.
Run a Cortex CLI scan
Run scans with this command structure:
cortexcli [global flags] [module name] scan [module flags]Place global flags before the module name. Place module flags after scan.
Command components
cortexcli— The Cortex CLI binary.Global flags — Apply across supported modules. Place them between
cortexcliand the module name.--api-base-url <value>--api-key <value>--api-key-id <value>
AppSec and CWP support additional global flags. WAAS does not. See the Cortex CLI common command line reference guide.
Module name — Select the environment to scan.
api— API Security. See Cortex CLI for API Security.image— Cloud Workload Protection (CWP). See Cortex CLI for Cloud Workload Protection.code— Cortex Cloud Application Security. See Cortex CLI for Code Security.
Exit codes and error handling
The Cortex Unified CLI uses standardized exit codes to communicate scan results and execution states.
Standard exit codes
0(Success): The scan executed successfully and no blocking security findings were found1(Scan failed): The scan completed with findings or a general operational failure occurred2(Execution/usage error): An internal error, version mismatch, or CLI configuration/usage error was encountered
For advanced error handling, suppression flags (--soft-fail), and module-specific exit codes, refer to Exit codes and error handling.
Examples
Global flags
Global flags apply to all modules. Place them between cortexcli and the module name.
Global flags for AppSec and CWP
Upload mode, exit-code handling, and log output are not supported by WAAS.
Cortex Cloud Application Security scan
Scan source code for IaC misconfigurations, SCA vulnerabilities, and secrets:
Cloud Workload Protection scan
Scan a container image for vulnerabilities:
API Security scan
Scan APIs for security issues. Global flags (other than authentication) are not supported:
Last updated
Was this helpful?
