Skip to main content

CWL 2 SBOM

Generate local CycloneDX SBOMs for the containers declared by a CWL workflow using Trivy. Bootstrapped from the Transpiler-Mate plugin project template.

Install

Python 3.10+ and an installed Trivy executable are required. From this checkout:

pip install transpiler-mate-runtime .

Generate

transpiler-mate cwl2sbom --platform linux/amd64 --output sbom \
  workflow.cwl#main

For the workspace example:

transpiler-mate cwl2sbom --platform linux/amd64 \
  --output tmp/build/burned-area-severity/sbom \
  tmp/burned-area-severity.cwl#burned-area-severity

An explicit CWL entrypoint and platform are required. Trivy downloads and inspects images directly from their registries; no Docker daemon or container execution is involved. Registry authentication uses Trivy's normal configuration. Install Trivy separately; the plugin does not download executables.

Output Contents
workflow.cdx.json CycloneDX 1.5 workflow → tool invocation → container inventory
images/*.cdx.json Original Trivy SBOM for each distinct image reference and platform
images.lock.json Original references, reported repository digests and image IDs, platform, step associations, checksums, and generator versions
coverage.json Covered declarations, uncovered tools, and expression tools

Image filenames hash the original reference and platform, avoiding registry aliases and unsafe filename characters. Repeated references are inspected once per invocation. Different aliases may be inspected separately, even if they ultimately resolve to the same image. Trivy's cache handles reuse of downloaded/analyzed content.

Options

Option Default Purpose
--platform required OCI platform, such as linux/amd64 or linux/arm64/v8
--output sbom New directory; existing directories are rejected
--trivy trivy Installed executable name or path
--cache-dir Trivy default Persistent Trivy cache directory
--timeout 600 Seconds per Trivy invocation
--allow-incomplete false Export known containers and report uncovered tools

The plugin follows nested workflows and effective Docker requirements/hints. It reports missing containers, nonliteral references, and build-only Docker requirements. ExpressionTools are marked not applicable because they run in the CWL engine. No image builds are performed. Failure removes the newly created bundle; existing outputs are preserved.

Publish and scan separately

Publish or attach the generated files using your existing ORAS pipeline. This plugin does not push, retrieve OCI referrers, sign artifacts, or attach SBOMs. The lock file connects each image SBOM to its container identity even when the bundle is attached to a workflow artifact.

See the offline Trivy scanning guide for database preparation and transfer, per-image vulnerability reports, separate license assessment, and CI exit-code handling. Scanning and policy enforcement run downstream of this plugin.

Scope and reproducibility

A tag is resolved by Trivy during inspection. The lock records the repository digest(s) and image configuration ID reported by that inspection, together with the requested platform. It does not pre-resolve tags or rewrite CWL. A reported repository digest can identify a multi-platform index: it must not be mistaken for a selected child manifest digest. For subsequent reproducible invocations, use digest-pinned references and the same platform. The lock file is an audit output, not an input replay mechanism.

A successful bundle covers declared container references; it is not a complete inventory of software that might execute. Runtime downloads, host tools, CWL engine dependencies, and packages Trivy cannot detect are outside its scope. Docker hints describe possible execution environments, not proof of an actual run. The workflow inventory therefore explicitly declares its composition incomplete. Image SBOMs are retained without merging away package or distribution metadata needed by Trivy.

Development

pip install -e '.[test]'
pytest
hatch run dev:typecheck
hatch run dev:ruff check src tests
hatch run dev:ruff format --check src tests
hatch run dev:security
pip install -r requirements-docs.txt
mkdocs build --strict

Verified with Trivy 0.74.0 against alpine:3.21 on linux/amd64.

Tests use controlled scanner responses and require no registry access. Real Trivy scanning is a separate integration check. See architecture.

Metadata

Release files for cwl2sbom 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cwl2sbom 0.1.0
File Size Uploaded
cwl2sbom-0.1.0.tar.gz 21.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cwl2sbom 0.1.0
File Interpreter ABI Platform
cwl2sbom-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.4 kB

Release files / cwl2sbom-0.1.0.tar.gz

Download URL cwl2sbom-0.1.0.tar.gz
Size 21.7 kB
Tags Source
SHA-256 checksum
How to use checksums
46b21904fd4ddda6adae23b497c9376b961a577cc1de4c762f8c79e061d55a67
BLAKE2b-256 checksum
How to use checksums
0ef10873c2a185140158d5599d213f3f50b80fa913ea89a860dca6a8a68633fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release files / cwl2sbom-0.1.0-py3-none-any.whl

Download URL cwl2sbom-0.1.0-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c436990d85b74c6404a4067b24b1307d1c6ed53c340e11a163dfb163af20537
BLAKE2b-256 checksum
How to use checksums
b61ee2ffb50e2ff33d5091f3c61a7482f61f2b68b8ddf32b46ec69d2abf71f37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page