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

Add Nix Cataloger #462

Closed
wagoodman opened this issue Jul 15, 2021 · 11 comments · Fixed by #1107 or #1696
Closed

Add Nix Cataloger #462

wagoodman opened this issue Jul 15, 2021 · 11 comments · Fixed by #1107 or #1696
Labels
enhancement New feature or request good-first-issue Good for newcomers

Comments

@wagoodman
Copy link
Contributor

It would be ideal to be able to identify and catalog Nix packages.

@wagoodman wagoodman added enhancement New feature or request good-first-issue Good for newcomers labels Jul 15, 2021
@mlieberman85
Copy link

Just a note, I've been taking a look at this problem. Nix derivations, i.e. build definitions generated by the Nix expression language, are just json files containing almost all the info you would expect an SBOM to contain. They just need to be translated into the correct SBOM format.

The key thing that is missing from a derivation and is only included in the actual nix expression code for a package is metadata, e.g. license, maintainer, etc. This can get a little annoying because you need to reverse lookup from a derivation.

@juliosueiras
Copy link
Contributor

juliosueiras commented Dec 19, 2021

Screenshot from 2021-12-18 19-47-36
Screenshot from 2021-12-18 19-52-25

Doing a basic nix-store cataloger, since drv files doesn't get include the docker build when you are using dockerTools(which is more common one for nix users compare to in-docker nix-build)

Edit: still need to fix a few bugs

@wagoodman
Copy link
Contributor Author

@juliosueiras that's awesome --shout out if you want an extra helping hand! Up to you if you wanted to open up a draft PR and swarm on bug squashing or closing the gap on what's left 👍

@nikolaishields
Copy link

I am also interested in collaborating or lending any support I can in SBOM generation via nix through syft.

@ghuntley
Copy link

Would be also interested in seeing support for nix :)

@spiffcs
Copy link
Contributor

spiffcs commented Jul 19, 2022

Hey @nikolaishields! Thanks for the offer.

@juliosueiras did you still have the branch or draft of code from your screenshot above?

If you open a draft I'm sure @nikolaishields and myself can take a look and squash bugs and clean it up so we can get it merged. If not no worries and we can start getting a nix cataloger added that follows the same pattern as our other distro catalogers.

@juliosueiras
Copy link
Contributor

sound good

@juliosueiras
Copy link
Contributor

created the draft PR #1107 , which is based on the Deb cataloger, there is still the bug of certain stuff(that doesn't have version) not splitting correctly

@ghuntley
Copy link

Legend.

@juliosueiras
Copy link
Contributor

a quick note: the drv(json file refer from the earlier comment chain) is something that only exist on the build machine, not the finish artifact, so if an image is build via dockerTools family, then it will not contain any drvs, only the resulting store entries

@wagoodman
Copy link
Contributor Author

wagoodman commented Mar 24, 2023

quick update: the above PR has been merged into the in-repo feature branch add-nix-cataloger for further development (see #1107 (comment)). Tip-of-the-hat to @juliosueiras for the original implementation, I'll see what I can do to get this in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good-first-issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants