Skip to content

Generate CycloneDX SBOM with Conan deployer - #845

Open
mcc0nnell wants to merge 12 commits into
apache:masterfrom
mcc0nnell:feat/sbom-conan-deployer
Open

Generate CycloneDX SBOM with Conan deployer#845
mcc0nnell wants to merge 12 commits into
apache:masterfrom
mcc0nnell:feat/sbom-conan-deployer

Conversation

@mcc0nnell

@mcc0nnell mcc0nnell commented Aug 27, 2026

Copy link
Copy Markdown

Fixes #824.

This supersedes #844 and incorporates the review feedback from @PengZheng and @pnoltes.

The change keeps SBOM generation in the existing Conan CI and uses Conan’s built-in cyclone_1.6 deployer. It also adds a committed Conan lockfile as a reproducible safe-default dependency baseline, while preserving the ability for downstream Celix users to select or override their own dependencies.

The safe-default lockfile is intentionally stored at:

conan/safe-defaults.lock

rather than as a root-level conan.lock. Conan automatically discovers a root conan.lock, which would implicitly constrain unrelated Celix builds. Keeping it at an explicit path makes use of the baseline opt-in.

For the Linux/GCC/Release configuration, CI generates the CycloneDX 1.6 SBOM with:

conan install .
--lockfile=conan/safe-defaults.lock
--deployer=cyclone_1.6
--deployer-folder=sbom
-b missing
-pr:b default
-pr:h default
-s:h build_type=Release
-o celix/:build_all=True
-o celix/
:celix_cxx17=True
-o mosquitto/*:broker=True
-o *:shared=True

CI publishes both:

  • conan/safe-defaults.lock
  • sbom/sbom-cyclonedx-1.6.json

together as the celix-conan-safe-defaults artifact.

The lockfile records the exact Conan recipe revisions used for this documented baseline. It is not intended to be repository-wide dependency policy: applications remain free to build without it, override dependency versions, or maintain their own lockfile and matching SBOM.

Documentation has also been added explaining the baseline, its scope, how CI generates the SBOM, and how users can opt into the same dependency graph locally.

Validation

  • Uses Conan’s built-in CycloneDX 1.6 deployer; no custom SBOM generator.
  • Uses a lockfile generated from the canonical Linux/GCC/Release full-feature Conan graph.
  • The lockfile and SBOM describe the same resolved dependency baseline.
  • Ordinary Celix builds do not implicitly consume the safe-default lockfile.
  • Different platforms, build options, and downstream dependency overrides remain supported.
  • SBOM guidance is linked from the main Celix documentation.

@PengZheng PengZheng left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would like to invite @pnoltes to have a look.

Comment thread .github/workflows/conan_create.yml Outdated
CXX: ${{ matrix.compiler[1] }}
run: |
conan create . -c tools.cmake.cmaketoolchain:generator=Ninja -b missing -o celix/*:build_all=True -o celix/*:enable_ccache=True -pr:b default -pr:h default -s:h build_type=${{ matrix.type }} -o celix/*:celix_cxx17=True -o celix/*:celix_install_deprecated_api=True -o mosquitto/*:broker=True -o *:shared=True
- name: Generate CycloneDX SBOM

@PengZheng PengZheng Aug 28, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure whether conan_create.yml is the right place to add SBOM support, since a conan package is just a recipe to cook, not the final binary package and SBOM only makes sense for binary package.

For example, I can use --require-override conan option when building Celix to upgrade openssl to fix a security vulnerability without modifying either Celix or the Celix conan reciple. And in this case both SBOM and the final binary artifact will change

conan install . -o celix/*:build_all=True --deployer=cyclone_1.6 --deployer-folder=sbom -b missing -o *:shared=True
- name: Upload CycloneDX SBOM
if: matrix.compiler[0] == 'gcc'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

@PengZheng PengZheng Aug 28, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To my understanding, SBOM should be used with the final binary, thus uploading SBOM alone makes no sense.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can use the SBOM to scan the resolved dependencies for vulnerabilities, as described in a separate follow-up ticket: [#825](#825).

Then we at least know which vulnerabilities exist in the dependencies selected by the current default resolution. However, I am not sure how useful this is without a conan.lock file. With a lockfile, the Celix sources would include a reproducible, resolved dependency list.

Maybe we could generate the lockfile for a GCC Linux build on Ubuntu with build_all=True and use it as our canonical dependency reference. It could then serve as the basis for future vulnerability scans and help ensure more reproducible builds. (and we should document the intended use for a the lockfile and explain that celix is useable without a lockfile).

@PengZheng, maybe we should introduce such a lockfile. WDYT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can use the SBOM to scan the resolved dependencies for vulnerabilities, as described in a separate follow-up ticket: [#825](#825).

This can be done with Conan Audit. We can use it to generate vulnerabilities reports so that we can update Celix dependencies promptly to provide our users with safe defaults.

maybe we should introduce such a lockfile. WDYT?

Both SBOM and lockfile are associated with a specific set of dependencies/options, and our users have freedom to change them at their will. IMHO, providing them a safe defaults should be enough for now.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Both SBOM and lockfile are associated with a specific set of dependencies/options, and our users have freedom to change them at their will. IMHO, providing them a safe defaults should be enough for now.

To ensure we are the same page, do you mean that

a) we should not configure a lock file in our source control

or

b) we can provide a lock file and sbom, but we should communicate that this is a safe defaults, and users have to freedom to change the dependency versions when needed.

I think I prefer option b, but then also document this more clearly (lock file exists for safe defaults, and help in reproducible builds during development)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I prefer option b, but then also document this more clearly (lock file exists for safe defaults, and help in reproducible builds during development)

I agree.

@mcc0nnell
mcc0nnell force-pushed the feat/sbom-conan-deployer branch from e87d52d to e0107b1 Compare August 28, 2026 02:51
@mcc0nnell

Copy link
Copy Markdown
Author

Thanks, this makes sense. I’ve updated the PR so the SBOM is now tied to the concrete Conan binary package rather than generated independently from the recipe.

The GCC job first creates celix/3.0.0, then consumes that package with the same settings/options and runs full_deploy and cyclone_1.6 in the same dependency-graph resolution. The publication step uses -b never so it cannot silently rebuild a different configuration.

CI now uploads the deployed binary packages and the matching CycloneDX SBOM together as a single artifact.

This should address the concern about dependency overrides changing the binary/SBOM relationship. Please let me know if you’d prefer a different packaging boundary.

@PengZheng

PengZheng commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

The action you modified is only for testing. We don't use it to release anything and SBOM generation should be added to the binary release process.

And I just noticed that we do not make any binary release.

@pnoltes
pnoltes self-requested a review August 28, 2026 08:36
@pnoltes

pnoltes commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

The action you modified is only for testing. We don't use it to release anything and SBOM generation should be added to the binary release process.

And I just noticed that we do not make any binary release.

What I have always understood is that ASF releases are primarily source releases, which is also what we do. Especially for Apache Celix, I expect a source release to be more useful because Celix is a framework rather than an end product. I personally see little value in installing a celix executable. The Celix libraries, bundles, and CMake files can of course be installed and used by downstream projects, but I am not sure whether we should provide and maintain an official binary distribution ourselves (small team).

@pnoltes

pnoltes commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

The action you modified is only for testing. We don't use it to release anything and SBOM generation should be added to the binary release process.
And I just noticed that we do not make any binary release.

What I have always understood is that ASF releases are primarily source releases, which is also what we do. Especially for Apache Celix, I expect a source release to be more useful because Celix is a framework rather than an end product. I personally see little value in installing a celix executable. The Celix libraries, bundles, and CMake files can of course be installed and used by downstream projects, but I am not sure whether we should provide and maintain an official binary distribution ourselves (small team).

What I do see as a possibility - and we already do this a bit - is that we provide and push an Apache Celix dev container so that users can more quickly build applications using Apache Celix.

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.

Generate an SBOM

3 participants