Skip to content

Commit 51f9f20

Browse files
authored
Add SBOM lite file and tooling to update it (#9)
1 parent 3e9fc82 commit 51f9f20

File tree

3 files changed

+98
-2
lines changed

3 files changed

+98
-2
lines changed

README.maint.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ derived from `libmongocrypt` version as described below.
1212
3. Download the source code of the corresponding version of `libmongocrypt` from
1313
https://github.com/mongodb/libmongocrypt/releases/, and unpack it to
1414
`ext/libmongocrypt/libmongocrypt`.
15-
4. Commit the changes including the new shared library.
16-
5. Run `./release.sh` to create a gem and push it to RubyGems.
15+
4. Update the SBOM lite file by running `etc/update-sbom.sh`
16+
5. Commit the changes including the new shared library.
17+
6Run `./release.sh` to create a gem and push it to RubyGems.
1718

1819
## Helper Version Scheme
1920

etc/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+
VERSION_FILE="${ROOT_DIR}/lib/libmongocrypt_helper/version.rb"
6+
PURLS_FILE="${ROOT_DIR}/purls.txt"
7+
8+
# Extract libmongocrypt version from version file. The sequence "'\''" in sed matches a single quote
9+
LIBMONGOCRYPT_VERSION=$(grep -e "LIBMONGOCRYPT_VERSION = " ${VERSION_FILE} | sed -n -e 's/^.*LIBMONGOCRYPT_VERSION = '\''\(.*\)'\''$/\1/p')
10+
11+
# Generate purls file from stored versions
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

sbom.json

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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.8.0.tar.gz"
9+
},
10+
{
11+
"type": "website",
12+
"url": "https://github.com/mongodb/libmongocrypt/tree/1.8.0"
13+
}
14+
],
15+
"group": "mongodb",
16+
"name": "libmongocrypt",
17+
"purl": "pkg:github/mongodb/[email protected]",
18+
"type": "library",
19+
"version": "1.8.0"
20+
}
21+
],
22+
"dependencies": [
23+
{
24+
"ref": "pkg:github/mongodb/[email protected]"
25+
}
26+
],
27+
"metadata": {
28+
"timestamp": "2024-06-12T07:24:32.253682+00:00",
29+
"tools": [
30+
{
31+
"externalReferences": [
32+
{
33+
"type": "build-system",
34+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/actions"
35+
},
36+
{
37+
"type": "distribution",
38+
"url": "https://pypi.org/project/cyclonedx-python-lib/"
39+
},
40+
{
41+
"type": "documentation",
42+
"url": "https://cyclonedx-python-library.readthedocs.io/"
43+
},
44+
{
45+
"type": "issue-tracker",
46+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/issues"
47+
},
48+
{
49+
"type": "license",
50+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE"
51+
},
52+
{
53+
"type": "release-notes",
54+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md"
55+
},
56+
{
57+
"type": "vcs",
58+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib"
59+
},
60+
{
61+
"type": "website",
62+
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/#readme"
63+
}
64+
],
65+
"name": "cyclonedx-python-lib",
66+
"vendor": "CycloneDX",
67+
"version": "6.4.4"
68+
}
69+
]
70+
},
71+
"serialNumber": "urn:uuid:67ce9be7-c1c0-436f-a7d7-c636db7b882b",
72+
"version": 1,
73+
"$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
74+
"bomFormat": "CycloneDX",
75+
"specVersion": "1.5"
76+
}

0 commit comments

Comments
 (0)