fix(sbom): warn about missing stageDependencies for file-based packages - #263
Open
reyreavman wants to merge 2 commits into
Open
fix(sbom): warn about missing stageDependencies for file-based packages#263reyreavman wants to merge 2 commits into
reyreavman wants to merge 2 commits into
Conversation
Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
…ures Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
nervgh
approved these changes
Aug 20, 2026
nervgh
marked this pull request as ready for review
August 20, 2026 11:28
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
With a file-based
packagesdirective (go-mod,python-pip,rust-cargo, …), changing the spec/lock file contents (e.g.go.mod) does not rebuild thepackagesstage unless the files are listed ingit.stageDependencies.packages: the installed dependencies silently go stale while the SBOM keeps reporting the updated files. werf now emits a global warning when such a directive is used withoutstageDependencies.packagesin any git mapping.What
stageDependencies.packages, produces a once-per-image global warning (repeated in the end-of-run WARNINGS summary) telling the user to declare the spec/lock paths.os-pm(its package list lives inwerf.yamland already feeds the stage digest), for images without git mappings, or when any git mapping declaresstageDependencies.packages.go.modchanges between states (werf.yaml identical) asserts thepackagesstage is rebuilt (Building stage app/packages) and the SBOM picks up the new module; the unchanged rebuild asserts the stage stays cached.tag.gpgsign); settle it withtask test:e2e paths="./test/e2e/sbom/..." labelFilter="stage-deps".docs/pages_en,docs/pages_ru, stapel instructions): file-based packages types now document thestageDependencies.packagesrequirement with an example;os-pmis documented as not needing it.Why
The packages stage digest is built from the generated install command plus the
stageDependencies.packageschecksum. For file-based ecosystems the command contains only paths (cd "/app" && go mod download), so file content changes leave the digest intact andgo mod download/npm ci/cargo fetchis never re-run — while the SBOM cataloger reads the updated spec/lock from the image (delivered by the git patch) and reports packages that were never installed. A lying SBOM is a security artifact defect, not just a stale cache. Automatic injection of spec/lock into stage dependencies was rejected:workdiris a container path that cannot be reliably mapped back to git-repo paths (multiple git mappings, files produced by earlier stages or the base image), it would deviate from the explicit stageDependencies model of install/setup stages, and it would invalidate caches for every existing user of file-based packages.