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

[Q] Software Bill Of Materials? #4050

Open
solofoA45 opened this issue Nov 10, 2023 · 9 comments
Open

[Q] Software Bill Of Materials? #4050

solofoA45 opened this issue Nov 10, 2023 · 9 comments
Labels
documentation Improvements or additions to documentation

Comments

@solofoA45
Copy link

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.

  • For windows packages it seems not clear which MSYS packages were used to build the packages and their versions
  • For HTML5 client, the libraries (aurora,...) seem to be included in html5/js/lib/ but not origin, version, patches,...

Is there already a way to get these informations?

@totaam totaam added the documentation Improvements or additions to documentation label Nov 13, 2023
@totaam
Copy link
Collaborator

totaam commented Nov 13, 2023

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:

#these need to be converted to PKGBUILD:
$PACMAN --noconfirm --needed -S ${XPKG}python-pip ${XPKG}python-pycryptodome ${XPKG}python-keyring ${XPKG}python-idna openssl-devel
for x in browser-cookie3 pylsqpack aioquic pyaes pbkdf2 pytools; do
pip3 install $x
done

Then there are also some manual steps:
echo "to package the EXE, install verpatch:"
for:

  • packaging tools
  • printing libraries
  • documentation packaging
  • theming
  • CUDA

Packages we do not update as often as others

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

  • incessant package releases (often causing breakage): setuptools, zeroconf
  • buggy releases (see above)
  • avoiding the risk of breaking things (ie: build and packaging tools)
  • harder to update (non automatic updates via pip): pip3 list --outdated
  • unsupported build environments: some projects no longer support python2, or ancient versions of python3, etc - and this has a cascading effect
  • effectively abandoned (ie: pyu2f): should we remove them?

Opaque packages:

  • libyuv : google repository with no actual releases - who really knows what's going on there?

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
Copy link
Collaborator

totaam commented Nov 24, 2023

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

  • filter out build time dependencies that aren't actually used (just installed as a transitive dependency of something else)
  • build time dependencies that aren't shipped (ie: gcc though libgcc might be?, bash, etc)
  • shipped but without the faulty component (ie: libtiff CVE was for an executable we do not include, not the libtiff library we do ship)
  • shipped but unused (ie: unused ffmpeg codecs: 20bb5f0, other parsers)
  • shipped and used, but not exploitable (ie: requires a specific format or API call argument)
  • runtime and used but can be disabled (ie: --video-decoders=none)
  • runtime, used and cannot be disabled (ie: GTK, cairo, etc)
  • runtime, network facing - the danger zone: lz4, rencodeplus, python interpreter.
    etc.

@totaam
Copy link
Collaborator

totaam commented Dec 25, 2023

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
Copy link
Collaborator

totaam commented Dec 26, 2023

@totaam
Copy link
Collaborator

totaam commented Jan 11, 2024

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: Xpra-org/xpra-html5#277


Next up:

  • use a better format: preserve the package names in full using string keys rather than a variable name with prefix
  • cleanup the macos pip3 freeze output - what is the checksum for?
  • query more details for python projects using https://pypi.org/pypi/$PROJECT/json
  • use https://cyclonedx.org/use-cases/ file format?
  • make it easier to access this information, include this together with the exe / dmg packages in the download area?
  • tie it to the dependency page?
  • some kind of automated tracking?

@totaam
Copy link
Collaborator

totaam commented Mar 8, 2024

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
Copy link
Collaborator

totaam commented Mar 30, 2024

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:
msys2/MSYS2-packages@eb7abbb
First vulnerable version was added in:
msys2/MSYS2-packages@d153a09
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
Copy link
Collaborator

totaam commented Apr 3, 2024

Forgot another packages missing from MSYS2 that we should contribute upstream:

echo "you may also want to install libspng for faster PNG support"

Trivial to install: meson build && ninja install.

@totaam
Copy link
Collaborator

totaam commented May 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants