Scan targets
kubescape scan
Scan the cluster in your kubeconfig
kubescape scan <path>
Scan local YAML files or a directory
kubescape scan <git-url>
Scan a Git repository
kubescape scan <chart-dir>
Scan a Helm chart directory
--values <file>
Use a Helm values file when rendering
--set <key=value>
Override a Helm value
kubescape scan <kustomize-dir>
Scan a Kustomize directory
kubescape scan image <image>
Scan an image for vulnerabilities
kubescape scan image --username <u> --password
<p> <image>
Scan from a private registry
--kubeconfig <file>
Use another kubeconfig
--include-namespaces <list>
Scan only these namespaces
--exclude-namespaces <list>
Skip these namespaces
Frameworks and controls
kubescape scan framework <name>
Run all controls of a framework
kubescape scan framework nsa
NSA-CISA hardening guide
kubescape scan framework mitre
MITRE ATT&CK for Kubernetes
kubescape scan framework nsa,mitre
Run several frameworks at once
kubescape scan control <id>
Run a single control, e.g. C-0017
kubescape scan control "<name>"
Select a control by its name
kubescape list controls
List available controls
kubescape list frameworks
List available frameworks
kubescape download controls-inputs
Fetch the tunable control parameters
--controls-config <file>
Scan with edited control parameters
Output
--format json --output <file>
Machine-readable report
--format sarif --output <file>
SARIF for code scanning
Documented for local files and Git targets only.
--format junit --output <file>
JUnit XML for CI test views
--format html --output <file>
Shareable HTML report
--format pdf --output <file>
PDF report
--format markdown --output <file>
Markdown report
--format csv --output <file>
CSV report
--format json,html --output <prefix>
Several formats in one run
--format-version v2
Recommended JSON schema version
--hide
Pseudonymize sensitive metadata
--encrypt
Encrypt metadata with KUBESCAPE_MASTER_KEY
kubescape decrypt <report.json>
Decrypt an encrypted report
Exceptions
--exceptions <file>
Apply accepted-risk exceptions
posturePolicies
Controls or frameworks to exclude
resources
Match by kind, name, namespace or labels
actions: ["alertOnly"]
The only supported exception action
Exclude a control in one namespace
[{"name": "allow-hostpath", "policyType": "postureExceptionPolicy", "actions": ["alertOnly"], "resources": [{"designatorType": "Attributes", "attributes": {"namespace": "monitoring"}}], "posturePolicies": [{"controlID": "C-0060"}]}]
Fix, patch and policy
kubescape fix <report.json>
Auto-fix manifests from a JSON report
kubescape fix <report.json> --dry-run
Preview fixes without writing
kubescape fix <report.json> --no-confirm
Apply all fixes without asking
kubescape patch --image <image>
Patch OS vulns in an image
Needs a running buildkitd.
kubescape vap deploy-library
Print the ValidatingAdmissionPolicy library
kubescape vap create-policy-binding -n <name> -p
<control>
Bind a policy to namespaces
kubescape predict pss -n <namespace>
Predict Pod Security Standard level
kubescape operator scan configurations
Trigger a scan via the in-cluster operator
Config and offline
kubescape config view
Show stored configuration
kubescape config set <key> <value>
Set a config value
kubescape config delete
Remove stored configuration
kubescape download artifacts --output <dir>
Save frameworks and controls for offline use
--use-artifacts-from <dir>
Scan using saved artifacts
kubescape download framework <name> --output
<file>
Save one framework
--use-from <file>
Scan with a saved framework file
kubescape version
Print version
kubescape mcpserver
Start the MCP server
kubectl krew install kubescape
Install as a kubectl plugin