Skip to content

Commit 91545e5

Browse files
authored
feat(nifi): SBOMs for NARs (#1119)
* feat: copy SBOMs of NARs * chore: align sbom suffixes * chore: changelog
1 parent 16bf74f commit 91545e5

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ All notable changes to this project will be documented in this file.
5757
- cyclonedx-bom: Bump airflow and superset to use `6.0.0` ([#1090]).
5858
- vector: Bump to `0.46.1` ([#1098]).
5959
- spark: update dependencies for 3.5.5 ([#1094])
60+
- nifi: include NAR SBOMs ([#1119])
6061

6162
### Fixed
6263

@@ -128,6 +129,7 @@ All notable changes to this project will be documented in this file.
128129
[#1110]: https://github.com/stackabletech/docker-images/pull/1110
129130
[#1114]: https://github.com/stackabletech/docker-images/pull/1114
130131
[#1116]: https://github.com/stackabletech/docker-images/pull/1116
132+
[#1119]: https://github.com/stackabletech/docker-images/pull/1119
131133

132134
## [25.3.0] - 2025-03-21
133135

nifi/Dockerfile

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,20 @@ mv nifi-assembly/target/nifi-${PRODUCT}-bin/nifi-${PRODUCT} /stackable/nifi-${PR
5959
# Copy the SBOM as well
6060
mv nifi-assembly/target/bom.json /stackable/nifi-${PRODUCT}/nifi-${PRODUCT}.cdx.json
6161

62+
# Get a list of NARs
63+
export NARS=$(ls /stackable/nifi-${PRODUCT}/lib/*.nar | awk -F '/' '{ print $5 }' | sed "s/\-${PRODUCT}.nar\$//g")
64+
# Get a list of SBOMs
65+
find . -name bom.json > bomlist.txt
66+
67+
for nar in $NARS; do
68+
# Try to find the NAR in the list of SBOMs
69+
match=$(grep "\/$nar\/target\/bom.json" bomlist.txt || true)
70+
if [[ -n "$match" ]]; then
71+
# Copy the SBOM of the NAR
72+
cp "$match" "/stackable/nifi-${PRODUCT}/$nar.cdx.json"
73+
fi
74+
done
75+
6276
# Remove sources
6377
(cd .. && rm -r ${PRODUCT})
6478

@@ -100,15 +114,15 @@ if [[ "${PRODUCT}" != 1.* ]] ; then
100114
cp ./nifi-iceberg-services-api-nar/target/nifi-iceberg-services-api-nar-${NIFI_ICEBERG_BUNDLE}.nar /stackable
101115
cp ./nifi-iceberg-services-nar/target/nifi-iceberg-services-nar-${NIFI_ICEBERG_BUNDLE}.nar /stackable
102116
cp ./nifi-iceberg-processors-nar/target/nifi-iceberg-processors-nar-${NIFI_ICEBERG_BUNDLE}.nar /stackable
103-
cp ./target/bom.json /stackable/nifi-iceberg-bundle.sbom.json
117+
cp ./target/bom.json /stackable/nifi-iceberg-bundle.cdx.json
104118

105119
cd ..
106120
# Save disk space, even for intermediate images
107121
rm -rf nifi-iceberg-bundle-${NIFI_ICEBERG_BUNDLE}
108122

109123
# Set correct groups
110124
chmod g=u /stackable/*.nar
111-
chmod g=u /stackable/*.sbom.json
125+
chmod g=u /stackable/*.cdx.json
112126
fi
113127
EOF
114128

@@ -129,7 +143,7 @@ LABEL name="Apache NiFi" \
129143
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/nifi-${PRODUCT} /stackable/nifi-${PRODUCT}/
130144
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/stackable-bcrypt.jar /stackable/stackable-bcrypt.jar
131145
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*.nar /stackable/nifi-${PRODUCT}/lib/
132-
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*.sbom.json /stackable/nifi-${PRODUCT}/lib/
146+
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-iceberg-bundle-builder /stackable/*.cdx.json /stackable/nifi-${PRODUCT}/lib/
133147
COPY --chown=${STACKABLE_USER_UID}:0 --from=nifi-builder /stackable/git-sync /stackable/git-sync
134148

135149
COPY --chown=${STACKABLE_USER_UID}:0 nifi/stackable/bin /stackable/bin

0 commit comments

Comments
 (0)