Skip to content
SHC Docs

shc scan

scan app and deployment images for vulnerabilities

Scan images by sha256 digest using the local vulnerability database. Deployment scope follows inspect through -t, -e and -s, with prod as the default environment. Use shc scan -s app or shc scan -s db for deployments named app or db.

-o accepts [=], comma-separated, with at most one stdout output. Formats are cyclonedx, json, sarif and text. The default is CycloneDX 1.6 JSON. Example: shc scan corp-demo -o cyclonedx=bom.json,sarif=scan.sarif --fail-on high

Exit codes: 0 complete with no threshold finding, 4 threshold finding, 1 failed or incomplete. Every resolved image stays in the report, including unscanned images and their reasons. Images are pulled from registries with Docker credentials, using linux/amd64 for index digests. A missing database or one older than five days refreshes from its last source. If refresh fails, import an archive with shc scan db update . Each app package declares advisories.yaml: the OSV package or vendor feed its own version is matched against, or none: with the reason it has none. A missing or bad file refuses an app scan and leaves a deployment scan unscanned. That lookup needs network access, and an app whose source fails or whose patch version is unknown stays unscanned.

shc scan [deployment] [flags]
--fail-on string exit 4 at or above critical, high, medium, low or negligible
-h, --help help for scan
--config stringArray extra YAML config file to layer on top of auto-discovered config; repeatable, later files win
-d, --debug enable debug mode (default: $SHC_DEBUG)
-e, --environment string environment name (default: "prod", or "default" on an estate with no licence and no trial; $SHC_ENVIRONMENT and shc ctx -e override it, and the "master" tenant is always "default")
--exclude string comma-separated dotted paths to drop
--fields string comma-separated columns/keys to show (and their order)
--filter string comma-separated dotted paths to keep (drops everything else)
-o, --output string output format: tty|text|json|yaml (default: $SHC_OUTPUT)
-s, --stack string stack name (default: $SHC_STACK)
-t, --tenant string tenant name (default: $SHC_TENANT)
-v, --verbose verbose output (default: $SHC_VERBOSE)
  • shc - Selfhosted Cloud CLI
  • shc scan app - scan every runtime image of a local or catalog app
  • shc scan db - manage the vulnerability database