Skip to content

Conversation

@lool
Copy link
Contributor

@lool lool commented Apr 28, 2025

Depends on cleanup work in #29

Add a new job to generate SBOMs with Syft

@lool lool force-pushed the syft branch 6 times, most recently from c0db619 to 5eb00b3 Compare April 28, 2025 18:21
@lool
Copy link
Contributor Author

lool commented Apr 28, 2025

% zgrep cataloger rootfs-sbom.syft.txt.gz| sort | uniq -c
   1  Found by:	 deb-archive-cataloger
 466  Found by:	 dpkg-db-cataloger
   1  Found by:	 java-archive-cataloger
1353  Found by:	 linux-kernel-cataloger
  11  Found by:	 python-installed-package-cataloger

@lool
Copy link
Contributor Author

lool commented Apr 28, 2025

Ok, this seems to do a good initial job; I'm not convinced by the value of the default set of catalogers, perhaps we should only keep the deb/dpkg catalogers active.

I checked the syft-json report, and it has:

   "licenses": [
    {
     "value": "Apache-2.0",
     "spdxExpression": "Apache-2.0",
     "type": "declared",
     "urls": [],
     "locations": [
      {
       "path": "/usr/share/doc/adbd/copyright",
       "accessPath": "/usr/share/doc/adbd/copyright"
[...]
   "purl": "pkg:deb/debian/[email protected]?arch=arm64&distro=debian&upstream=android-platform-tools",
   "metadataType": "dpkg-db-entry",
   "metadata": {
    "package": "adbd",
    "source": "android-platform-tools",
    "version": "34.0.5-12",

So I'm confident we could have a table of concluded licenses by source package, either using the syft csv/go templating or doing some light post-processing of the JSON.

@lool
Copy link
Contributor Author

lool commented Apr 28, 2025

@ricardosalveti I think we could start with landing this, and then improve from there; what do you think?

@ricardosalveti
Copy link

@ricardosalveti I think we could start with landing this, and then improve from there; what do you think?

yeah, we can probably use deb/dpkg catalogers and merge the initial sbom generation even if that is package based at this point.

probably better to split the cleanup work in another pr.

next step would indeed be to merge the package based sbom to become a source package sbom.

@lool lool mentioned this pull request Apr 29, 2025
@lool lool marked this pull request as ready for review April 29, 2025 10:49
@lool
Copy link
Contributor Author

lool commented May 21, 2025

Rebasing on tip after the wave of CI changes

@lool
Copy link
Contributor Author

lool commented May 21, 2025

Using syft's --select-catalogers debian picks up the dpkg and deb catalogers, which seems to be what we want here.

@lool
Copy link
Contributor Author

lool commented May 21, 2025

license-report-csv.txt
@ricardosalveti what do you think of this report?

It has:

  • one line per source package (sometimes that's the binary package when source info is not present)
  • one column with list of binary packages
  • source version (sometimes that's the binary version when source info is not present)
  • one column with list of license ids found by syft
  • one column with the sha256sum of the copyright files – it should be only one, otherwise it means different binary packages have different copyright files which is very unusual

@lool
Copy link
Contributor Author

lool commented May 21, 2025

@ricardosalveti Note that it's a run without Xfce, so it's missing a bunch of packages, this is just to establish the format

This is in preparation of other files that will be uploaded in a
separate step.

Signed-off-by: Loïc Minier <[email protected]>
lool added 6 commits May 21, 2025 21:09
Takes a Syft JSON file as a the first argument and outputs a
human-readable summary of source packages and their licenses.

Signed-off-by: Loïc Minier <[email protected]>
Rename shellcheck workflow to static-checks.

Signed-off-by: Loïc Minier <[email protected]>
@lool
Copy link
Contributor Author

lool commented May 22, 2025

Noticed that the sha256sum of the copyrights weren't properly computed; adding a flag to the script for the path to the rootfs

Copy link

@ricardosalveti ricardosalveti left a comment

Choose a reason for hiding this comment

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

LGTM, I think this is good for what we want now.

@lool lool merged commit 0a4d161 into qualcomm-linux:main May 23, 2025
6 checks passed
@lool lool deleted the syft branch May 28, 2025 09:02
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.

2 participants