Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d8ad9da
Add GitHub Action
jasonhills-mongodb Nov 22, 2025
579c8d7
Adjust trigger
jasonhills-mongodb Nov 22, 2025
e404ce5
Set working dir and verbose
jasonhills-mongodb Nov 22, 2025
87e563a
Disable exclude path
jasonhills-mongodb Nov 22, 2025
602e0be
Delete unneeded source
jasonhills-mongodb Nov 22, 2025
191f47c
Disable Install dev libs
jasonhills-mongodb Nov 22, 2025
8498f94
Add exclude path src/** w/o quotes
jasonhills-mongodb Nov 22, 2025
7dce2aa
Exclude pathwith quotes
jasonhills-mongodb Nov 22, 2025
6cbeb35
Add ENABLE_TESTS=ON for Catch2
jasonhills-mongodb Nov 22, 2025
ae82151
Use scan profile for extra args
jasonhills-mongodb Nov 22, 2025
06876c8
Use scan profile for extra args fix
jasonhills-mongodb Nov 22, 2025
73ed54d
Scan profile with shell run
jasonhills-mongodb Nov 22, 2025
6fb1c63
With git add
jasonhills-mongodb Nov 22, 2025
9966a2c
ENDOR_SCAN_USE_SCAN_PROFILE
jasonhills-mongodb Nov 22, 2025
74b602c
NDOR_SCAN_USE_SCAN_PROFILE with gh action
jasonhills-mongodb Nov 22, 2025
0f8e52e
Remove unneeded source files with git rm
jasonhills-mongodb Nov 22, 2025
728ea0c
With got add .
jasonhills-mongodb Nov 22, 2025
b645cd7
add path: build/_deps
jasonhills-mongodb Nov 22, 2025
c7b7834
scan_path
jasonhills-mongodb Nov 22, 2025
ef75eba
include-path
jasonhills-mongodb Nov 22, 2025
294b846
include build/**
jasonhills-mongodb Nov 22, 2025
d287e8f
Rename build folder
jasonhills-mongodb Nov 22, 2025
71156e7
w/git add
jasonhills-mongodb Nov 22, 2025
99fad4f
revert to full scan
jasonhills-mongodb Nov 22, 2025
696d21b
Add an ignore, add python, add old sbom
jasonhills-mongodb Nov 23, 2025
fc26751
Refresh
jasonhills-mongodb Nov 25, 2025
dc18657
Add --enable-github-action-token
jasonhills-mongodb Nov 26, 2025
5f10119
Improve context_type tracking
jasonhills-mongodb Nov 26, 2025
23f2f15
Improvements plus add PR
jasonhills-mongodb Nov 26, 2025
250625c
use uv group sbom, bypass scan for testing
jasonhills-mongodb Nov 26, 2025
ca06a64
Skip cmake, inline uv deps
jasonhills-mongodb Nov 26, 2025
dea5b19
Remove install dependencies
jasonhills-mongodb Nov 26, 2025
99ee44b
fail-fast: false
jasonhills-mongodb Nov 26, 2025
17bba3d
Fixed recursion bug
jasonhills-mongodb Nov 26, 2025
f68bf6b
contents: write
jasonhills-mongodb Nov 26, 2025
289007a
pull-requests: write
jasonhills-mongodb Nov 26, 2025
b7ec1ac
Update SBOM file(s)
jasonhills-mongodb Nov 26, 2025
a619582
Merge pull request #3 from jasonhills-mongodb/cxx-sbom-update
jasonhills-mongodb Nov 26, 2025
0d874e6
Fix endor_components_remove
jasonhills-mongodb Nov 26, 2025
524931e
Update PR body content
jasonhills-mongodb Dec 2, 2025
bab76ec
Add SBOM diff
jasonhills-mongodb Dec 2, 2025
8ec256f
diff brief and true
jasonhills-mongodb Dec 2, 2025
9e8f7a0
Remove set-output
jasonhills-mongodb Dec 2, 2025
bdfad45
Add warnings none
jasonhills-mongodb Dec 2, 2025
0eb8781
len(warning_handler.warnings)
jasonhills-mongodb Dec 2, 2025
89c84d8
add back build and perform ruff format
jasonhills-mongodb Dec 2, 2025
7833a2c
Change tiggers
jasonhills-mongodb Dec 2, 2025
a109099
Add pr scan
jasonhills-mongodb Dec 2, 2025
ccd8b41
Rename job
jasonhills-mongodb Dec 2, 2025
b390344
Add warning
jasonhills-mongodb Dec 2, 2025
9b7c5d3
update docs
jasonhills-mongodb Dec 3, 2025
c6c40ea
include-path build/_deps
jasonhills-mongodb Dec 3, 2025
0bbabe1
git add .
jasonhills-mongodb Dec 3, 2025
2cf0e68
ignore-paths
jasonhills-mongodb Dec 3, 2025
13e0680
cat config
jasonhills-mongodb Dec 3, 2025
7ead74d
which endorctl
jasonhills-mongodb Dec 3, 2025
63736a5
cat .endorctl/config.yaml
jasonhills-mongodb Dec 3, 2025
cddf62c
git add and commit
jasonhills-mongodb Dec 3, 2025
78f1f0b
git add _deps
jasonhills-mongodb Dec 3, 2025
da4af95
git rm .gitignore
jasonhills-mongodb Dec 3, 2025
21f381f
--include-path=\"build/_deps/**\"
jasonhills-mongodb Dec 3, 2025
72be23d
Combine to single action
jasonhills-mongodb Dec 3, 2025
acbcdd2
Change names (push only)
jasonhills-mongodb Dec 3, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

# If updating mongoc_version_minimum to a new release (not pinning to an unreleased commit), also update:
# - BSON_REQUIRED_VERSION and MONGOC_REQUIRED_VERSION in CMakeLists.txt
# - the version of pkg:github/mongodb/mongo-c-driver in etc/purls.txt
# - the default value of --c-driver-build-ref in etc/make_release.py
# If pinning to an unreleased commit, create a "Blocked" JIRA ticket with
# a "depends on" link to the appropriate C Driver version release ticket.
Expand Down
8 changes: 2 additions & 6 deletions .evergreen/scripts/sbom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,14 @@ podman pull "${silkbomb:?}"
silkbomb_augment_flags=(
--repo mongodb/mongo-cxx-driver
--branch "${branch_name:?}"
--sbom-in /pwd/etc/cyclonedx.sbom.json
--sbom-in /pwd/sbom.json
--sbom-out /pwd/etc/augmented.sbom.json.new

# Any notable updates to the Augmented SBOM version should be done manually after careful inspection.
# Otherwise, it should be equal to the SBOM Lite version, which should normally be `1`.
# Otherwise, it should be equal to the existing SBOM version.
--no-update-sbom-version
)

# First validate the SBOM Lite.
podman run -it --rm -v "$(pwd):/pwd" "${silkbomb:?}" \
validate --purls /pwd/etc/purls.txt --sbom-in /pwd/etc/cyclonedx.sbom.json --exclude jira

# Allow the timestamp to be updated in the Augmented SBOM for update purposes.
podman run -it --rm -v "$(pwd):/pwd" --env 'KONDUKTO_TOKEN' "${silkbomb:?}" augment "${silkbomb_augment_flags[@]:?}"

Expand Down
113 changes: 113 additions & 0 deletions .github/workflows/endor_scan_and_generate_sbom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: Generate SBOM

on:
pull_request:
branches:
- "master"
- "releases/v*"
- "debian/*"
paths:
- "**/CMakeLists.txt"
- "**/*.cmake"
push:
branches:
- "master"
- "releases/v*"
- "debian/*"
paths:
- "**/CMakeLists.txt"
- "**/*.cmake"

jobs:
endor_scan_and_generate_sbom:
permissions:
id-token: write # Required to request a json web token (JWT) for keyless authentication with Endor Labs
contents: write # Required for commit
pull-requests: write # Required for PR
runs-on: ubuntu-latest
env:
PR_SCAN: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
fetch-tags: true
submodules: recursive

- name: Configure CMake and fetch dependency sources
env:
BUILD_TYPE: Release
BUILD: ${{github.workspace}}/build
CXX_STANDARD: 17
working-directory: ${{env.BUILD}}
run: |
cmake .. -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_STANDARD=${{env.CXX_STANDARD}} -DENABLE_TESTS=ON
git rm .gitignore # prevent exclusion of build/_deps from endorctl scan

- name: Endor Labs Scan (PR or Monitoring)
uses: endorlabs/github-action@519df81de5f68536c84ae05ebb2986d0bb1d19fc # v1.1.8
env:
ENDOR_SCAN_EMBEDDINGS: true
with:
additional_args: '--languages=c --include-path="build/_deps/**"'
enable_pr_comments: ${{ env.PR_SCAN }}
github_token: ${{ secrets.GITHUB_TOKEN }} # Required for endorctl to write pr comments
log_level: info
log_verbose: false
namespace: mongodb.${{github.repository_owner}}
pr: ${{ env.PR_SCAN }}
scan_dependencies: true
scan_summary_output_type: "table"
tags: github_action

# - name: Set up Python
# if: env.PR_SCAN == false
# uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
# with:
# python-version: "3.10"

- name: Install uv (push only)
if: env.PR_SCAN == false
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
with:
python-version: "3.10"
activate-environment: true
enable-cache: true

- name: Stash existing SBOM, generate new SBOM (push only)
if: env.PR_SCAN == false
run: |
# Existing SBOM: Strip out nondeterministic SBOM fields and save to temp file
jq 'del(.version, .metadata.timestamp, .metadata.tools.services[].version)' sbom.json > ${{runner.temp}}/sbom.existing.cdx.json
# etc/sbom/generate_sbom.py
uv run --group generate_sbom etc/sbom/generate_sbom.py --enable-github-action-token --target=branch --sbom-metadata=etc/sbom/metadata.cdx.json --save-warnings=${{runner.temp}}/warnings.txt
# Generated SBOM: Strip out nondeterministic SBOM fields and save to temp file
jq 'del(.version, .metadata.timestamp, .metadata.tools.services[].version)' sbom.json > ${{runner.temp}}/sbom.generated.cdx.json

- name: Check for SBOM changes (push only)
if: env.PR_SCAN == false
id: sbom_diff
run: |
# diff the temp SBOM files, save output to variable, supress exit code
RESULT=$(diff --brief ${{runner.temp}}/sbom.existing.cdx.json ${{runner.temp}}/sbom.generated.cdx.json)
# Set the output variable
echo "result=$RESULT" | tee -a $GITHUB_OUTPUT

- name: Generate pull request content and notice message, if SBOM has changed (push only)
if: env.PR_SCAN == false && steps.sbom_diff.outputs.result
run: |
printf "SBOM updated after commit ${{ github.sha }}.\n\n" | cat - ${{runner.temp}}/warnings.txt > ${{runner.temp}}/pr_body.txt
echo "::notice title=SBOM-Diff::SBOM has changed"

- name: Open Pull Request, if SBOM has changed (push only)
if: env.PR_SCAN == false && steps.sbom_diff.outputs.result
uses: peter-evans/create-pull-request@84ae59a2cdc2258d6fa0732dd66352dddae2a412 # v7.0.9
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
with:
add-paths: sbom.json
body-path: ${{runner.temp}}/pr_body.txt
branch: cxx-sbom-update-${{ env.BRANCH_NAME }}
commit-message: Update SBOM file(s)
delete-branch: true
title: CXX Update SBOM action - ${{ env.BRANCH_NAME }}
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ else()
message(WARNING "Unknown compiler... recklessly proceeding without a version check")
endif()

# Also update etc/purls.txt.
set(BSON_REQUIRED_VERSION 2.1.2)
set(MONGOC_REQUIRED_VERSION 2.1.2)
set(MONGOC_DOWNLOAD_VERSION 2.1.2)
Expand Down
9 changes: 0 additions & 9 deletions etc/purls.txt

This file was deleted.

105 changes: 4 additions & 101 deletions etc/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ Some release steps require one or more of the following secrets.
GRS_CONFIG_USER1_USERNAME=<username>
GRS_CONFIG_USER1_PASSWORD=<password>
```
- Snyk credentials.
- Location: `~/.secrets/snyk-creds.txt`
- Format:
```bash
SNYK_API_TOKEN=<token>
```

## Pre-Release Steps

Expand Down Expand Up @@ -118,22 +112,11 @@ All issues with an Impact level of "High" or greater must have a "MongoDB Final

All issues with an Impact level of "Medium" or greater which do not have a "MongoDB Final Status" of "Fix Committed" must document rationale for its current status in the "Notes" field.

### SBOM Lite
### SBOM

Ensure the container engine (e.g. `podman` or `docker`) is authenticated with the DevProd-provided Amazon ECR instance.

Ensure the list of bundled dependencies in `etc/purls.txt` is up-to-date. If not, update `etc/purls.txt`.

If `etc/purls.txt` was updated, update the SBOM Lite document using the following command(s):

```bash
# Ensure latest version of SilkBomb is being used.
podman pull 901841024863.dkr.ecr.us-east-1.amazonaws.com/release-infrastructure/silkbomb:2.0

# Output: "... writing sbom to file"
podman run -it --rm -v "$(pwd):/pwd" 901841024863.dkr.ecr.us-east-1.amazonaws.com/release-infrastructure/silkbomb:2.0 \
update --refresh --no-update-sbom-version -p "/pwd/etc/purls.txt" -i "/pwd/etc/cyclonedx.sbom.json" -o "/pwd/etc/cyclonedx.sbom.json"
```
Ensure that any `CXX Update SBOM action - $BRANCH_NAME` PRs are merged for the release branch.

Run a patch build which executes the `sbom` task and download the "Augmented SBOM (Updated)" file as `etc/augmented.sbom.json`. Evergreen CLI may be used to schedule only the `sbom` task:

Expand All @@ -154,12 +137,6 @@ Update `etc/third_party_vulnerabilities.md` with any updates to new or known vul

Download the "Augmented SBOM (Updated)" file from the latest EVG commit build in the `sbom` task and commit it into the repo as `etc/augmented.sbom.json` (even if the only notable change is the timestamp field).

### Check Snyk

Inspect the list of projects in the latest report for the `mongodb/mongo-cxx-driver` target in [Snyk](https://app.snyk.io/org/dev-prod/).

Deactivate any projects that will not be relevant in the upcoming release. Remove any projects that are not relevant to the current release.

### Check Jira

Inspect the list of tickets assigned to the version to be released on [Jira](https://jira.mongodb.com/projects/CXX?selectedItem=com.atlassian.jira.jira-projects-plugin%3Arelease-page&status=unreleased).
Expand Down Expand Up @@ -432,67 +409,7 @@ The new branch should be continuously tested on Evergreen. Update the "Display N

### Update SBOM serial number

Check out the release branch `releases/vX.Y`.

Update `etc/cyclonedx.sbom.json` with a new unique serial number for the next upcoming patch release (e.g. for `1.3.1` following the release of `1.3.0`):

```bash
# Ensure latest version of SilkBomb is being used.
podman pull 901841024863.dkr.ecr.us-east-1.amazonaws.com/release-infrastructure/silkbomb:2.0

# Output: "... writing sbom to file"
podman run -it --rm -v "$(pwd):/pwd" 901841024863.dkr.ecr.us-east-1.amazonaws.com/release-infrastructure/silkbomb:2.0 \
update --refresh --generate-new-serial-number -p "/pwd/etc/purls.txt" -i "/pwd/etc/cyclonedx.sbom.json" -o "/pwd/etc/cyclonedx.sbom.json"
```

Update `etc/augmented.sbom.json` by running a patch build which executes the `sbom` task as described above in [SBOM Lite](#sbom-lite).

Commit and push these changes to the `releases/vX.Y` branch.

### Update Snyk

> [!IMPORTANT]
> Run the Snyk commands in a fresh clone of the post-release repository to avoid existing build and release artifacts from affecting Snyk.

Checkout the new release tag.

Configure and build the CXX Driver (do not reuse an existing C Driver installation; use the auto-downloaded C Driver sources instead):

```bash
cmake -S . -B build
cmake --build build
```

Then run:

```bash
# Snyk credentials. Ask for these from a team member.
. ~/.secrets/snyk-creds.txt

# The new release tag. Ensure this is correct!
release_tag="rX.Y.Z"

# Authenticate with Snyk dev-prod organization.
snyk auth "${SNYK_API_TOKEN:?}"

# Verify third party dependency sources listed in etc/purls.txt are detected by Snyk.
# If not, see: https://support.snyk.io/hc/en-us/requests/new
# Use --exclude=extras until CXX-3042 is resolved
snyk_args=(
--org=dev-prod
--remote-repo-url=https://github.com/mongodb/mongo-cxx-driver/
--target-reference="${release_tag:?}"
--unmanaged
--all-projects
--exclude=extras
)
snyk test "${snyk_args[@]:?}" --print-deps

# Create a new Snyk target reference for the new release tag.
snyk monitor "${snyk_args[@]:?}"
```

Verify the new Snyk target reference is present in the [Snyk project targets list](https://app.snyk.io/org/dev-prod/projects?groupBy=targets&before&after&searchQuery=mongo-cxx-driver&sortBy=highest+severity&filters[Show]=&filters[Integrations]=cli&filters[CollectionIds]=) for `mongodb/mongo-cxx-driver`.
A new SBOM serial number is automatically generated when an SBOM is generated on a new branch.

### Post-Release Changes

Expand All @@ -512,21 +429,7 @@ For a patch release, in `etc/apidocmenu.md`, update the list of versions under "

In `README.md`, sync the "Driver Development Status" table with the updated table from `etc/apidocmenu.md`.

Update `etc/cyclonedx.sbom.json` with a new unique serial number for the next upcoming non-patch release (e.g. for `1.4.0` following the release of `1.3.0`):

```bash
# Ensure latest version of SilkBomb is being used.
podman pull 901841024863.dkr.ecr.us-east-1.amazonaws.com/release-infrastructure/silkbomb:2.0

# Output: "... writing sbom to file"
podman run -it --rm -v "$(pwd):/pwd" 901841024863.dkr.ecr.us-east-1.amazonaws.com/release-infrastructure/silkbomb:2.0 \
update --refresh --generate-new-serial-number -p "/pwd/etc/purls.txt" -i "/pwd/etc/cyclonedx.sbom.json" -o "/pwd/etc/cyclonedx.sbom.json"

git add etc/cyclonedx.sbom.json
git commit -m "update SBOM serial number"
```

Update `etc/augmented.sbom.json` by running a patch build which executes the `sbom` task as described above in [SBOM Lite](#sbom-lite).
Update `etc/augmented.sbom.json` by running a patch build which executes the `sbom` task as described above in [SBOM](#sbom).

Commit these changes to the `post-release-changes` branch:

Expand Down
Loading