Skip to content

Commit 54b544d

Browse files
committed
Add SBOM file and script for updating it
1 parent 74e4459 commit 54b544d

File tree

3 files changed

+119
-0
lines changed

3 files changed

+119
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,6 @@ mongodb-*tgz
6767

6868
# Coverage files
6969
coverage*
70+
71+
# temporary purls file
72+
/purls.txt

sbom.json

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"components": [
3+
{
4+
"bom-ref": "pkg:github/mongodb/[email protected]",
5+
"externalReferences": [
6+
{
7+
"type": "distribution",
8+
"url": "https://github.com/mongodb/libmongocrypt/archive/refs/tags/1.10.0.tar.gz"
9+
},
10+
{
11+
"type": "website",
12+
"url": "https://github.com/mongodb/libmongocrypt/tree/1.10.0"
13+
}
14+
],
15+
"group": "mongodb",
16+
"name": "libmongocrypt",
17+
"purl": "pkg:github/mongodb/[email protected]",
18+
"type": "library",
19+
"version": "1.10.0"
20+
},
21+
{
22+
"bom-ref": "pkg:github/mongodb/[email protected]",
23+
"externalReferences": [
24+
{
25+
"type": "distribution",
26+
"url": "https://github.com/mongodb/mongo-c-driver/archive/refs/tags/1.27.2.tar.gz"
27+
},
28+
{
29+
"type": "website",
30+
"url": "https://github.com/mongodb/mongo-c-driver/tree/1.27.2"
31+
}
32+
],
33+
"group": "mongodb",
34+
"name": "mongo-c-driver",
35+
"purl": "pkg:github/mongodb/[email protected]",
36+
"type": "library",
37+
"version": "1.27.2"
38+
}
39+
],
40+
"dependencies": [
41+
{
42+
"ref": "pkg:github/mongodb/[email protected]"
43+
},
44+
{
45+
"ref": "pkg:github/mongodb/[email protected]"
46+
}
47+
],
48+
"metadata": {
49+
"timestamp": "2024-06-06T07:13:52.679415+00:00",
50+
"tools": [
51+
{
52+
"externalReferences": [
53+
{
54+
"type": "build-system",
55+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/actions"
56+
},
57+
{
58+
"type": "distribution",
59+
"url": "https://pypi.org/project/cyclonedx-python-lib/"
60+
},
61+
{
62+
"type": "documentation",
63+
"url": "https://cyclonedx-python-library.readthedocs.io/"
64+
},
65+
{
66+
"type": "issue-tracker",
67+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/issues"
68+
},
69+
{
70+
"type": "license",
71+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE"
72+
},
73+
{
74+
"type": "release-notes",
75+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md"
76+
},
77+
{
78+
"type": "vcs",
79+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib"
80+
},
81+
{
82+
"type": "website",
83+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/#readme"
84+
}
85+
],
86+
"name": "cyclonedx-python-lib",
87+
"vendor": "CycloneDX",
88+
"version": "6.4.4"
89+
}
90+
]
91+
},
92+
"serialNumber": "urn:uuid:acb30d08-ee47-4ff0-b301-d66ef1f54082",
93+
"version": 1,
94+
"$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
95+
"bomFormat": "CycloneDX",
96+
"specVersion": "1.5"
97+
}

scripts/update-sbom.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
4+
ROOT_DIR=$(realpath "${SCRIPT_DIR}/../")
5+
PURLS_FILE="${ROOT_DIR}/purls.txt"
6+
7+
LIBMONGOC_VERSION=$(cat ${ROOT_DIR}/src/LIBMONGOC_VERSION_CURRENT | tr -d '[:space:]')
8+
LIBMONGOCRYPT_VERSION=$(cat ${ROOT_DIR}/src/LIBMONGOCRYPT_VERSION_CURRENT | tr -d '[:space:]')
9+
10+
# Generate purls file from stored versions
11+
echo "pkg:github/mongodb/mongo-c-driver@${LIBMONGOC_VERSION}" > $PURLS_FILE
12+
echo "pkg:github/mongodb/libmongocrypt@${LIBMONGOCRYPT_VERSION}" >> $PURLS_FILE
13+
14+
# Use silkbomb to update the sbom.json file
15+
docker run --platform="linux/amd64" -it --rm -v ${ROOT_DIR}:/pwd \
16+
artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 \
17+
update --sbom-in /pwd/sbom.json --purls /pwd/purls.txt --sbom-out /pwd/sbom.json
18+
19+
rm $PURLS_FILE

0 commit comments

Comments
 (0)