Detect vulnerabilities in container images

Feature availability
For Container Registry integration, the feature is supported for Node, Ruby, PHP, Python, Go binaries, and Java.
For the CLI and Kubernetes, the feature is supported for Node, PHP, Python, Go binaries, and Java.
Snyk is able to detect in one scan the vulnerabilities in your application dependencies from container images, as well as from the operating system.
After you integrate with a container registry and import your Projects, Snyk scans your image for vulnerabilities.
For application Projects created from images that are imported from container registry integrations, the applications are not re-imported during recurring scans or manual rescans.
Instead, the application dependencies that are found during the initial image import are scanned for new vulnerabilities.
If new dependencies are introduced in an application within an image, they will not be detected by recurring scans or manual rescans.
To detect new or updated applications within images from container registries, you must re-import the image to Snyk.
For applications found in images imported from the Kubernetes integration, existing applications will be re-imported, but new apps added to the image will not be imported during recurring scans.
To detect new applications within images from Kubernetes, you must re-import the image to Snyk.

Enable container registries vulnerability scan

To enable the application vulnerability scan from container registries:
  1. 1.
    Navigate to your container registry integration settings.
  2. 2.
    Enable Detect application vulnerabilities and save the changes.
Enable Detect application vulnerabilties
When you are scanning an image using a container registry or Kubernetes integration, the scan also uses the --app-vulns flag by default. You can opt out of the flag in the container registry only. To do this, disable the Detect application vulnerabilities feature.
  • For Java, when you use the flag, Snyk scans one level of nested jars by default.
  • For Python, Snyk supports Poetry and Pip (in all integration points).
  • For Go binaries, Snyk supports any type of Go binary built with Go module support.

Snyk Container CLI options to detect vulnerabilities

App vulns option

In CLI versions 1.1090.0 (2023-01-24) and higher, Snyk scans for application dependencies in your image by default; you do not need to specify the --app-vulns option.
If you want to opt out of application vulnerability scanning, you can specify the --exclude-app-vulns flag. This omits the application vulnerabilities section from the results, mimicking the previous behavior. The --exclude-app-vulns option is available in CLI version 1.1021.0 and above.

Nested jars depth option

For Java applications, when --app-vulns is enabled, you can also use the --nested-jars-depth=n option to set how many levels of nested jars Snyk will unpack. The implicit default is 1. When you specify 2, it means that Snyk unzips jars in jars; 3 means Snyk unzips jars in jars in jars, and so on.
To opt out of any scans you feel are unnecessary, use --nested-jar-depth=0 .

View vulnerabilities and licensing issues

When the Detect application vulnerabilities feature is enabled, it allows you to see:
  • Dependency vulnerabilities and licensing issues of manifest files detected in your container image
  • Vulnerabilities detected in operating system packages.
When an image is imported to Snyk, it appears under its registry record in the Projects view, showing the operating system vulnerabilities found in your image.
With this feature enabled, you can also see nested manifest files detected in the image and their vulnerabilities and licensing issues.
Images listed in Projects view
Images listed in Projects view

Set up automated scanning

Depending on your Project settings, Snyk scans the image regularly. Based on your configuration, Snyk updates you through email or Slack whenever new vulnerabilities are identified in both the operating system and application dependencies.
You can set the scan frequency for each Project. The default is daily testing. To update the scan frequency, navigate to the Settings tab on the Project page and select the frequency from the dropdown. The options are never, daily, or weekly.
Update scan frequency

Supported container registries

The following container registries are supported:

Supported integrations

The supported languages work with the following integrations:
Container Registry
Go Binaries