feat(sbom): report the source language of cataloged packages - #328
Draft
reyreavman wants to merge 4 commits into
Draft
reyreavman wants to merge 4 commits into
reyreavman wants to merge 4 commits into
Conversation
Every component cataloged through a packages directive now carries the GOST:source_langs property required by the FSTEC component listing: a single property with the languages of the ecosystem that installed the package, which is the form the ISPRAS tooling reads (it takes the first property with that name and splits its value on commas). The language comes from the packages directive itself, registered per ecosystem and carried down to the per-directive scan, so it does not depend on scanner metadata. Packages installed by os-pm are prebuilt binaries of an arbitrary language and stay without the property. The SBOM artifact format version is bumped so that cached SBOMs are regenerated. Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
A merged SBOM now carries GOST:source_langs on the product component and, in the container format, on the container component of every image, holding the sorted union of the languages of the components below it. Without it the image and product rows of the tabular component listing, which is generated from these properties, stayed empty while the package rows were filled in. Languages already present on a component (e.g. from a user-imported BOM) are unioned with the aggregated ones instead of suppressing them. Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
Assert GOST:source_langs on a component cataloged by the python-pip and javascript-npm directives, so the language registry stays wired from the packages directive down to the generated SBOM. Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
Describe how GOST:source_langs is derived from the packages directive, why os-pm packages carry no language, and how the languages are collected on merge. Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
Collaborator
Author
Verification
Review focus
Follow-up
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SBOMs of stapel images now carry the
GOST:source_langsproperty the FSTEC tabular component listing is generated from: every component cataloged through apackagesdirective is stamped with the source language of that directive's ecosystem, andwerf sbom mergerolls the languages up to the image and product level. Nothing to configure; the property appears on rebuild.What
Per-package property
packagesdirective carriesGOST:source_langs:go-mod→Go,python-pip/python-poetry/python-uv→Python,rust-cargo→Rust,javascript-npm/javascript-yarn/javascript-pnpm→JavaScript,lua-rock→Lua.", "— never repeated properties, because the ISPRAS exporters read only the first property with a given name and split its value on commas.os-pmcarry no property: pm's report has no language field yet, and guessing a language for prebuilt binaries in a regulator-bound listing is not acceptable.Merge-level aggregation
werf sbom merge, the product component carries the sorted, deduplicated union of the languages of all images.containeroutput format, each image's container component additionally carries the union of the languages of the components below it; theossformat has no container components and gets only the product-level property.Cache
Why
The "programming language(s)" column of the tabular component listing (ППК) is produced by the ISPRAS exporters from
GOST:source_langs; without the property the column stays empty for every package, image and product row. The language comes from thewerf.yamlpackagesdirective, not from syft package metadata: stapel images are scanned one directive at a time, so the attribution is exact and does not depend on what syft happens to emit. Deriving the language from purl types (the efs-sbom approach) was rejected as the primary source — it is a heuristic, while the directive type is ground truth the user already declared.