Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apps: Add a flag to disable SBOM generation #334

Merged
merged 1 commit into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions apps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,14 @@ for x in $IMAGES ; do

echo "Build step $((completed+2)) of $total is complete"

status "Doing a syft SBOM scan"
sbom_dst=/archive/sboms/${ct_base}/${ARCH}.spdx.json
mkdir -p $(dirname $sbom_dst)
syft ${ct_base}:$TAG-$ARCH -o spdx-json > $sbom_dst
if [ -z "$DISABLE_SBOM" ] ; then
Copy link
Contributor

Choose a reason for hiding this comment

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

@doanac To implement this a user adds this to the params block of containers?

DISABLE_SBOM: "1"

Copy link
Member Author

Choose a reason for hiding this comment

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

yep. i'm testing that now

Copy link
Member Author

Choose a reason for hiding this comment

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

status "Doing a Syft SBOM scan"
sbom_dst=/archive/sboms/${ct_base}/${ARCH}.spdx.json
mkdir -p $(dirname $sbom_dst)
syft ${ct_base}:$TAG-$ARCH -o spdx-json > $sbom_dst
else
status "Skipping SBOM generation: DISABLE_SBOM enabled"
fi

if [ -n "$TEST_CMD" ] ; then
status Running test command inside container: $TEST_CMD
Expand Down Expand Up @@ -216,7 +220,9 @@ done
# factory may not have built any containers, so ensure the directory exists
[ -d $HOME/.docker/manifests ] && mv $HOME/.docker/manifests /archive/manifests || echo 'no manifests to archive'

PYTHONPATH=${HERE}/.. python3 ${HERE}/generate_non_factory_sboms.py --arch=$ARCH
if [ -z "$DISABLE_SBOM" ] ; then
PYTHONPATH=${HERE}/.. python3 ${HERE}/generate_non_factory_sboms.py --arch=$ARCH
fi
# 1. Parse the local docker store (the one where the built images are stored).
# 2. Extract layers metadata (size, usage) of all Apps' images
# 3. Store the gathered layers metadata as a CI artifact
Expand Down