Cake.Grype

Cake add-in for Anchore Grype: scan SBOMs, directories and images for vulnerabilities, manage the vulnerability database, and read the JSON report to gate builds on severity, KEV, EPSS, CVSS or risk.

#addin nuget:?package=Cake.Grype&version=0.1.0-preview.1&prerelease

dotnet add package Cake.Grype --version 0.1.0-preview.1

<PackageReference Include="Cake.Grype" Version="0.1.0-preview.1" />

Aliases

Contains functionality for running Anchore Grype, a vulnerability scanner for SBOMs, container images and file systems. Grype must be installed (for example winget install Anchore.Grype) or ToolPath must be set.

Grype

GrypeDbCheck(GrypeDbCheckSettings) Checks whether a newer Grype vulnerability database is available using the specified settings.
GrypeDbCheck() Checks whether a newer Grype vulnerability database is available.
GrypeDbDelete(GrypeDbDeleteSettings) Deletes the local Grype vulnerability database using the specified settings.
GrypeDbDelete() Deletes the local Grype vulnerability database, for example to start a test from a clean cache.
GrypeDbImport(FilePath, GrypeDbImportSettings) Imports a Grype vulnerability database archive from disk using the specified settings.
GrypeDbImport(FilePath) Imports a Grype vulnerability database archive from disk, for offline or air-gapped builds.
GrypeDbImport(Uri, GrypeDbImportSettings) Imports a Grype vulnerability database archive from a URL using the specified settings.
GrypeDbImport(Uri) Imports a Grype vulnerability database archive from a URL. A checksum=sha256:… query parameter is verified by Grype.
GrypeDbStatus(GrypeDbStatusSettings) Gets the status of the local Grype vulnerability database using the specified settings.
GrypeDbStatus() Gets the status of the local Grype vulnerability database. A missing database returns Valid == false with an Error instead of throwing.
GrypeDbUpdate(GrypeDbUpdateSettings) Downloads and installs the latest Grype vulnerability database using the specified settings.
GrypeDbUpdate() Downloads and installs the latest Grype vulnerability database.
GrypeReadJson(FilePath) Reads a Grype JSON report (written with GrypeOutput.Json(file)) for inspection in C#.
GrypeScan(GrypeSource, GrypeScanSettings) Scans a source for vulnerabilities with Grype using the specified settings.
GrypeScan(GrypeSource) Scans a source for vulnerabilities with Grype. A string is passed to Grype unchanged, for example "registry:alpine:3.20".
GrypeScanDirectory(DirectoryPath, GrypeScanSettings) Scans a directory for vulnerabilities with Grype using the specified settings.
GrypeScanDirectory(DirectoryPath) Scans a directory for vulnerabilities with Grype.
GrypeScanFile(FilePath, GrypeScanSettings) Scans a single file for vulnerabilities with Grype using the specified settings.
GrypeScanFile(FilePath) Scans a single file for vulnerabilities with Grype.
GrypeScanImage(string, GrypeScanSettings) Scans a container image for vulnerabilities with Grype using the specified settings.
GrypeScanImage(string) Scans a container image for vulnerabilities with Grype, using Grype's default image lookup.
GrypeScanRegistry(string, GrypeScanSettings) Scans a container image pulled directly from a registry with Grype using the specified settings.
GrypeScanRegistry(string) Scans a container image pulled directly from a registry (no container runtime required) with Grype.
GrypeScanSbom(FilePath, GrypeScanSettings) Scans an SBOM (Syft JSON, CycloneDX or SPDX) for vulnerabilities with Grype using the specified settings.
GrypeScanSbom(FilePath) Scans an SBOM (Syft JSON, CycloneDX or SPDX) for vulnerabilities with Grype.
GrypeVersion(GrypeVersionSettings) Gets Grype's version information using the specified settings.
GrypeVersion() Gets Grype's version information.