Skip to content

About

Catalogue all images of a Kubernetes cluster to multiple targets with Syft

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

247 stars

Watchers

5 watching

Forks

Repository files navigation

sbom-operator

Catalogue all images of a Kubernetes cluster to multiple targets with Syft.

test

Overview

This operator maintains a central place to track all packages and software used in all those images in a Kubernetes cluster. For this a Software Bill of Materials (SBOM) is generated from each image with Syft. They are all stored in one or more targets. Currently Git, Dependency Track, OCI-Registry and ConfigMaps are supported. With this it is possible to do further analysis, vulnerability scans and much more in a single place. To prevent scans of images that have already been analyzed pods are annotated with the imageID of the already processed image.

Kubernetes Compatibility

The image contains versions of k8s.io/client-go. Kubernetes aims to provide forwards & backwards compatibility of one minor version between client and server:

sbom-operator k8s.io/{api,apimachinery,client-go} expected kubernetes compatibility
main v0.34.1 1.33.x, 1.34.x, 1.35.x
0.38.0 v0.34.1 1.33.x, 1.34.x, 1.35.x
0.33.0 v0.30.0 1.29.x, 1.30.x, 1.31.x
0.31.0 v0.29.3 1.28.x, 1.29.x, 1.30.x
0.30.0 v0.28.4 1.27.x, 1.28.x, 1.29.x
0.28.0 v0.27.4 1.26.x, 1.27.x, 1.28.x
0.26.0 v0.26.3 1.25.x, 1.26.x, 1.27.x
0.22.0 v0.25.4 1.24.x, 1.25.x, 1.26.x
0.15.0 v0.24.4 1.23.x, 1.24.x, 1.25.x
0.10.0 v0.23.6 1.22.x, 1.23.x, 1.24.x

However, the operator will work with more versions of Kubernetes in general.

Container Registry Support

The operator relies on the syft-internal mechanism to download images from OCI-compliant registries.

Installation

Manifests

kubectl apply -f deploy/standard/

Helm-Chart

Create a YAML file first with the required configurations or use helm-flags instead.

helm repo add ckotzbauer https://ckotzbauer.github.io/helm-charts
helm install ckotzbauer/sbom-operator -f your-values.yaml

Configuration

All parameters are cli-flags. The flags can be configured as args or as environment-variables prefixed with SBOM_ to inject sensitive configs as secret values.

Common parameters

Parameter Required Default Description
verbosity false info Log-level (debug, info, warn, error, fatal, panic)
cron false "" Backround-Service interval (CRON). See Trigger for details.
ignore-annotations false false Force analyzing of all images, including those from annotated pods.
format false json SBOM-Format. (One of json, syftjson, cyclonedxjson, spdxjson, github, githubjson, cyclonedx, cyclone, cyclonedxxml, spdx, spdxtv, spdxtagvalue, text, table)
format-version false (see below) SBOM-Format-Version. Overrides the Syft encoder specification version for version-aware families (cyclonedxjson, cyclonedxxml, spdxjson, spdxtagvalue). Flag can be set via SBOM_FORMAT_VERSION env var or formatVersion in YAML. See Format Versions for the complete supported-matrix.
targets false git Comma-delimited list of targets to sent the generated SBOMs to. Possible targets git, dtrack, oci, configmap. Ignored with a job-image
pod-label-selector false "" Kubernetes Label-Selector for pods.
namespace-label-selector false "" Kubernetes Label-Selector for namespaces.
fallback-pull-secret false "" Kubernetes Pull-Secret Name to load as a fallback when all others fail (must be in the same namespace as the sbom-operator)
registry-proxy false [] Proxy-Registry-Hosts to use. Flag can be used multiple times. Value-Mapping e.g. docker.io=ghcr.io
delete-orphan-images false true Delete orphan images automatically
strip-cpes false false Strip CPE attributes from all components in generated SBOMs (Syft-JSON cpes, CycloneDX cpe). Disables Syft CPE generation and removes cataloger-sourced CPEs. Flag can be set via SBOM_STRIP_CPES env var or stripCpes in YAML.
fetch-oci-attestations false false Fetch SBOMs from OCI attestations via cosign (Main SBOM of image & optional configured additional SBOMs). In case main SBOM from image can't be found, falls back to syft generation. Flag can be set via FETCH_OCI_ATTESTATIONS env var or fetchOciAttestations in YAML.
insecure-http-registry false false Use HTTP instead of HTTPS for any connection to registry (downloading of attestation/image). Useful for development purposes. Flag can be set via INSECURE_HTTP_REGISTRY env var or insecureHttpRegistry in YAML.
retry-interval false 5m Interval at which pods with failed scans/uploads are retried in informer mode. 0s disables retries. Flag can be set via SBOM_RETRY_INTERVAL env var or retryInterval in YAML.
syft-catalogers false [] Configure Syft cataloger selection expressions (comma-separated). Supports exact selection (golang,javascript), adding (+sbom-cataloger), and removing (-java-archive-cataloger) catalogers.
syft-catalogers-scope-rules false [] Mapping rules to select Syft catalogers based on OCI attestation scopes using contains logic (format: scope-substring:cataloger1,cataloger2).

Fetching SBOM from OCI

In case parameter flag fetch-oci-attestations is set, following applies: SBOMs can be uploaded through cosign/oras to the image. e.g. cosign attest --type cyclonedx --predicate sbom.json $IMAGE. sbom-operator now will try to find that SBOM attestation and in case it finds it uses it. Otherwise will fallback to syft generation of SBOM. If a target can't use the format of the fetched SBOM (e.g. Dependency-Track only accepts CycloneDX), that target gets an SBOM generated by syft instead, in the format set by --format. There can be also multiple SBOMs attached as attestation in the image using the annotation dev.sigstore.sbom.scope.

Example

oras attach "localhost:5000/my-nginx:dev" \
  --artifact-type application/vnd.cyclonedx+json \
  --annotation "dev.sigstore.sbom.scope=application" 
  sbom.json:application/vnd.cyclonedx+json

Currently only Dependency-Track target would support additional SBOMs to be uploaded. How to map the sbom.scope to the project name can be found in the Dependency-Track section.

Format Versions

The --format-version flag (env: SBOM_FORMAT_VERSION, YAML: formatVersion) pins the CycloneDX or SPDX specification version used by the embedded Syft encoder. It only applies when --format selects a version-aware family; for non-version-aware formats (json, syftjson, text, table, github) the flag is silently accepted and Syft defaults are used.

Configuring Syft Catalogers

By default, the operator runs Syft's standard image cataloger set. You can customize which catalogers are executed during image scanning via --syft-catalogers (or SBOM_SYFT_CATALOGERS).

The option accepts a comma-separated list of Syft cataloger names or tags using three expression types:

  • <name-or-tag> (Select): Restricts scanning exclusively to the specified catalogers or language/OS tags.
  • +<name> (Add): Keeps the default catalogers and enables additional catalogers that are disabled by default.
  • -<name-or-tag> (Remove): Keeps the default catalogers except for the excluded catalogers or tags.

Scope-Based Cataloger Rules (--fetch-oci-attestations)

When --fetch-oci-attestations is enabled and an image does not provide a full all-scope attestation, the operator runs Syft to generate the all-scope SBOM. You can customize which catalogers Syft uses based on the scopes of the OCI attestations already found on that image via --syft-catalogers-scope-rules (SBOM_SYFT_CATALOGERS_SCOPE_RULES / YAML syftCatalogersScopeRules) using the format <scope-pattern>:<catalogers>:

  • Matching semantics: <scope-pattern> is matched using case-insensitive substring matching (strings.Contains) against each attestation scope on the image (so avoid overly short patterns like a, which would match both application and infra).
  • Precedence & evaluation order: Rules are evaluated in the order they are configured. The first matching rule wins for the entire image and fully overrides --syft-catalogers (no merge).
  • Fallback: Apply --syft-catalogers if set or do a full default Syft scan.
  • Partial all-scope SBOMs: Note that when catalogers are restricted (via --syft-catalogers or a matching scope rule), the resulting all-scope SBOM generated by Syft is intentionally partial (containing only components discovered by the selected catalogers, such as OS packages).

Configuration Examples

1. Excluding Slow or Unwanted Catalogers from Defaults

To use all default catalogers while skipping deep Java archive inspection and binary classification:

# Environment variable
SBOM_SYFT_CATALOGERS: "-java-archive-cataloger,-binary-classifier-cataloger"

# Or via CLI flag
--syft-catalogers="-java-archive-cataloger,-binary-classifier-cataloger"
2. Restricting Scans to OS Packages and Go Binaries Only

To speed up scans in clusters running only Go microservices on Alpine/Debian base images:

SBOM_SYFT_CATALOGERS: "alpine,debian,golang"
3. Enabling Optional Catalogers Alongside Defaults

To keep all default catalogers and additionally discover nested SBOM files inside container images:

SBOM_SYFT_CATALOGERS: "+sbom-cataloger"
4. Selecting OS Catalogers When an application Attestation Scope Is Present

To scan only OS packages (os,alpine) when an image already provides an application-scoped OCI attestation, and golang when an infra attestation is present:

# In YAML config file (recommended for multiple rules)
syftCatalogersScopeRules:
  - "application:os,alpine"
  - "infra:golang"

# Or via Environment Variable / CLI flag
SBOM_SYFT_CATALOGERS_SCOPE_RULES: "application:os,alpine,infra:golang"

Family / Alias Matrix

Family Canonical alias Aliases Version-aware? Default source
CycloneDX JSON cyclonedxjson — Yes Bundled Syft
CycloneDX XML cyclonedxxml cyclonedx, cyclone Yes Bundled Syft
SPDX JSON spdxjson — Yes Bundled Syft
SPDX Tag-Value spdxtagvalue spdx, spdxtv Yes Bundled Syft
Syft JSON json, syftjson — No —
Plain output text, table — No —
GitHub github, githubjson — No —

Exact supported revisions and defaults come from the Syft version bundled in each operator release. Run sbom-operator --help to see the authoritative values for the installed binary.

Usage Examples

CLI flag (explicit CycloneDX 1.3 JSON):

sbom-operator --format=cyclonedxjson --format-version=1.3

Environment variable (SPDX 2.3):

export SBOM_FORMAT_VERSION=2.3
sbom-operator --format=spdxjson

Helm YAML:

args:
  format: cyclonedxxml
  formatVersion: "1.5"

Invalid Combinations

Starting the operator with a version not supported by the selected family produces a hard Fatal error before any Kubernetes runtime initialization. The error includes the requested family, rejected version, and the versions supported by the bundled Syft release.

Unknown Format Fallback

An unknown format name (not in the alias matrix) with an omitted or whitespace-only format-version delegates to Syft's default JSON encoder, preserving backward compatibility with custom format strings:

sbom-operator --format=custom-format --format-version=""

When an unknown format is paired with a version-like string (e.g. --format-version=1.2), the version is resolved to its family (CycloneDX 1.2 → cyclonedxjson) and the operator logs the concrete effective version at startup.

Example Helm-Config

args:
  targets: git
  git-author-email: XXX
  git-author-name: XXX
  git-repository: https://github.com/XXX/XXX
  git-path: dev-cluster/sboms
  verbosity: debug
  cron: "0 30 * * * *"

envVars:
  - name: SBOM_GIT_ACCESS_TOKEN
    valueFrom:
      secretKeyRef:
        name: "sbom-operator"
        key: "accessToken"

Analysis-Trigger

Cron

With the cron flag set, the operator runs with a specified interval and checks for changed images in your cluster. All options from github.com/robfig/cron are allowed as cron-syntax.

Real-Time

When you omit the cron flag, the operator uses a Cache-Informer to process changed pods immediately. In this mode there's also a one-time analysis at startup to sync the targets with the actual cluster-state. If you configured a job-image there's no initial startup sync.

AWS ECR (IRSA / Pod Identity)

When images are hosted in private AWS Elastic Container Registry (*.dkr.ecr.*.amazonaws.com) and no pull secrets are configured on the pod, sbom-operator automatically obtains a registry token via the AWS SDK default credentials chain. IRSA, EKS Pod Identity, and EC2 instance roles are all supported transparently. The required IAM permission for the operator's role is ecr:GetAuthorizationToken. For successful image layer pulls, the role also needs ecr:BatchGetImage and ecr:GetDownloadUrlForLayer on the relevant repositories.

ECR Public (public.ecr.aws/*) and cross-account ECR via assume-role are not supported by this auto-detection. Use --fallback-pull-secret for those scenarios.

Targets

It is possible to store the generated SBOMs to different targets (even multple at once). All targets are using Syft as analyzer. If you want to use another tool to analyze your images, then have a look at the Job image section. Images which are not present in the cluster anymore are removed from the configured targets (except for the OCI-Target).

Dependency Track

Dependency Track Parameter

Parameter Required Default Description
dtrack-base-url true when dtrack target is used "" Dependency-Track base URL, e.g. 'https://dtrack.example.com'
dtrack-api-key true when dtrack target is used, unless dtrack-wif-token-file is set "" Dependency-Track API key
dtrack-wif-token-file false "" Path of a projected service account token. Enables workload identity federation instead of an API key
dtrack-wif-provider true when dtrack-wif-token-file is provided "" Name of the workload identity provider in Dependency-Track
dtrack-wif-service-account true when dtrack-wif-token-file is provided "" Name of the Dependency-Track service account the token is exchanged for
dtrack-wif-jwt-header false "" Also send the workload identity token in this request header on every request, e.g. x-workload-token for a proxy in front of Dependency-Track that validates it
dtrack-label-tag-matcher false "" Dependency-Track Pod-Label-Tag matcher regex
dtrack-ca-cert-file false "" CA-Certificate filepath when using mTLS to connect to dtrack
dtrack-client-cert-file true when dtrack-ca-cert-file is provided "" Client-Certificate filepath when using mTLS to connect to dtrack
dtrack-client-key-file true when dtrack-ca-cert-file is provided "" Client-Key filepath when using mTLS to connect to dtrack
dtrack-default-parent-project false "" The default parent project UUID that should be used. This is overwritten in case a parent project annotation is set and found
dtrack-use-short-name false "" Use short image name (without registry) for project names
dtrack-templated-project-name false "" The (default) project name using a go template.
dtrack-kubernetes-cluster-id-mode false "tag" Mode for using the kubernetes-cluster-id. Options: "tag" (adds cluster ID as a project tag) or "prefix" (prefixes the project name with the cluster ID). "tag-namespace" (Adds cluster ID and namespace as project tag, like <kubernetes-cluster-id>/<cluster-namespace>. Needed for a multi-namespace, multi-cluster setup, where the namespace in different clusters are same)
dtrack-parent-project-annotation-key false "" Kubernetes pod annotation key to set parent project automatically, e.g. "my.pod.annotation"
dtrack-project-name-annotation-key false "" Kubernetes pod annotation key to set custom dtrack project name automatically, e.g. "my.pod.annotation"
dtrack-manage-project-active-status true when enabled without parent config false Manage project active/isLatest status based on running pods. Orphans are deactivated instead of deleted. Requires a parent project.
kubernetes-cluster-id false "default" Kubernetes Cluster ID (to be used in Dependency-Track or Job-Images)
dtrack-deployment-history false false Track deployment timestamps as ISO-8601-1:2019 intervals in Dependency-Track project properties and retain a persistent deployed-stage=<stage> tag on projects to record which stages were active at any point in time (useful for quick API v2 retrieval).

Each image in the cluster is created as project with the full-image name (registry and image-path without tag) and the image-tag as project-version. When there's no image-tag, but a digest, the digest is used as project-version. The autoCreate option of DT is used. Dependency-Track only accepts CycloneDX, so --format must be cyclonedx (or cyclone, cyclonedxxml, cyclonedxjson, or a CycloneDX --format-version) with this target. The operator refuses to start otherwise (not checked with --job-image, where the job image creates the SBOMs).

Upgrade note: earlier versions started with any --format and then failed every upload of a non-CycloneDX SBOM to Dependency-Track, retrying forever. They now refuse to start instead. --format applies to all targets, so when git, oci or configmap run next to dtrack, they get CycloneDX as well.

Dependency-Track workload identity federation

Instead of a long-lived API key, the operator can authenticate with its Kubernetes service account token (workload identity federation, Dependency-Track 5.2.0 or newer). The operator reads a projected service account token and exchanges it at /api/v2/oauth/token for a Dependency-Track session, which it sends as Authorization: Bearer. The session is reused for all operations (uploading SBOMs, loading projects, removing orphans) until shortly before it expires (expires_in of the token response); then the operator reads the token file again and exchanges a new one. If Dependency-Track rejects the session with 401, the next operation exchanges a new one.

The session lifetime is configured in Dependency-Track and is a trade-off: a shorter lifetime means removing the binding takes effect sooner, at the cost of more exchanges. To cut off the operator immediately, suspend its Dependency-Track service account; this ends its existing sessions.

In Dependency-Track, create:

  • a workload identity provider for the cluster's service account issuer, with a dedicated audience such as dependency-track (use discovery or a JWKS URL if the issuer is publicly reachable, otherwise paste the cluster's JWK Set from kubectl get --raw /openid/v1/jwks),
  • a service account with the permissions the operator needs (the same ones an API-key team would get),
  • a binding of that service account to the subject system:serviceaccount:<operator-namespace>:<operator-service-account>.

Then configure the operator with a projected token for that audience, for example with the Helm chart:

args:
  dtrack-base-url: https://dtrack.example.com
  dtrack-wif-token-file: /var/run/secrets/dependency-track/token
  dtrack-wif-provider: kubernetes
  dtrack-wif-service-account: sbom-operator
extraVolumes:
  - name: dependency-track-token
    projected:
      sources:
        - serviceAccountToken:
            audience: dependency-track
            expirationSeconds: 600
            path: token
extraVolumeMounts:
  - name: dependency-track-token
    mountPath: /var/run/secrets/dependency-track
    readOnly: true

Project Name & Version Resolution (Templating & Annotations)

Project naming supports GO templates, including Sprig functions.

For the Dependency-Track target, the operator resolves the project name and version (<name>:<version>) using a 4-stage enrichment pipeline. Each stage has access to the resolved name and version from the previous stage via {{.PredefinedName}} and {{.PredefinedVersion}}.

Resolution Hierarchy (Lowest to Highest Priority)

  1. Image Fallback (Default): Extracts the repository name (or short name if --dtrack-use-short-name is enabled) and image tag/digest.
  2. Global Cluster Template (--dtrack-templated-project-name / SBOM_DTRACK_TEMPLATED_PROJECT_NAME): If configured, evaluates a Go text/template across all images in the cluster.
  3. Pod-Wide Annotation (--dtrack-project-name-annotation-key): Evaluates the annotation <annotation-key> on the Pod. Applies to all containers in the Pod unless overridden by a container-specific annotation.
  4. Container-Specific Annotation (<annotation-key>/<container-name>): Evaluates the annotation targeting a specific container within the Pod. Always takes precedence over the pod-wide annotation.

Note: Both the global cluster configuration and the pod annotations support Go text/template syntax and expect the rendered output in the format <project-name>:<project-version>. If a stage fails to parse or evaluates to an empty string, the operator safely falls back to the result of the previous stage.

Note: In case no version is defined at all, it falls back to version latest


Available Template Fields (TemplateData)

The following fields are available in both --dtrack-templated-project-name and pod annotations:

Field Type Description Example
.PredefinedName string The project name resolved by the preceding stage in the hierarchy. eu-prod-order-service
.PredefinedVersion string The project version resolved by the preceding stage in the hierarchy. 1.4.2
.Namespace string The Kubernetes namespace of the scanned Pod. production
.ShortName string The short image name without registry or repository path. order-service
.Repository string The full image repository path (excluding tag/digest). ghcr.io/my-org/order-service
.ImageName string The full image reference as specified in the Pod spec. ghcr.io/my-org/order-service:1.4.2
.ImageId string The resolved image digest reference. ghcr.io/my-org/order-service@sha256:...
.Tag string The image tag (or digest if deployed purely by digest). 1.4.2
.Digest string The image digest (empty if not present). sha256:...
.ContainerNames []string Slice of container names sharing the image in the Pod. ["order-api", "migrations"]
.SbomScope string The scope of the processed SBOM attestation. all

Configuration Examples

1. Enforcing a Cluster-Wide Naming Convention

To prefix every project in Dependency-Track with its Kubernetes namespace while keeping the original image version:

# Operator configuration (CLI flag or Environment Variable)
SBOM_DTRACK_USE_SHORT_NAME: "true"
SBOM_DTRACK_TEMPLATE_PROJECT_NAME: "{{.Namespace}}-{{.ShortName}}:{{.PredefinedVersion}}"

Result for ghcr.io/my-org/order-service:1.4.2 in namespace payment: payment-order-service (Version: 1.4.2)

2. Overriding Only the Version via Pod Annotation (Chaining)

Because .PredefinedName holds the result of the global cluster template, a Pod can override only the version via annotation while preserving the global naming convention:

apiVersion: v1
kind: Pod
metadata:
  name: order-service
  namespace: payment
  annotations:
    # Keeps "payment-order-service" from the global template, but overrides version
    dtrack.project.name: "{{.PredefinedName}}:2026.10-release"

Result: payment-order-service (Version: 2026.10-release)

3. Pod-Wide Default with Container-Specific Override

In multi-container Pods, you can combine a pod-wide annotation with a container-specific annotation (<key>/<container-name>). The container-specific annotation always takes precedence for that container:

apiVersion: v1
kind: Pod
metadata:
  name: checkout-pod
  namespace: shop
  annotations:
    # Default for all containers in this Pod
    dtrack.project.name: "shop-checkout-default:{{.Tag}}"
    # Override specifically for the "checkout-api" container
    dtrack.project.name/checkout-api: "shop-checkout-backend:2.1.0"
spec:
  containers:
    - name: checkout-api
      image: ghcr.io/my-org/checkout:2.1.0
    - name: envoy-sidecar
      image: envoyproxy/envoy:v1.29.0

Result for checkout-api: shop-checkout-backend (Version: 2.1.0) Result for envoy-sidecar: shop-checkout-default (Version: v1.29.0)

Setting parent project at Dependency Track automatically:

The key at kubernetes has to be suffixed with the container name the parent project is for. e.g. my.parent.project/my-nginx. The value for the parent project annotation at the specific Pod is written in the format of project:version or just project. The version is optional: collection projects (parents that only aggregate children) usually do not carry a version, so a bare name like MyParentProject is sufficient. If a version is provided, e.g. MyParentProject:1.0, the parent project is matched by name and version.

Important

The suffix regarding container name must not be added to the config value and must not include /. e.g. my.parent.project


Project active/inactive lifecycle management

When --dtrack-manage-project-active-status is enabled, the operator manages project active/isLatest state in Dependency Track:

  • Running version: set Active=true, IsLatest=true
  • Sibling versions under the same parent (matched by project name): set Active=false, IsLatest=false if running in no cluster anymore
  • Orphaned projects (no longer running in any cluster): deactivated instead of deleted, preserving version history. The global --delete-orphan-images flag is bypassed for dtrack when this is active.
  • Rollback: when a pod rolls back to a previously deployed image with a matching digest, the inactive project is reactivated without re-uploading the BOM.

A parent project is required — either --dtrack-parent-project-annotation-key or --dtrack-default-parent-project. In multi-cluster tag mode, the current cluster's tag is removed first and the project is only deactivated if no other clusters are still using it.

Note: Requires Dependency Track v4.12.0+ for the isLatest field.

Note: Project deactivation and tag cleanup use the PATCH /api/v1/project/{uuid} endpoint, which requires Dependency-Track 4.8 or newer. --dtrack-deployment-history is opt-in (false by default).


Example Pod Annotation:

apiVersion: v1
kind: Pod
metadata:
  annotations:
    my.parent.project/my-nginx: MyParentProject
    my.project.name/my-nginx: MyNginxProject:1.0
    my.parent.project/my-sidecar: MyOtherParentProject
    my.project.name/my-sidecar: MySidecarProject:1.0.1
spec:
  containers:
    - image: nginx:latest
      name: my-nginx
    ...
    - image: some-other-image:latest
      name: my-sidecar
    ...
...

sbom-operator config:

--dtrack-parent-project-annotation-key=my.parent.project
--dtrack-project-name-annotation-key=my.project.name

Deployment Timestamp Tracking

When --dtrack-deployment-history (SBOM_DTRACK_DEPLOYMENT_HISTORY=true) is enabled, the SBOM Operator automatically tracks deployment intervals for projects in Dependency-Track by maintaining ISO-8601-1:2019 time intervals as Project Properties inside the deployment-timestamp property group and retaining a persistent deployed-stage=<stage> tag on the project.

Purpose

KPI calculations like Mean Time to Remediation (MTTR) or SLA compliance can be done using that data.

How It Works

  1. Active Deployments (start/..) & Persistent Stage Tag: When an SBOM is processed for an active image in a Kubernetes cluster (or namespace), the operator attaches a persistent deployed-stage=<stage> tag and ensures a deployment property exists. If a deployment is newly seen (or re-deployed after a previous interval was closed), an open-ended ISO-8601 time interval (e.g., 2026-10-30T18:00:00Z/..) is created or appended.
  2. Orphan Cleanup & Deactivation (start/end): When pods or namespaces scale down and an image is no longer running in a specific cluster or namespace, the operator removes the active kubernetes-cluster=<stage> / namespace=<ns> tags, retains the deployed-stage=<stage> history tag, and automatically closes the active deployment interval for that stage by appending the current timestamp (e.g., 2026-10-30T18:00:00Z/2026-10-30T18:02:45Z).

Property & Tag Configuration Details

  • Persistent Stage Tag: deployed-stage=<cluster-id> (in tag or prefix mode) or deployed-stage=<cluster-id>/<namespace> (in tag-namespace mode). This tag remains on the project even after deactivation (or if --dtrack-deployment-history is later disabled) so historical deployments can be queried efficiently via Dependency-Track API v2 (tags_all).
  • Property Group Name: deployment-timestamp
  • Property Name: Matches the configured cluster ID (e.g., my-cluster) in tag or prefix mode, or the namespaced stage identifier (e.g., my-cluster/production) in tag-namespace mode.
  • Property Value Format: Comma-separated ISO-8601-1:2019 interval string (start-time/end-time or an open-ended interval start-time/.. while active).
# Example Dependency-Track Project Property Entry
GroupName: deployment-timestamp
PropertyName: my-cluster-prod/payment-ns
PropertyValue: 2026-10-01T08:30:00Z/2026-10-30T18:00:00Z,2026-10-31T09:00:00Z/..
Description: ISO-8601 deployment intervals in stage my-cluster-prod/payment-ns

Git

Git Parameter

Parameter Required Default Description
git-workingtree false /work Directory to place the git-repo.
git-repository true when git target is used. "" Git-Repository-URL (HTTPS).
git-branch false main Git-Branch to checkout.
git-path false "" Folder-Path inside the Git-Repository.
git-author-name true when git target is used. "" Author name to use for Git-Commits.
git-author-email true when git target is used. "" Author email to use for Git-Commits.
git-access-token false "" Git-Personal-Access-Token with write-permissions.
git-username false "" Git-Username
git-password false "" Git-Password
github-app-id false "" GitHub App-ID.
github-app-installation-id false "" GitHub App-Installation-ID.

The operator will save all files with a specific folder structure as described below. When a git-path is configured, all folders above this path are not touched from the application. Assuming that git-path is set to dev-cluster/sboms. When no git-path is given, the structure below is directly in the repository-root. The structure is basically <git-path>/<registry-server>/<image-path>/<image-digest>/sbom.json (see example below). The file-extension may differ when another output-format is configured. You can use a token-based authentication (e.g. a PAT for GitHub) with --git-access-token, BasicAuth with username and password (--git-username, --git-password) or Github App Authentication (--github-app-id, --github-app-installation-id, env: SBOM_GITHUB_APP_PRIVATE_KEY) The private-key has to be Base64 encoded.

Note: It is required, that the specified branch of the repo is fully initialized. There's no logic which creates a non-existent branch. Just commit a README.md or something similar, to make things work.

dev-cluster
│
└───sboms
    │
    └───docker.io
    |   │
    |   └───library
    |       │
    |       └───busybox
    |           │
    |           └───sha256_ae39a6f5...
    |               │   sbom.json
    |
    └───ghcr.io
        │
        └───kyverno
            │
            └───kyverno
            |   │
            |   └───sha256_9e3f14e5...
            |       │   sbom.json
            |
            └───kyvernopre
                │
                └───sha256_e48f87fd...
                    │   sbom.json
            |
            └───policy-reporter
                │
                └───sha256_b70caa7a...
                    │   sbom.json

OCI-Registry

OCI-Registry Parameter

Parameter Required Default Description
oci-registry true when oci target is used "" OCI-Registry
oci-user true when oci target is used "" OCI-User
oci-token true when oci target is used "" OCI-Token

In this mode the operator will generate a SBOM and store it into an OCI-Registry. The SBOM then can be processed by cosign, Kyverno or any other tool. E.g.:

COSIGN_REPOSITORY=<yourregistry> cosign download sbom <your full image digest>

The operator needs the Registry-URL, a user and a token as password to authenticate to the registry. Write-permissions are needed.

ConfigMap

This target stores the SBOM as Kubernetes-ConfigMap. They are placed in the same namespace as the corresponding pod and the name consists of the pod- and container-name. The configmap is labeled with ckotzbauer.sbom-operator.io=true and annotated with ckotzbauer.sbom-operator.io/image-id=<full-image-repo-with-digest>. The content is stored as brotli-compressed binary-data with the configmap-key sbom.

Job-Images

Job-Image Parameter

Parameter Required Default Description
job-image false "" Job-Image to process images with instead of Syft
job-image-pull-secret false "" Pre-existing pull-secret-name for private job-images
job-timeout false 3600 Job-Timeout in seconds (activeDeadlineSeconds)
kubernetes-cluster-id false "default" Kubernetes Cluster ID (to be used in Dependency-Track or Job-Images)

If you don't want to use Syft to analyze your images, you can give the Job-Image feature a try. The operator creates a Kubernetes-Job which does the analysis with any possible tool inside. There's no target-handling done by the operator, the tool from the job has to process the SBOMs on its own. Currently there are two possible integrations:

Tool Description
Codenotary VCN The VCN-Tool from Codenotary can notarize your images in the Codenotary Cloud. (chargeable)

This feature is built as generic approach. Any image which follows these specs can be used as job-image.

e.g. Manifest (deploy/job-image):

--job-image=ghcr.io/ckotzbauer/sbom-operator/vcn:<TAG>

e.g. Helm:

jobImageMode: true

envVars:
  - name: SBOM_JOB_VCN_LC_API_KEY
    value: "<KEY>"

All operator-environment variables prefixed with SBOM_JOB_ are passed to the Kubernetes job.

Security

The docker-image is based on a scratch-image to reduce the attack-surface and keep the image small. Furthermore the image and release-artifacts are signed with cosign and attested with provenance-files. The release-process satisfies SLSA Level 2. All of those "metadata files" are also stored in a dedicated repository ghcr.io/ckotzbauer/sbom-operator-metadata. When discovering security issues please refer to the Security process.

Signature verification

COSIGN_EXPERIMENTAL=1 COSIGN_REPOSITORY=ghcr.io/ckotzbauer/sbom-operator-metadata cosign verify ghcr.io/ckotzbauer/sbom-operator:<tag-to-verify> --certificate-github-workflow-name create-release --certificate-github-workflow-repository ckotzbauer/sbom-operator

Attestation verification

COSIGN_EXPERIMENTAL=1 COSIGN_REPOSITORY=ghcr.io/ckotzbauer/sbom-operator-metadata cosign verify-attestation ghcr.io/ckotzbauer/sbom-operator:<tag-to-verify> --certificate-github-workflow-name create-release --certificate-github-workflow-repository ckotzbauer/sbom-operator

Download attestation

COSIGN_REPOSITORY=ghcr.io/ckotzbauer/sbom-operator-metadata cosign download attestation ghcr.io/ckotzbauer/sbom-operator:<tag-to-verify> | jq -r '.payload' | base64 -d

Download SBOM

COSIGN_REPOSITORY=ghcr.io/ckotzbauer/sbom-operator-metadata cosign download sbom ghcr.io/ckotzbauer/sbom-operator:<tag-to-verify> | jq -r '.payload' | base64 -d

Contributing

Please refer to the Contribution guildelines.

Code of conduct

Please refer to the Conduct guildelines.

About

Catalogue all images of a Kubernetes cluster to multiple targets with Syft

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

247 stars

Watchers

5 watching

Forks

Releases

Packages

Used by

Contributors

Languages