feat(sbom): mark only entry-point packages as directly attackable - #332
Draft
reyreavman wants to merge 3 commits into
Draft
reyreavman wants to merge 3 commits into
reyreavman wants to merge 3 commits into
Conversation
attackSurface: yes now follows the dependency tree recorded in the SBOM: it stays on the components nothing else depends on, and every component pulled in by another is written as indirect. Ecosystems whose catalogers report no tree keep the previous uniform behaviour, since every component is then a root. Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
…ndency tree Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
…them all A cataloger that records every package under the image root described what the image contains, not what one package pulls in, so honoring those edges left the tree without a single root and demoted everything to indirect. Skip edges sourced at the image itself, and pin the security function against the split. Signed-off-by: Radmir Khurum <radmir.khurum@flant.com>
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
sbom.gost.attackSurface: yesno longer lands on every package of an image. It now follows the dependency tree recorded in the SBOMdependenciessection: components nothing else depends on keepyes, everything pulled in by another component is written asindirect.Closes the DoD item «На основе информации о дереве зависимостей устанавливаем значение
yesдляgost_attack_surface» of card 69801379.What
gost.Upsertcollects the targets of everydependsOnedge and writesindirectto the components that appear among them; the rest, andmetadata.component, keep the configured value. Self-references do not demote their own subject.noandindirect, andsecurityFunctionin all cases, apply unchanged to the whole tree — no behaviour change there.dependenciessection makes every component a root, so ecosystems whose catalogers report no tree keep exactly the previous output.Why
Stamping
yeson every package attests to a regulator that each of them exposes an interface an attacker reaches directly. The dependency tree is already in the SBOM — pm reportsdepends(pkg/sbom/packages/os_pm/os_pm.go:92) and syft emitsdependenciesfor the ecosystems that have a resolver — so the distinction between what the image pulls in on purpose and what came along with it is available at build time.VERIFIED
Two-image stapel build (
base-layer:jq;app:curl, builtfromImage base-layer) pushed to a local registry,werf sbom mergein both formats, output through3p-ispras-sbom-checker:master:--format container->файл корректный;--format oss->файл корректный. The container value is the maximum over its content, which the ISPRAS rule requires, and it is now satisfied by real roots rather than by uniform injection.Mutation loop on the committed state — all caught:
dependent := config)metadata.componenttootask format,task build,task lint(0 issues), fulltask test:unit— green.Review focus
dependsOnis treated as an edge;providesis not. A component that merely provides an alias of another is still a root. Confirm that matches how the ISPRAS exporters read the tree.go-mod,python-pip— syft emits zero edges; measured 457 components / 0 edges for a realgo.mod) degenerate to a uniformyes. Documented, not special-cased.Upsertalso runs on base and imported BOMs (pkg/build/sbom_step.go), where the tree is that BOM's own. Values are recomputed on the merged result afterwards.Depends on
Based on #329, not on
main. Retarget once #329 lands.