Supply Chain

Assess Docker Container Security with cnspec

Scan running and stopped Docker containers for security misconfigurations using cnspec.

Use cnspec to scan running or stopped Docker containers for security misconfigurations, CVEs, and policy violations.

Scan a Docker container

First, find the container ID of the container you want to scan:

docker ps
CONTAINER ID   IMAGE          COMMAND       CREATED          STATUS          NAMES
3b8f29c5e0a2   nginx:latest   "/docker…"   10 minutes ago   Up 10 minutes   web-server

Then scan the container using its ID:

cnspec scan docker 3b8f29c5e0a2
You can only scan Docker containers if the Docker engine is installed.

Scan options

OptionDescription
--asset-nameOverride the asset name
--annotationAdd an annotation to the asset (key=value)
--incognitoRun in incognito mode (do not report results to Mondoo Platform)
-o, --outputSet the output format (compact, full, json, junit, summary, yaml)
-f, --policy-bundlePath to a policy file (local path, s3:// URI, or http(s):// URL)
--policySpecify policies to execute (requires --policy-bundle)
--risk-thresholdExit with status 1 if any risk meets or exceeds this value (0-100)
--sudoElevate privileges with sudo
-j, --jsonReturn the results as JSON

Learn more

On this page