|
This is unreleased documentation for SBOM Scanner 0.9.0-dev. |
Querying SBOM and VulnerabilityReport Resources
In this guide, you’ll learn how to query SBOMscanner resources using metadata fields.
We’ll walk through three major steps:
-
Understand the supported query fields
-
Use
kubectl get --field-selectorto filter the targetImage,SBOMandVulnerabilityReportresources -
Use
kubectl describeto read the full details of a specific report
Supported imageMetadata Fields
Image, SBOM and VulnerabilityReport custom resources share a
common imageMetadata field, which contains metadata about the target
image. These fields are useful when filtering resources with
kubectl get --field-selector.
| Field | Type | Description |
|---|---|---|
|
string |
Name of the |
|
string |
Full URI of the registry where the image is
hosted. Example: |
|
string |
The image repository path. Example:
|
|
string |
The image tag. Example: |
|
string |
The image platform, in OS/ARCH format. Example:
|
|
string |
The SHA256 digest that uniquely identifies the image. |
These fields are available on both
SBOMandVulnerabilityReportresources and are consistent across both kinds.
Query Examples
Now that you know the available fields, let’s walk through a few practical examples.
Example: Get all vulnerability reports from a specific repository and platform
Use the following command to list all VulnerabilityReport resources
for images from the kubewarden/sbomscanner/test-assets/golang
repository, built for the amd64 platform:
kubectl get vulnerabilityreport --field-selector='imageMetadata.repository=kubewarden/sbomscanner/test-assets/golang,imageMetadata.platform=linux/amd64'
Example output:
NAME CREATED AT
dfe56d8371e7df15a3dde25c33a78b84b79766de2ab5a5897032019c878b5932 2025-06-23T04:35:16Z
...
Example: Get SBOMs from the same repository with a specific tag and platform
If you’re looking for the all SBOMs of images tagged 1.12-alpine and
built for amd64, you can run:
kubectl get sboms --field-selector='imageMetadata.repository=kubewarden/sbomscanner/test-assets/golang,imageMetadata.tag=1.12-alpine,imageMetadata.platform=linux/amd64'
Example output:
NAME CREATED AT
dfe56d8371e7df15a3dde25c33a78b84b79766de2ab5a5897032019c878b5932 2025-06-23T04:34:41Z