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

Produce SBOM during zarf package creation #22

Closed
RothAndrew opened this issue Sep 7, 2021 · 18 comments · Fixed by #367
Closed

Produce SBOM during zarf package creation #22

RothAndrew opened this issue Sep 7, 2021 · 18 comments · Fixed by #367
Assignees
Labels
enhancement ✨ New feature or request packager sbom Software Bill of Materials
Milestone

Comments

@RothAndrew
Copy link
Contributor

Evaluate tools / options to produce a standard consumable SBOM and a user-friendly display / ability to navigate it when deploying a zarf package. Doing so will meet software supply chain requirements for government and industry as well as provide a higher level of transparency/confidence to what is transported with Zarf.

Related:
https://www.ntia.doc.gov/files/ntia/publications/sbom_minimum_elements_report.pdf
https://cyclonedx.org/
https://spdx.dev/
https://github.com/anchore/syft


Migrated from https://repo1.dso.mil/platform-one/big-bang/apps/product-tools/zarf/-/issues/35

@mikhailswift
Copy link
Contributor

Just a heads up since I can't assign myself here: I'm currently working this issue

@mikhailswift
Copy link
Contributor

https://github.com/spdx/tools-golang

Leaving this here for further reference as a potentially useful lib

@jeff-mccoy
Copy link
Contributor

Thanks @mikhailswift I’ve been eyeing that too as @runyontr suggested it might be good to have spdx be a consumer target at some point for package creation. Thanks!

@mikhailswift
Copy link
Contributor

mikhailswift commented Sep 15, 2021

Still a WIP, but wanted to give a quick update. Currently have SBOM generation working for images during package creation. I left some more details in the commit message

testifysec@be62817

Edit: And attaching an example of one of the SBOMs generated for the tiny-kafka example: https://gist.github.com/mikhailswift/3dd402abc5afecba27cb3cf7f92d1d52

Its uhh... pretty long lol

@jeff-mccoy
Copy link
Contributor

Thanks @mikhailswift this is very exciting! I had played with syft a little last month because I really like the feedback they provide on image pull, have you stumbled across that code at all yet in your exploration? #3 has been sitting out for a while needing some love and I had planned to checkout how syft was going it later on.

@mikhailswift
Copy link
Contributor

I ran into a bit of their progress updating, yes. They’re using go-partybus (heh, familiar name) as an event bus to provide progress updates to any subscribers. Both syft and stethoscope allow you to pass in your own instance of go-partybus to subscribe to their events.

I tapped into this a bit to get updates during the cataloging process and to make sure syft was reading the image layers from the tar ball and not reaching out to the registry and pulling layers again.

We should be able to use similar tactics to provide better feedback during zarfs processes. I can take a look at it tomorrow.

It also feels a bit bad to be pulling images, tarring them up, only to subsequently iterate over the tar a second time. I played a little bit with trying to catalog image as we pulled them before tarring them but would have to revisit that.

@jeff-mccoy jeff-mccoy added the sbom Software Bill of Materials label Sep 16, 2021
@jeff-mccoy
Copy link
Contributor

yeah agreed double tar is a little gross. I'm not beholden to tar vs say OCI for transporting either, just was a simple/clean way initially with K3s. I may explore that later on too, look forward to what you find out around image pulling.

@RothAndrew RothAndrew added this to the sbom milestone Feb 4, 2022
jeff-mccoy added a commit that referenced this issue Feb 8, 2022
Signed-off-by: Jeff McCoy <code@jeffm.us>
@YrrepNoj
Copy link
Contributor

YrrepNoj commented Feb 8, 2022

@jeff-mccoy just wanted to confirm that this issue can be closed based on this commit?

29ec64c

Never mind, this was an old commit when the repo was on GitLab and references the GitLab issue 22,. This got re-pinged when we did the master push and I thought it was coming with the resent PR merge. Disregard.

@jeff-mccoy
Copy link
Contributor

Met with @mikhailswift on Monday to talk through this and he's actively working this again, going to touch base in a couple weeks, but he'll update the issue as it's being worked.

@jeff-mccoy
Copy link
Contributor

any update on this work @mikhailswift

@jeff-mccoy jeff-mccoy added enhancement ✨ New feature or request packager labels Feb 25, 2022
@mikhailswift
Copy link
Contributor

Sorry just catching up on notifications this morning

So far it's going well. I'll have get the code cleaned up and will the commits here to show what I'm doing.

Currently working on making sure SBOMs are being generated for images at the most opportune time in Zarf's code.

@jeff-mccoy
Copy link
Contributor

Copy thanks!

@mikhailswift
Copy link
Contributor

Apologies for the delay on this -- got the SBOM creation code cleaned up and a PR up. Working on functionality to display the SBOMs to users now.

@anoncam
Copy link

anoncam commented Apr 11, 2022

@jeff-mccoy
Copy link
Contributor

Thanks @anoncam, python is a deal-breaker as we need statically-linked cross-compiled binaries only, will keep tabs on the second link.

@mikhailswift
Copy link
Contributor

We're currently working SBOM generation directly in witness w/o Zarf to remove the massive dependencies that syft brings

@jeff-mccoy
Copy link
Contributor

We'll need more details on that too. Syft has several teams adopting it and I want to make sure that we know what we are brining in and when we are choosing more commons tools vs not.

@anoncam
Copy link

anoncam commented Apr 15, 2022

@jeff-mccoy I think another item needs to be captured, which is standardizing across the industry to better support interoperability with various components. SLSA seems like a good starting point to dive a little more meaningfully into this process

Noxsios pushed a commit that referenced this issue Mar 8, 2023
Signed-off-by: Jeff McCoy <code@jeffm.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request packager sbom Software Bill of Materials
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants