|
| 1 | +From 180057545225e49cea09c74e454ee6bef30521b5 Mon Sep 17 00:00:00 2001 |
| 2 | +From: dervoeti <lukas.krug@stackable.tech> |
| 3 | +Date: Thu, 26 Mar 2026 21:05:47 +0000 |
| 4 | +Subject: Scope CycloneDX SBOM to shipped components only |
| 5 | + |
| 6 | +Exclude plugin subprojects that are not included in the opensearch-min |
| 7 | +distribution from the CycloneDX BOM generation. Only repository-s3 and |
| 8 | +telemetry-otel are shipped from the local build. Other plugins like |
| 9 | +ingest-attachment (which pulls in tika-core) are not installed in the |
| 10 | +Stackable image and should not appear in the runtime SBOM. |
| 11 | +--- |
| 12 | + build.gradle | 15 +++++++++++++++ |
| 13 | + 1 file changed, 15 insertions(+) |
| 14 | + |
| 15 | +diff --git a/build.gradle b/build.gradle |
| 16 | +index 49d3b971efa..aa2638b6a60 100644 |
| 17 | +--- a/build.gradle |
| 18 | ++++ b/build.gradle |
| 19 | +@@ -82,6 +82,21 @@ allprojects { |
| 20 | + version = VersionProperties.getOpenSearch() |
| 21 | + description = "OpenSearch subproject ${project.path}" |
| 22 | + |
| 23 | ++ // Only include subprojects that are part of the opensearch-min distribution |
| 24 | ++ // (server, libs, modules) plus the core plugins shipped in the Stackable |
| 25 | ++ // image (repository-s3 and telemetry-otel). This prevents build-only plugin |
| 26 | ++ // dependencies (e.g. tika-core from ingest-attachment) from appearing in the |
| 27 | ++ // runtime SBOM as false positives. |
| 28 | ++ def shippedPlugins = ['repository-s3', 'telemetry-otel'] as Set |
| 29 | ++ def isUnshippedPlugin = (project.path.startsWith(':plugins:') && !(project.name in shippedPlugins)) || |
| 30 | ++ project.path.startsWith(':example-plugins') |
| 31 | ++ |
| 32 | ++ if (isUnshippedPlugin) { |
| 33 | ++ tasks.matching { it.name == 'cyclonedxDirectBom' }.configureEach { |
| 34 | ++ enabled = false |
| 35 | ++ } |
| 36 | ++ } |
| 37 | ++ |
| 38 | + cyclonedxDirectBom { |
| 39 | + includeConfigs = ["runtimeClasspath"] |
| 40 | + skipConfigs = ["compileClasspath", "testCompileClasspath"] |
0 commit comments