Skip to content

kx scan

Resolves the unique container images of a workload and scans each for vulnerabilities, printing a severity summary table.

Requires the CLI for the selected engine. Docker Scout is the default: https://docs.docker.com/scout/ Trivy is available via --engine trivy: https://trivy.dev/ Grype is available via --engine grype: https://github.com/anchore/grype Run ‘kx engine’ to see or change the default.

Unrecognized flags are passed through to kubectl.

Usage

kx scan [OPTIONS] [index] [scanner flags]

Arguments

ArgumentDescription
[index]Row number from the current listing; run kx state to see it

Options

OptionDescription
-A, --all-namespacesSweep every namespace
--engine stringVulnerability scanner to use; run ‘kx engine’ to see available engines and the configured default
--fail-on stringExit 2 when any image carries a vulnerability at this severity or worse (critical, high, medium, low)
--fullStream the scanner’s full output instead of the summary table
--htmlRender the report as HTML and serve it in a browser
--jsonPrint the severity counts and every finding as JSON instead of a table
-n, --namespace stringNamespace to sweep; defaults to the current namespace
--no-openServe the HTML report without opening a browser
--out stringWrite the HTML report to this file instead of serving it in a browser
--port intPort to serve the HTML report on; 0 picks a free one

Global options

OptionDescription
--no-colorDisable styled output
-h, --helpShow this message and exit

Examples

kx scan
kx scan 1
kx scan -n prod
kx scan 1 --full
kx scan --html
kx scan -A --json
kx scan -A --fail-on high --out report.html