Skip to content

Commit 9ee4c40

Browse files
authored
feat: SBOMs for OpenSearch and opensearch-security-plugin (#1211)
feat: SBOMs for opensearch
1 parent 19b06dc commit 9ee4c40

File tree

4 files changed

+81
-1
lines changed

4 files changed

+81
-1
lines changed

opensearch/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ WORKDIR /stackable
1111

1212
COPY --chown=${STACKABLE_USER_UID}:0 opensearch/stackable/patches/patchable.toml /stackable/src/opensearch/stackable/patches/patchable.toml
1313
COPY --chown=${STACKABLE_USER_UID}:0 opensearch/stackable/patches/${PRODUCT} /stackable/src/opensearch/stackable/patches/${PRODUCT}
14-
COPY --chown=${STACKABLE_USER_UID}:0 --from=opensearch-security-plugin /stackable/src/opensearch/security-plugin/patchable-work/worktree/${OPENSEARCH_SECURITY_PLUGIN}/build/distributions/opensearch-security-${OPENSEARCH_SECURITY_PLUGIN}-SNAPSHOT.zip /stackable/opensearch-security-plugin/opensearch-security-${OPENSEARCH_SECURITY_PLUGIN}-SNAPSHOT.zip
1514

1615
RUN <<EOF
1716
microdnf update
@@ -29,11 +28,15 @@ NEW_VERSION="${PRODUCT}-stackable${RELEASE}"
2928
# Create snapshot of the source code including custom patches
3029
tar -czf /stackable/opensearch-${NEW_VERSION}-src.tar.gz .
3130
./gradlew localDistro
31+
./gradlew cyclonedxBom --warning-mode=summary
3232
cp -r ./distribution/archives/linux-tar/build/install/opensearch-${PRODUCT}-SNAPSHOT /stackable/opensearch
3333
cp ./distribution/docker/src/docker/bin/docker-entrypoint.sh /stackable/opensearch/opensearch-docker-entrypoint.sh
34+
cp build/reports/bom.json /stackable/opensearch/opensearch-${PRODUCT}-SNAPSHOT.cdx.json
3435
EOF
3536

3637
WORKDIR /stackable/opensearch-security-plugin
38+
COPY --chown=${STACKABLE_USER_UID}:0 --from=opensearch-security-plugin /stackable/src/opensearch/security-plugin/patchable-work/worktree/${OPENSEARCH_SECURITY_PLUGIN}/build/distributions/opensearch-security-${OPENSEARCH_SECURITY_PLUGIN}-SNAPSHOT.zip /stackable/opensearch-security-plugin/opensearch-security-${OPENSEARCH_SECURITY_PLUGIN}-SNAPSHOT.zip
39+
COPY --chown=${STACKABLE_USER_UID}:0 --from=opensearch-security-plugin /stackable/src/opensearch/security-plugin/patchable-work/worktree/${OPENSEARCH_SECURITY_PLUGIN}/build/reports/bom.json /stackable/opensearch-security-plugin/opensearch-security-${OPENSEARCH_SECURITY_PLUGIN}-SNAPSHOT.cdx.json
3740

3841
RUN <<EOF
3942
unzip opensearch-security-${OPENSEARCH_SECURITY_PLUGIN}-SNAPSHOT.zip

opensearch/security-plugin/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ cd "$(/stackable/patchable --images-repo-root=src checkout opensearch/security-p
1616
# Create snapshot of the source code including custom patches
1717
tar -czf /stackable/opensearch-security-plugin-${PRODUCT}-src.tar.gz .
1818
./gradlew clean assemble
19+
./gradlew cyclonedxBom --warning-mode=summary
1920
EOF
2021

2122
RUN <<EOF
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
From eb596aa60cc21369d742b8d73604a2aac2a70f59 Mon Sep 17 00:00:00 2001
2+
From: dervoeti <lukas.krug@stackable.tech>
3+
Date: Tue, 22 Jul 2025 09:52:55 +0200
4+
Subject: Add CycloneDX plugin
5+
6+
---
7+
build.gradle | 11 +++++++++++
8+
1 file changed, 11 insertions(+)
9+
10+
diff --git a/build.gradle b/build.gradle
11+
index bb2e65ab..314bb7be 100644
12+
--- a/build.gradle
13+
+++ b/build.gradle
14+
@@ -71,6 +71,7 @@ plugins {
15+
id 'eclipse'
16+
id "com.github.spotbugs" version "6.2.0"
17+
id "com.google.osdetector" version "1.7.3"
18+
+ id "org.cyclonedx.bom" version "2.3.1"
19+
}
20+
21+
allprojects {
22+
@@ -87,6 +88,16 @@ apply from: 'gradle/formatting.gradle'
23+
licenseFile = rootProject.file('LICENSE.txt')
24+
noticeFile = rootProject.file('NOTICE.txt')
25+
26+
+cyclonedxBom {
27+
+ includeConfigs = ["runtimeClasspath"]
28+
+ includeLicenseText = false
29+
+ skipConfigs = ["compileClasspath", "testCompileClasspath"]
30+
+ projectType = "application"
31+
+ schemaVersion = "1.6"
32+
+ outputFormat = "json"
33+
+ componentVersion = opensearch_build
34+
+}
35+
+
36+
spotbugs {
37+
includeFilter = file('spotbugs-include.xml')
38+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
From b216d37795bbf81a5ebad73101d8081a8f93068c Mon Sep 17 00:00:00 2001
2+
From: dervoeti <lukas.krug@stackable.tech>
3+
Date: Mon, 21 Jul 2025 12:45:43 +0200
4+
Subject: Add CycloneDX plugin
5+
6+
---
7+
build.gradle | 11 +++++++++++
8+
1 file changed, 11 insertions(+)
9+
10+
diff --git a/build.gradle b/build.gradle
11+
index e7988cb852f..4c2f2374a99 100644
12+
--- a/build.gradle
13+
+++ b/build.gradle
14+
@@ -58,6 +58,7 @@ plugins {
15+
id "org.gradle.test-retry" version "1.6.2" apply false
16+
id "test-report-aggregation"
17+
id 'jacoco-report-aggregation'
18+
+ id 'org.cyclonedx.bom' version '1.8.2'
19+
}
20+
21+
apply from: 'gradle/build-complete.gradle'
22+
@@ -77,6 +78,16 @@ allprojects {
23+
description = "OpenSearch subproject ${project.path}"
24+
}
25+
26+
+cyclonedxBom {
27+
+ includeConfigs = ["runtimeClasspath"]
28+
+ includeLicenseText = false
29+
+ skipConfigs = ["compileClasspath", "testCompileClasspath"]
30+
+ projectType = "application"
31+
+ schemaVersion = "1.6"
32+
+ outputFormat = "json"
33+
+ componentVersion = VersionProperties.getOpenSearch()
34+
+}
35+
+
36+
configure(allprojects - project(':distribution:archives:integ-test-zip')) {
37+
project.pluginManager.withPlugin('nebula.maven-base-publish') {
38+
if (project.pluginManager.hasPlugin('opensearch.build') == false) {

0 commit comments

Comments
 (0)