Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backpopulate supplier & set filesAnalyzed=false #1137

Merged
merged 5 commits into from
May 24, 2024

Conversation

xnox
Copy link
Contributor

@xnox xnox commented May 24, 2024

  • spdx: rename expected.spdx.json ahead of more tests

  • spdx: Add test case of merging pkg SBOM without supplier
    Image SBOM should contain supplier and originator for every package,
    when package SBOM does not have one, expect one based on the image
    layer supplier.

    Signed-off-by: Dimitri John Ledkov dimitri.ledkov@chainguard.dev

  • spdx: backpopulate supplier & originator for packages
    This way image SBOM is correct, without rebuilding package SBOMs.

    Also update golden test data for affected integration tests.

    Signed-off-by: Dimitri John Ledkov dimitri.ledkov@chainguard.dev

  • spdx: fixup filesAnalyzed setting

    Current implementation strips filesAnalyzed from individual package
    SBOMs upon aggregation into image SBOM. When doing so, update package
    stanza to say filesAnalyzed=false, as indeed FileRefs are missing.

  • spdx: fixup PackageVerificationCode setting

    Current implementation strips filesAnalyzed from individual package SBOMs
    upon aggregation into image SBOM. When doing so, omit PackageVerificationCode
    as without files there cannot be verification code (it is defined as ordered hash of files).
    Also observe that newly generated packages without files do not have VerifcationCode.

    As a pleasant side-effect this removes SHA1 from arch-specific package manifest and makes it year 2030 safe.

@xnox xnox force-pushed the backpopulate-supplier branch 2 times, most recently from 783ac88 to 1999ef5 Compare May 24, 2024 16:52
xnox added 2 commits May 24, 2024 17:54
Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
Image SBOM should contain supplier and originator for every package,
when package SBOM does not have one, expect one based on the image
layer supplier.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
This way image SBOM is correct, without rebuilding package SBOMs.

Note some packages have neither originator nor supplier, some have
originator without supplier. Hence set originator first, then copy it
to supplier.

Also update golden test data for affected integration tests.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
Current implementation strips filesAnalyzed from individual package
SBOMs upon aggregation into image SBOM. When doing so, update package
stanza to say filesAnalyzed=false, as indeed FileRefs are missing.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
@xnox xnox changed the title backpopulate supplier backpopulate supplier & set filesAnalyzed=false May 24, 2024
Current implementation strips filesAnalyzed from individual package
SBOMs upon aggregation into image SBOM. When doing so, omit
PackageVerificationCode as without files there cannot be verification
code (it is defined as ordered hash of files). Also observe that newly
generated packages without files do not have VerifcationCode.

As a pleasant side-effect this removes SHA1 from arch-specific package
manifest and makes it year 2030 safe.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@chainguard.dev>
@xnox xnox merged commit 4800950 into chainguard-dev:main May 24, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants