Xpra-org / xpra

Persistent remote applications for X11; screen sharing for X11, MacOS and MSWindows.
https://xpra.org/
GNU General Public License v2.0
1.5k stars 144 forks source link

[Q] Software Bill Of Materials? #4050

Open solofoA45 opened 7 months ago

solofoA45 commented 7 months ago

For security and compliance concerns, it would be good to have a list of dependencies for example to assess which security vulnerabilities affect Xpra: https://en.wikipedia.org/wiki/Software_supply_chain

While this is rather clear for linux (RPM) packages, this is less clear for windows packages and HTML5 client packages.

Is there already a way to get these informations?

totaam commented 7 months ago

Here are some starting points and initial thoughts.

This should tie into the Usage : Security documentation since some issues can be mitigated or bypassed using a tight configuration.

The closest thing we have to an overview of the dependencies is here: https://github.com/Xpra-org/xpra/blob/master/docs/Build/Dependencies.md (and includes some pretty diagrams)

MacOS

The MacOS builds are by far the easiest to track since we define and build every single library ourselves. The list can be found by checking out the build repository at the date matching that of the release: https://github.com/Xpra-org/gtk-osx-build There are a few extra packages in there that are only used on MacOS for packaging (ie: xar, etc), those are not shipped.

MS Windows

The full MSYS2 package list on the build system at time of writing has 179 packages:

$ pacman -Qe | wc -l
179

There are also python dependencies which do not have corresponding MINGW packages and are installed via pip: https://github.com/Xpra-org/xpra/blob/15bce9d2ec162ce4984c86aa4279ea2218445194/packaging/MSWindows/SETUP.sh#L38-L42 Then there are also some manual steps: https://github.com/Xpra-org/xpra/blob/15bce9d2ec162ce4984c86aa4279ea2218445194/packaging/MSWindows/SETUP.sh#L46 for:

Packages we do not update as often as others

There can be many reasons why some packages are not updated as regularly as others:

Opaque packages:

3.1

Some issues are magnified in 3.1:

On the whole, I don't think that it is reasonable to expect the 3.1.x to have the same level of maintenance as current versions. CUDA

totaam commented 7 months ago

We should probably split the dependencies into categories - this is probably too many:

totaam commented 6 months ago

The MS Windows dependencies can be recorded in xpra/build_info.py. We can get most of the packages from pacman - and perhaps trim most of the build time dependencies as those aren't very relevant? The python pip dependencies are going to be a pain.

totaam commented 6 months ago

This seems relevant: Understanding the NSA’s latest guidance on managing OSS and SBOMs

totaam commented 5 months ago

Both MacOS and MS Windows builds will now record the libraries and python modules present on the build system when the installer is generated. This will include dependencies we don't really care about: build tools, libraries we don't bundle, etc. But it is safer to record too much than too little, and filtering was hard and would also have required constant fine tuning.

The feature for the html5 client is now tracked here: https://github.com/Xpra-org/xpra-html5/issues/277


Next up:

totaam commented 3 months ago

Another tricky one to handle is pdfium-binaries releases - this release page does show a line that says something like "This version was built with branch chromium/6337 of PDFium". The archive containing the DLL we need also contains a VERSION file:

$ cat pdfium/VERSION 
MAJOR=124
MINOR=0
BUILD=6337
PATCH=0

The easiest way might be to create a "fake" pacman PKGBUILD for it.

totaam commented 3 months ago

The new script that I am working on would flag: liblzma-5.dll as belonging to /mingw64/bin/liblzma-5.dll is owned by mingw-w64-x86_64-xz 5.6.1-2. (current DLL should be fine but it was previously owned by the vulnerable version of xz-utils: 5.6.1-1)

Fixed in: https://github.com/msys2/MSYS2-packages/commit/eb7abbb627d1ccfc5a3a6ca31b98150ee733c366 First vulnerable version was added in: https://github.com/msys2/MSYS2-packages/commit/d153a0914cd45d74acae8a3ade74d0b0d8df5ec6 So any builds between 2024-02-25 and today are shipping the vulnerable library.

On the plus side, the exploit seems to target a specific function in openssh - with glibc, and we don't use openssh by default, and no glibc, and not as a server... So no need to panic.


Good links on the subject:

totaam commented 3 months ago

Forgot another packages missing from MSYS2 that we should contribute upstream: https://github.com/Xpra-org/xpra/blob/79d8e18dc7544d019bef79374b0bdd51c6d42723/packaging/MSWindows/SETUP.sh#L70 Trivial to install: meson build && ninja install.

totaam commented 1 month ago

cyclonedx-python-lib: This Python package provides data models, validators and more, to help you create/render/read CycloneDX documents.