Page MenuHomeFreeBSD

Generate SBOM files for each ports
Needs ReviewPublic

Authored by mat on Wed, Oct 7, 2:24 PM.
Tags
None
Referenced Files
F175337667: D60441.id.diff
Sat, Oct 10, 2:33 AM
F175328329: D60441.diff
Sat, Oct 10, 12:34 AM
F175277525: D60441.id188973.diff
Fri, Oct 9, 4:03 PM
Unknown Object (File)
Fri, Oct 9, 6:55 AM
Unknown Object (File)
Thu, Oct 8, 5:46 PM
Unknown Object (File)
Thu, Oct 8, 5:42 PM
Unknown Object (File)
Thu, Oct 8, 2:48 PM
Unknown Object (File)
Thu, Oct 8, 2:46 PM
Subscribers

Details

Reviewers
None
Group Reviewers
portmgr
Summary

This is based on D56474, it only generates the basic .pc files.

As depends get updated, if we generated the other two files statically, they would soon become outdated and contain invalid information. So the .spdx and .jsonld files need to be generated either by a pkg hook, or a separate tool. (see https://reviews.freebsd.org/D56474#1375885 a more complete explanation)

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

mat requested review of this revision.Wed, Oct 7, 2:24 PM
mat created this revision.

Besides my comment above, I wonder if we want to apply a different namespace to the SBOM files generated for base (in D56474 and D60352), or if it should be up to the user to set the correct PKG_CONFIG_LIBDIR. With pkgbase coming, we may want to be able to express dependencies on components from the base system anyway.
Should I change the naming in the base system?
Should we align names between ports and the base system? I can picture cases like expat/libexpat/libbsdxml, curl/libcurl, openssl{36,41,42} etc to be tricky.

Mk/Scripts/create-sbom.sh
53

I am testing with e.g., devel/git and notice that its license is set to GPLv2. While bomtool(1) from pkgconf does not seem to care, the SPDX standard expects license names from its SPDX License List. ISTM that CycloneDX also uses SPDX License IDs by the way.
This is probably not a blocker for this change, as it is a different issue really, but should we switch ports to the SPDX ID for the license field?
Or on the contrary or in the meantime, should we perform the conversion in e.g., the create-sbom.sh script here?

Besides my comment above, I wonder if we want to apply a different namespace to the SBOM files generated for base (in D56474 and D60352), or if it should be up to the user to set the correct PKG_CONFIG_LIBDIR. With pkgbase coming, we may want to be able to express dependencies on components from the base system anyway.
Should I change the naming in the base system?
Should we align names between ports and the base system? I can picture cases like expat/libexpat/libbsdxml, curl/libcurl, openssl{36,41,42} etc to be tricky.

That is a good point. I don't quite know.
I wonder if the base system sboms should be prefixed with FreeBSD- like the base system packages.
Like, when a user has OPENSSL_DEFAULT=base, and a port has USES=ssl, then it'd get a dependency on "FreeBSD-openssl", and if the user has OPENSSL_DEFAULT=openssl, the port would get the dep on "openssl" which would be the ports one.

I am not sure this is needed though.
From what I understand, the idea from having an sbom is you collect all the .spdx/.jsonld files you have, from the base system and the ports, and this gives you the SBOM from the whole system.
The idea is that in the end, you get a very large list of software that are installed on the system, you probably do not have an absolute need to have a link from ports nginx to base openssl.

Mk/Scripts/create-sbom.sh
53

@bofh is working on converting our license framework to SPDX, so I left this out of the scope of this change, working on the assumption that what I get from the framework will be correct when this lands and starts being useful.