-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PYTHON-4389 Add SBOM and CodeQL for Python (#823)
* PYTHON-4389 Add SBOM and CodeQL for Python * fix shell script * lint * include sbom * update manifest * update manifest
- Loading branch information
Showing
8 changed files
with
165 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "master"] | ||
tags: ['*'] | ||
pull_request: | ||
paths: | ||
- bindings/python/**/*.py | ||
schedule: | ||
- cron: '17 10 * * 2' | ||
|
||
jobs: | ||
analyze-python: | ||
name: Analyze Python | ||
runs-on: "ubuntu-latest" | ||
timeout-minutes: 360 | ||
permissions: | ||
# required for all workflows | ||
security-events: write | ||
|
||
# required to fetch internal or private CodeQL packs | ||
packages: read | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.x | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: python | ||
build-mode: manual | ||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs | ||
queries: security-extended | ||
config: | | ||
paths: | ||
- bindings/python/pymongocrypt | ||
- name: Install package | ||
run: | | ||
cd bindings/python | ||
bash release.sh | ||
pip install dist/*.whl | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
with: | ||
category: "/language:python" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
"components": [ | ||
{ | ||
"bom-ref": "pkg:github/mongodb/libmongocrypt@1.9.0", | ||
"externalReferences": [ | ||
{ | ||
"type": "distribution", | ||
"url": "https://github.com/mongodb/libmongocrypt/archive/refs/tags/1.9.0.tar.gz" | ||
}, | ||
{ | ||
"type": "website", | ||
"url": "https://github.com/mongodb/libmongocrypt/tree/1.9.0" | ||
} | ||
], | ||
"group": "mongodb", | ||
"name": "libmongocrypt", | ||
"purl": "pkg:github/mongodb/libmongocrypt@1.9.0", | ||
"type": "library", | ||
"version": "1.9.0" | ||
} | ||
], | ||
"dependencies": [ | ||
{ | ||
"ref": "pkg:github/mongodb/libmongocrypt@1.9.0" | ||
} | ||
], | ||
"metadata": { | ||
"timestamp": "2024-06-03T13:55:11.135812+00:00", | ||
"tools": [ | ||
{ | ||
"externalReferences": [ | ||
{ | ||
"type": "build-system", | ||
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/actions" | ||
}, | ||
{ | ||
"type": "distribution", | ||
"url": "https://pypi.org/project/cyclonedx-python-lib/" | ||
}, | ||
{ | ||
"type": "documentation", | ||
"url": "https://cyclonedx-python-library.readthedocs.io/" | ||
}, | ||
{ | ||
"type": "issue-tracker", | ||
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/issues" | ||
}, | ||
{ | ||
"type": "license", | ||
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE" | ||
}, | ||
{ | ||
"type": "release-notes", | ||
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md" | ||
}, | ||
{ | ||
"type": "vcs", | ||
"url": "https://github.com/CycloneDX/cyclonedx-python-lib" | ||
}, | ||
{ | ||
"type": "website", | ||
"url": "https://github.com/CycloneDX/cyclonedx-python-lib/#readme" | ||
} | ||
], | ||
"name": "cyclonedx-python-lib", | ||
"vendor": "CycloneDX", | ||
"version": "6.4.4" | ||
} | ||
] | ||
}, | ||
"serialNumber": "urn:uuid:e7358393-f4d3-4856-98bb-22547b234979", | ||
"version": 1, | ||
"$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json", | ||
"bomFormat": "CycloneDX", | ||
"specVersion": "1.5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
LIBMONGOCRYPT_VERSION=$(cat ./libmongocrypt-version.txt) | ||
if [ $(command -v podman) ]; then | ||
DOCKER=podman | ||
else | ||
DOCKER=docker | ||
fi | ||
|
||
echo "pkg:github/mongodb/libmongocrypt@$LIBMONGOCRYPT_VERSION" > purls.txt | ||
$DOCKER run --platform="linux/amd64" -it --rm -v $(pwd):$(pwd) artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:1.0 update --purls=$(pwd)/purls.txt -o $(pwd)/sbom.json | ||
rm purls.txt |