Skip to content

Commit 07b5f4c

Browse files
authored
Generate SBOMs during build (#814)
* hbase / phoenix / hbase-operator-tools * airflow / druid * nifi * omid * hadoop / hive / spark / trino * fix: nifi cyclonedx plugin * fix: hive cyclonedx plugin * superset / zookeeper * move instead of copy SBOMs * fix: pre-commit lint fix * fix: simplified zookeeper patch file * fix: undo split of RUN command in Zookeeper Dockerfile * feat: patches for all other product versions * fix: forgot cyclonedx config for druid 26
1 parent 5743664 commit 07b5f4c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+987
-2
lines changed

airflow/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ RUN python3 -m venv --system-site-packages /stackable/app && \
4646
pip install --no-cache-dir --upgrade pip && \
4747
pip install --no-cache-dir apache-airflow[${AIRFLOW_EXTRAS}]==${PRODUCT} --constraint /tmp/constraints.txt && \
4848
# Needed for pandas S3 integration to e.g. write and read csv and parquet files to/from S3
49-
pip install --no-cache-dir s3fs
49+
pip install --no-cache-dir s3fs cyclonedx-bom && \
50+
cyclonedx-py environment --schema-version 1.5 --outfile /stackable/airflow-${PRODUCT}.cdx.json
5051

5152
WORKDIR /stackable
5253
COPY --from=statsd_exporter-builder /statsd_exporter/statsd_exporter /stackable/statsd_exporter

druid/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ cd apache-druid-${PRODUCT}-src
5454

5555
mvn --batch-mode --no-transfer-progress clean install -Pdist,stackable-bundle-contrib-exts -DskipTests -Dmaven.javadoc.skip=true
5656
mv distribution/target/apache-druid-${PRODUCT}-bin/apache-druid-${PRODUCT} /stackable/
57+
mv distribution/target/bom.json /stackable/apache-druid-${PRODUCT}/apache-druid-${PRODUCT}.cdx.json
5758
rm -rf /stackable/apache-druid-${PRODUCT}-src
5859

5960
# We're removing these to make the intermediate layer smaller
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/pom.xml b/pom.xml
2+
index c0f0654..133cbf8 100644
3+
--- a/pom.xml
4+
+++ b/pom.xml
5+
@@ -1558,7 +1558,11 @@
6+
<plugin>
7+
<groupId>org.cyclonedx</groupId>
8+
<artifactId>cyclonedx-maven-plugin</artifactId>
9+
- <version>2.7.5</version>
10+
+ <version>2.8.0</version>
11+
+ <configuration>
12+
+ <projectType>application</projectType>
13+
+ <schemaVersion>1.5</schemaVersion>
14+
+ </configuration>
15+
<executions>
16+
<execution>
17+
<phase>package</phase>

druid/stackable/patches/26.0.0/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
04-update-patch-dependencies.patch
66
05-xmllayout-dependencies.patch
77
06-dont-build-targz.patch
8+
07-cyclonedx-plugin.patch
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/pom.xml b/pom.xml
2+
index ff6ee97..8c99ed3 100644
3+
--- a/pom.xml
4+
+++ b/pom.xml
5+
@@ -1646,7 +1646,11 @@
6+
<plugin>
7+
<groupId>org.cyclonedx</groupId>
8+
<artifactId>cyclonedx-maven-plugin</artifactId>
9+
- <version>2.7.9</version>
10+
+ <version>2.8.0</version>
11+
+ <configuration>
12+
+ <projectType>application</projectType>
13+
+ <schemaVersion>1.5</schemaVersion>
14+
+ </configuration>
15+
<executions>
16+
<execution>
17+
<phase>package</phase>

druid/stackable/patches/28.0.1/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
04-update-patch-dependencies.patch
66
05-xmllayout-dependencies.patch
77
06-dont-build-targz.patch
8+
07-cyclonedx-plugin.patch
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/pom.xml b/pom.xml
2+
index 9051ed2..10a2c85 100644
3+
--- a/pom.xml
4+
+++ b/pom.xml
5+
@@ -1728,7 +1728,11 @@
6+
<plugin>
7+
<groupId>org.cyclonedx</groupId>
8+
<artifactId>cyclonedx-maven-plugin</artifactId>
9+
- <version>2.7.9</version>
10+
+ <version>2.8.0</version>
11+
+ <configuration>
12+
+ <projectType>application</projectType>
13+
+ <schemaVersion>1.5</schemaVersion>
14+
+ </configuration>
15+
<executions>
16+
<execution>
17+
<phase>package</phase>

druid/stackable/patches/30.0.0/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
04-update-patch-dependencies.patch
66
05-xmllayout-dependencies.patch
77
06-dont-build-targz.patch
8+
07-cyclonedx-plugin.patch

hadoop/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ RUN curl --fail -L "https://repo.stackable.tech/repository/packages/hadoop/hadoo
6565
cd hadoop-${PRODUCT}-src && \
6666
mvn --no-transfer-progress clean package -Pdist,native -pl '!hadoop-tools/hadoop-pipes,!hadoop-yarn-project,!hadoop-mapreduce-project,!hadoop-minicluster' -Drequire.fuse=true -DskipTests -Dmaven.javadoc.skip=true && \
6767
cp -r hadoop-dist/target/hadoop-${PRODUCT} /stackable/hadoop-${PRODUCT} && \
68+
mv hadoop-dist/target/bom.json /stackable/hadoop-${PRODUCT}/hadoop-${PRODUCT}.cdx.json && \
6869
# HDFS fuse-dfs is not part of the regular dist output, so we need to copy it in ourselves
6970
cp hadoop-hdfs-project/hadoop-hdfs-native-client/target/main/native/fuse-dfs/fuse_dfs /stackable/hadoop-${PRODUCT}/bin && \
7071
rm -rf /stackable/hadoop-${PRODUCT}-src
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
diff --git a/pom.xml b/pom.xml
2+
index f4e435c..f050218 100644
3+
--- a/pom.xml
4+
+++ b/pom.xml
5+
@@ -116,6 +116,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x
6+
<dependency-check-maven.version>1.4.3</dependency-check-maven.version>
7+
<spotbugs.version>4.2.2</spotbugs.version>
8+
<spotbugs-maven-plugin.version>4.2.0</spotbugs-maven-plugin.version>
9+
+ <cyclonedx.version>2.8.0</cyclonedx.version>
10+
11+
<shell-executable>bash</shell-executable>
12+
13+
@@ -491,6 +492,24 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/x
14+
<groupId>com.github.spotbugs</groupId>
15+
<artifactId>spotbugs-maven-plugin</artifactId>
16+
</plugin>
17+
+ <plugin>
18+
+ <groupId>org.cyclonedx</groupId>
19+
+ <artifactId>cyclonedx-maven-plugin</artifactId>
20+
+ <version>${cyclonedx.version}</version>
21+
+ <configuration>
22+
+ <projectType>application</projectType>
23+
+ <schemaVersion>1.5</schemaVersion>
24+
+ <skipNotDeployed>false</skipNotDeployed>
25+
+ </configuration>
26+
+ <executions>
27+
+ <execution>
28+
+ <phase>package</phase>
29+
+ <goals>
30+
+ <goal>makeBom</goal>
31+
+ </goals>
32+
+ </execution>
33+
+ </executions>
34+
+ </plugin>
35+
</plugins>
36+
</build>
37+

0 commit comments

Comments
 (0)