Skip to content

Add automatically generated SBOM #1473

@felix-schwarz

Description

@felix-schwarz

This issue explores automatic SBOM generation for this app.

Existing solutions

Findings and a possible solution

  • a JSON list of Swift packages is maintained inside the Xcode project at ownCloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
{
  "originHash" : "cc8e62b9f24062ff6e87f5e91e6f6cb41653dcf8250ce8973635e9ed0a5c561d",
  "pins" : [
    {
      "identity" : "down",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/johnxnguyen/Down",
      "state" : {
        "branch" : "master",
        "revision" : "e754ab1c80920dd51a8e08290c912ac1c2ac8b58"
      }
    },
    {
      "identity" : "openssl",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/krzyzanowskim/OpenSSL.git",
      "state" : {
        "revision" : "8729614a93e6b20307db3c3359aed81f030facaa",
        "version" : "3.3.2000"
      }
    },
    {
      "identity" : "plcrashreporter",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/microsoft/plcrashreporter.git",
      "state" : {
        "revision" : "8c61e5e38e9f737dd68512ed1ea5ab081244ad65",
        "version" : "1.12.0"
      }
    },
    {
      "identity" : "pocketsvg",
      "kind" : "remoteSourceControl",
      "location" : "https://github.com/pocketsvg/PocketSVG.git",
      "state" : {
        "revision" : "10c6885e427e88d35fbb64010fbd6385cb58fef7",
        "version" : "2.7.3"
      }
    }
  ],
  "version" : 3
}
  • this information could be rearranged to match the CycloneDX JSON format as seen f.ex. here.
  • problem: no license information is available in Package.resolved
  • solution:
    • license information could be auto-detected (by loading https://raw.githubusercontent.com/$project/refs/heads/master/LICENSE and checking for strings common in MIT, GPL, Apache… licenses) and provided using official SPX IDs. It might also be possible to use CycloneDX/license-scanner for that, but this could end up being more work than necessary (except maybe if writing the tool in golang, from where license-scanner can be used directly as a library).
    • additional information (incl. missing or corrections of incorrect license information) could be added through an additional JSON file that allows specifying additional attributes to include on a per-package basis, f.ex.
{
   "https://github.com/krzyzanowskim/OpenSSL.git" : {
     "licenses" : [
          "license" : {
             "id" : "Apache-2.0"
          }
     ]
   }
}
  • addition: license information for all components is also already present in the form of registered extensions inside the app
    • this information could also be extended/utilized with SPDX License IDs and used for enriching the package information.
    • this could also be an opportunity to detect if packages were added to the Xcode project without also adding license texts/informations to the app

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions