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

doc/interoperability: new chapter and section on CycloneDX #316626

Merged
merged 3 commits into from
Jul 29, 2024

Conversation

ehmry
Copy link
Contributor

@ehmry ehmry commented Jun 2, 2024

Add a section to the Nixpkgs manual describing a taxonomy for putting Nix info in CycloneDX SBOMs.

When this is merged and published it would be linked into the list of official taxonomies.

The normal way to do this is to create a separate Github repo with an administrative working group, but that's a bunch of noise and overhead that we don't need. By putting this information into Nixpkgs we version it with the releases and we can oblige anything in Nixpkgs that deals with these SBOMs to use the taxonomy that is the manual.

This change adds a new Interoperability Standards chapter to the manual because I couldn't find an existing chapter that was appropriate. I don't have a strong opinion on how the manual should be structured.

I have experimented with using the SBOM JSON as an intermediary format that can be used to build a Nix package - build-nim-sbom.nix.

If this works then ideally upstream projects that adopt SBOMs can have Nix information injected into them in an automated way that provides a reproducible Nix package, without requiring whoever is responsible for maintaining the SBOM be able to read and write Nix expressions.

This has implications for Genealogos so it should be reviewed by its developers.

Pinging @NixOS/documentation-team.

Ref tweag/genealogos#58


Add a 👍 reaction to pull requests you find important.

@ehmry ehmry requested review from ErinvanderVeen, pennae and a team June 2, 2024 08:46
@github-actions github-actions bot added the 8.has: documentation This PR adds or changes documentation label Jun 2, 2024
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/pre-rfc-cyclonedx-bom-taxonomy/45957/4

|---------------------------|-------------|
| `nix:narinfo:store_path` | Store path for the given store component. |
| `nix:narinfo:url` | URL path component. |
| `nix:narinfo:nar_hash` | Hash of the file system object part of the component when serialized as a Nix Archive. |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to use camel-case rather than snake-case because it saves a few characters and it's common Nix style.

Copy link
Contributor

@fricklerhandwerk fricklerhandwerk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved documentation-wise. The writing is very clear, great work. Since this is likely to be read by complete Nix beginners but touches a rather advanced topic, please generously add links to definitions of terms

doc/interoperability/cycloneds.md Outdated Show resolved Hide resolved
doc/interoperability/cycloneds.md Outdated Show resolved Hide resolved
doc/interoperability/cycloneds.md Outdated Show resolved Hide resolved
doc/interoperability/cycloneds.md Outdated Show resolved Hide resolved
doc/interoperability/cycloneds.md Outdated Show resolved Hide resolved
| `nix:fod:url` | URL to fetch |


`nix:fod` properties may be extracted and evaluated to a derivation using code similar to the following:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does such a function exist already?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have code for this out-of-tree, which is based on what I did for buildNimPackage for reading lockfiles. I was using the methods fetchzip and git but I like fetchgit for consistency.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jun 2, 2024
@drupol
Copy link
Contributor

drupol commented Jun 2, 2024

A very minor nit, shouldn't we rename the file cycloneds.md into cyclonedx.md ?

@ehmry
Copy link
Contributor Author

ehmry commented Jun 2, 2024

@fricklerhandwerk the text is good because I copied most of it from the Nix manual.

I was thinking the property names should follow Store object info JSON format as close as possible but the nix:narinfo names are already used by Genealogos, so I left them as is.

@drupol the cycloneds.md name was a typo, that has been fixed.

@ehmry ehmry marked this pull request as ready for review June 10, 2024 15:04
@ehmry
Copy link
Contributor Author

ehmry commented Jul 29, 2024

I want to see this merged in some form so we can get the Nix namespace registered.

@fricklerhandwerk fricklerhandwerk merged commit edc0b77 into NixOS:master Jul 29, 2024
10 of 11 checks passed
@fricklerhandwerk
Copy link
Contributor

Merging since Genealogos author @ErinvanderVeen approved.

@ehmry ehmry deleted the cyclonedx branch July 29, 2024 16:54
@ehmry
Copy link
Contributor Author

ehmry commented Aug 5, 2024

@fricklerhandwerk when does the manul on nixos.org get updated?

@fricklerhandwerk
Copy link
Contributor

That should happen automatically, but I don't maintain that site, @thilobillerbeck or @garbas may now.

@ehmry
Copy link
Contributor Author

ehmry commented Aug 10, 2024

Its in the unstable manual and linked in the official taxonomy list https://github.com/CycloneDX/cyclonedx-property-taxonomy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants