-
Notifications
You must be signed in to change notification settings - Fork 969
feat: SBOM generation and OmniBOR build provenance (CRA compliance) #10343
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -350,3 +350,113 @@ merge-clean: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .cu.lo: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(LIBTOOL) --tag=CC --mode=compile $(COMPILE) --compile -o $@ $< -static | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # SBOM generation (CRA compliance) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SBOM_CDX = wolfssl-$(PACKAGE_VERSION).cdx.json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SBOM_SPDX = wolfssl-$(PACKAGE_VERSION).spdx.json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SBOM_SPDX_TV = wolfssl-$(PACKAGE_VERSION).spdx | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sbomdir = $(datadir)/doc/$(PACKAGE) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .PHONY: sbom install-sbom uninstall-sbom | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sbom: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @if test -z "$(PYTHON3)"; then \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo ""; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "ERROR: 'python3' not found in PATH. Cannot generate SBOM."; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo ""; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @if test -z "$(PYSPDXTOOLS)"; then \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo ""; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "ERROR: 'pyspdxtools' not found in PATH. Cannot validate SBOM."; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " Install: pip install spdx-tools"; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo ""; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rm -rf $(abs_builddir)/_sbom_staging | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(MAKE) install DESTDIR=$(abs_builddir)/_sbom_staging | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(PYTHON3) $(srcdir)/scripts/gen-sbom \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --name $(PACKAGE) \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --version $(PACKAGE_VERSION) \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --license-file $(srcdir)/LICENSING \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --options-h $(abs_builddir)/wolfssl/options.h \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --lib $(abs_builddir)/_sbom_staging$(libdir)/libwolfssl.so.$(WOLFSSL_LIBRARY_VERSION_FIRST).$(WOLFSSL_LIBRARY_VERSION_SECOND).$(WOLFSSL_LIBRARY_VERSION_THIRD) \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --dep-liboqs $(ENABLED_LIBOQS) \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --dep-libxmss $(ENABLED_LIBXMSS) \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --dep-libxmss-root '$(XMSS_ROOT)' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --dep-liblms $(ENABLED_LIBLMS) \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --dep-liblms-root '$(LIBLMS_ROOT)' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --dep-libz $(ENABLED_LIBZ) \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --git '$(GIT)' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --cdx-out $(abs_builddir)/$(SBOM_CDX) \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --spdx-out $(abs_builddir)/$(SBOM_SPDX) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+378
to
+392
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rm -rf $(abs_builddir)/_sbom_staging | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(PYSPDXTOOLS) --infile $(abs_builddir)/$(SBOM_SPDX) \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+376
to
+394
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --outfile $(abs_builddir)/$(SBOM_SPDX_TV) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| install-sbom: sbom | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(MKDIR_P) $(DESTDIR)$(sbomdir) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(INSTALL_DATA) $(SBOM_CDX) $(DESTDIR)$(sbomdir)/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(INSTALL_DATA) $(SBOM_SPDX) $(DESTDIR)$(sbomdir)/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(INSTALL_DATA) $(SBOM_SPDX_TV) $(DESTDIR)$(sbomdir)/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uninstall-sbom: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rm -f $(DESTDIR)$(sbomdir)/$(SBOM_CDX) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rm -f $(DESTDIR)$(sbomdir)/$(SBOM_SPDX) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rm -f $(DESTDIR)$(sbomdir)/$(SBOM_SPDX_TV) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| CLEANFILES += $(SBOM_CDX) $(SBOM_SPDX) $(SBOM_SPDX_TV) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Bomsh (OmniBOR build artifact tracing + SBOM enrichment) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BOMSH_RAWLOG_BASE = $(abs_builddir)/bomsh_raw_logfile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BOMSH_RAWLOG = $(BOMSH_RAWLOG_BASE).sha1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BOMSH_CONF = $(abs_builddir)/_bomsh.conf | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BOMSH_OMNIBORDIR = $(abs_builddir)/omnibor | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BOMSH_SPDX_OUT = omnibor.wolfssl-$(PACKAGE_VERSION).spdx.json | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bomshdir = $(datadir)/doc/$(PACKAGE) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .PHONY: bomsh install-bomsh uninstall-bomsh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bomsh: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @if test -z "$(BOMTRACE3)"; then \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo ""; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "ERROR: 'bomtrace3' not found in PATH. Cannot generate OmniBOR data."; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " Build bomtrace3 from: https://github.com/omnibor/bomsh"; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo ""; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @if test -z "$(BOMSH_CREATE_BOM)"; then \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo ""; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "ERROR: 'bomsh_create_bom.py' not found in PATH. Cannot process OmniBOR data."; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo " Install from: https://github.com/omnibor/bomsh"; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo ""; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(MAKE) clean | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @printf 'raw_logfile=%s\n' '$(BOMSH_RAWLOG_BASE)' > '$(BOMSH_CONF)' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(BOMTRACE3) -c '$(BOMSH_CONF)' $(MAKE) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(BOMSH_CREATE_BOM) -r '$(BOMSH_RAWLOG)' -b '$(BOMSH_OMNIBORDIR)' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @if test -n "$(BOMSH_SBOM)" && test -f '$(abs_builddir)/wolfssl-$(PACKAGE_VERSION).spdx.json'; then \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Enriching SPDX with OmniBOR ExternalRefs..."; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+435
to
+440
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| $(BOMSH_SBOM) \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -b '$(BOMSH_OMNIBORDIR)' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -i '$(abs_builddir)/wolfssl-$(PACKAGE_VERSION).spdx.json' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -f '$(abs_builddir)/src/.libs/libwolfssl.so.$(WOLFSSL_LIBRARY_VERSION_FIRST).$(WOLFSSL_LIBRARY_VERSION_SECOND).$(WOLFSSL_LIBRARY_VERSION_THIRD)' \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -s spdx-json \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -O '$(abs_builddir)'; \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+440
to
+446
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Enriching SPDX with OmniBOR ExternalRefs..."; \ | |
| $(BOMSH_SBOM) \ | |
| -b '$(BOMSH_OMNIBORDIR)' \ | |
| -i '$(abs_builddir)/wolfssl-$(PACKAGE_VERSION).spdx.json' \ | |
| -f '$(abs_builddir)/src/.libs/libwolfssl.so.$(WOLFSSL_LIBRARY_VERSION_FIRST).$(WOLFSSL_LIBRARY_VERSION_SECOND).$(WOLFSSL_LIBRARY_VERSION_THIRD)' \ | |
| -s spdx-json \ | |
| -O '$(abs_builddir)'; \ | |
| bomsh_artifact=""; \ | |
| for candidate in \ | |
| $(abs_builddir)/src/.libs/libwolfssl.so \ | |
| $(abs_builddir)/src/.libs/libwolfssl.so.* \ | |
| $(abs_builddir)/src/.libs/libwolfssl.dylib \ | |
| $(abs_builddir)/src/.libs/libwolfssl.*.dylib \ | |
| $(abs_builddir)/src/.libs/libwolfssl.a \ | |
| $(abs_builddir)/src/libwolfssl.a; do \ | |
| if test -f "$$candidate"; then \ | |
| bomsh_artifact="$$candidate"; \ | |
| break; \ | |
| fi; \ | |
| done; \ | |
| if test -n "$$bomsh_artifact"; then \ | |
| echo "Enriching SPDX with OmniBOR ExternalRefs..."; \ | |
| $(BOMSH_SBOM) \ | |
| -b '$(BOMSH_OMNIBORDIR)' \ | |
| -i '$(abs_builddir)/wolfssl-$(PACKAGE_VERSION).spdx.json' \ | |
| -f "$$bomsh_artifact" \ | |
| -s spdx-json \ | |
| -O '$(abs_builddir)'; \ | |
| else \ | |
| echo "NOTE: unable to locate a built libwolfssl artifact for SPDX enrichment."; \ | |
| fi; \ |
Copilot
AI
Apr 28, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
install-bomsh uses cp -r to install the omnibor/ tree. This bypasses standard install tooling (permissions, verbosity, portability, $(INSTALL) overrides) and can behave differently across platforms. Consider using an Automake-friendly install approach (e.g., create the dir then copy files with $(INSTALL_DATA) via find, or use tar piping) so packaging/install behaves consistently.
| $(MKDIR_P) $(DESTDIR)$(bomshdir) | |
| cp -r '$(BOMSH_OMNIBORDIR)' '$(DESTDIR)$(bomshdir)/omnibor' | |
| $(MKDIR_P) '$(DESTDIR)$(bomshdir)' | |
| $(MKDIR_P) '$(DESTDIR)$(bomshdir)/omnibor' | |
| @if test -d '$(BOMSH_OMNIBORDIR)'; then \ | |
| cd '$(BOMSH_OMNIBORDIR)' && tar cf - . | \ | |
| (cd '$(DESTDIR)$(bomshdir)/omnibor' && tar xpf -); \ | |
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SBOM hash input path is hard-coded to
libwolfssl.so.<first>.<second>.<third>. This will fail on configurations that disable shared libraries (e.g.,--disable-shared, and also when--with-libxmss/--with-liblmsforcesenable_shared=noinconfigure.ac). Please detect the installed library artifact dynamically (shared vs static, platform suffixes) or fall back to hashing the static archive when the.sois not present.