Skip to content

Commit 57a3c2d

Browse files
committed
CXX-3008 fix jq command and update SilkBomb before download (#1154)
* CXX-3008 fix jq command and update SilkBomb before download * Update Augmented SBOM with empty vulnerabilities field
1 parent c62aa50 commit 57a3c2d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.evergreen/check-augmented-sbom.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ command -v jq >/dev/null || {
1515

1616
podman login --password-stdin --username "${ARTIFACTORY_USER:?}" artifactory.corp.mongodb.com <<<"${ARTIFACTORY_PASSWORD:?}"
1717

18+
# Ensure latest version of SilkBomb is being used.
19+
podman pull artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0
20+
1821
silkbomb_download_flags=(
1922
# Avoid bumping version or timestamp in diff.
2023
--no-update-sbom-version
@@ -40,10 +43,11 @@ podman run \
4043

4144
echo "Comparing Augmented SBOM..."
4245

46+
old_json="$(jq -S '.' ./etc/augmented.sbom.json)"
47+
new_json="$(jq -S '.' ./etc/augmented.sbom.json.new)"
48+
4349
# Allow task to upload the augmented SBOM despite failed diff.
44-
if ! diff -sty --left-column -W 200 \
45-
<(jq ./etc/augmented.sbom.json) \
46-
<(jq ./etc/augmented.sbom.json.new) >|diff.txt; then
50+
if ! diff -sty --left-column -W 200 <<<"${old_json:?}" <<<"${new_json:?}" >|diff.txt; then
4751
declare status
4852
status='{"status":"failed", "type":"test", "should_continue":true, "desc":"detected significant changes in Augmented SBOM"}'
4953
curl -sS -d "${status:?}" -H "Content-Type: application/json" -X POST localhost:2285/task_status || true

etc/augmented.sbom.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
}
6363
],
6464
"metadata": {
65-
"timestamp": "2024-06-06T18:10:31.789025+00:00",
65+
"timestamp": "2024-06-05T21:16:58.419485+00:00",
6666
"tools": [
6767
{
6868
"externalReferences": [
@@ -109,5 +109,6 @@
109109
"version": 1,
110110
"$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
111111
"bomFormat": "CycloneDX",
112-
"specVersion": "1.5"
112+
"specVersion": "1.5",
113+
"vulnerabilities": []
113114
}

0 commit comments

Comments
 (0)