Skip to content

T8542: Add functionality to generate SBOM file from ISO image#1164

Open
asklymenko wants to merge 6 commits intocurrentfrom
T8542-SBOM-current
Open

T8542: Add functionality to generate SBOM file from ISO image#1164
asklymenko wants to merge 6 commits intocurrentfrom
T8542-SBOM-current

Conversation

@asklymenko
Copy link
Copy Markdown
Contributor

Change summary

This change adds functionality to run the Syft utility to generate SBOM files in 2 formats (CycloneDX and SPDX).

It also adds functionality to create and mount an additional drive to transfer the Syft util from host machine to the VM and also to transfer the generated files back on the host machine.

The process is similar to our smoketests execution process. The following command could be used to start the SBOM generation process:
sudo make make_sbom
or
sudo make make_sbom SBOM_OUTPUT_DIR=/home/vyos_bld

In the second case we specify the directory to copy the output files. If this parameter is not specified the build output will be stored in the same directory the process was executed from.

Example of the scan artifacts:
vyos-2026.04.20-0035-rolling-generic-amd64.iso.cdx.json
vyos-2026.04.20-0035-rolling-generic-amd64.iso.spdx.json

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe): add new functionality to build syste,

Related Task(s)

Related PR(s)

How to test / Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Use the Syft util to generate SBOM files in both CycloneDX and SPDX format. This process includes creating a transfer disk to copy the Syft util from the host machine and copy the scan results back to the host machine.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

👍
No issues in PR Title / Commit Title

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new workflow to generate SBOM artifacts (CycloneDX JSON + SPDX JSON) for a built VyOS ISO by booting/installing it in QEMU and running Syft inside the VM, then copying results back to the host via a temporary “transfer disk”.

Changes:

  • Extend scripts/check-qemu-install with --sbom / --sbom-output-dir and implement transfer-disk creation, Syft download, in-VM SBOM generation, and host extraction.
  • Extend QEMU launch command generation to optionally attach the transfer disk.
  • Add make_sbom Makefile target to invoke the new SBOM generation flow.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
scripts/check-qemu-install Adds SBOM mode, creates/mounts a transfer disk, downloads Syft, runs SBOM generation in VM, and copies outputs to host.
Makefile Adds make_sbom target to run check-qemu-install in SBOM mode with optional output directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/check-qemu-install
Comment on lines +406 to +410
log.info('Downloading syft to transfer disk')
subprocess.check_call(
f'curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b {setup_mount}',
shell=True
)
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The host downloads Syft using curl ... | sh from the main branch. This is a supply-chain risk and is non-reproducible (the script can change at any time), and shell=True also increases risk unnecessarily. Prefer pinning an explicit Syft release version (and ideally verifying checksum/signature) and invoking the installer without a shell pipeline (or vendoring the binary as a build dependency).

Copilot uses AI. Check for mistakes.
Comment thread scripts/check-qemu-install
Comment thread scripts/check-qemu-install Outdated
Comment thread scripts/check-qemu-install Outdated
Comment thread Makefile Outdated
asklymenko and others added 4 commits April 23, 2026 15:20
Exclude the transfer directory from scan.
Apply quoting to the passed variable.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Apply suggestion, add validation that the Syft binary was copied with success.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Add additional validation step to ensure that the transfer drive is unmounted successfully.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

CI integration 👍 passed!

Details

CI logs

  • Config tests 👍 passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

current VyOS rolling release

Development

Successfully merging this pull request may close these issues.

2 participants