chore: add third party notice generation and kondukto integration#1356
chore: add third party notice generation and kondukto integration#1356gagik wants to merge 17 commits into
Conversation
Pin mutable action tags (setup-bot-token, checkout, upload-artifact) flagged by Semgrep, add missing native/optional dependency entries to licenses.json so third-party notices generation succeeds, and skip the commit/push step on pull_request runs since those check out a detached, unpushable ref.
| docker run --rm -v "$PWD":/pwd \ | ||
| artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:2.0 \ | ||
| update --purls /pwd/.sbom/purls.txt --sbom-out /pwd/.sbom/sbom-lite.json | ||
|
|
||
| docker run --rm -e KONDUKTO_TOKEN="$KONDUKTO_TOKEN" -v "$PWD":/pwd \ | ||
| artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:2.0 \ | ||
| augment \ | ||
| --repo ${{ github.repository }} \ | ||
| --branch "$KONDUKTO_BRANCH" \ | ||
| --sbom-in /pwd/.sbom/sbom-lite.json \ | ||
| --sbom-out /pwd/.sbom/sbom.json |
There was a problem hiding this comment.
| docker run --rm -v "$PWD":/pwd \ | |
| artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:2.0 \ | |
| update --purls /pwd/.sbom/purls.txt --sbom-out /pwd/.sbom/sbom-lite.json | |
| docker run --rm -e KONDUKTO_TOKEN="$KONDUKTO_TOKEN" -v "$PWD":/pwd \ | |
| artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:2.0 \ | |
| augment \ | |
| --repo ${{ github.repository }} \ | |
| --branch "$KONDUKTO_BRANCH" \ | |
| --sbom-in /pwd/.sbom/sbom-lite.json \ | |
| --sbom-out /pwd/.sbom/sbom.json | |
| docker run --rm -e KONDUKTO_TOKEN="$KONDUKTO_TOKEN" -v "$PWD":/pwd \ | |
| artifactory.corp.mongodb.com/release-tools-container-registry-public-local/silkbomb:2.0 \ | |
| augment \ | |
| --repo ${{ github.repository }} \ | |
| --branch "$KONDUKTO_BRANCH" \ | |
| --sbom-in /pwd/.sbom/sbom-prod.cyclonedx.json \ | |
| --sbom-out /pwd/.sbom/sbom.json |
SilkBomb’s preferred input is a CycloneDX SBOM, not a PURL list. This removes the update --purls step and passes the prod CycloneDX SBOM produced by pnpm sbom (.sbom/sbom-prod.cyclonedx.json) directly to silkbomb augment. That matches SilkBomb’s intended usage and drops the intermediate sbom-lite.json artifact. Also removes purls.txt from the uploaded artifact since it’s no longer generated or consumed.
| import { generatePurls } from "./purls.js"; | ||
|
|
||
| for (const conversion of CONVERSIONS) { | ||
| convertSbomToDependencyList(conversion); | ||
| } | ||
|
|
||
| generatePurls(); |
There was a problem hiding this comment.
| import { generatePurls } from "./purls.js"; | |
| for (const conversion of CONVERSIONS) { | |
| convertSbomToDependencyList(conversion); | |
| } | |
| generatePurls(); | |
| for (const conversion of CONVERSIONS) { | |
| convertSbomToDependencyList(conversion); | |
| } |
Removes the generatePurls() call now that purls.ts is deleted. The script still generates the CycloneDX SBOMs and enriched dependency lists used by third-party notices and vulnerability reporting; only the PURL extraction step is removed.
Remove snyk-specific changes so the PR can target main independently: - Delete `.snyk` policy file. - Remove `snyk` devDependency and `snyk-test` / `generate-vulnerability-report` scripts. - Remove `snyk` allowBuilds and minimumReleaseAgeExclude entries from pnpm-workspace.yaml. - Remove the Snyk scan, vulnerability report generation, and vulnerability report upload steps from the Dependency Health workflow. - Regenerate pnpm-lock.yaml to drop the direct `snyk` dependency and its transitive deps. - Apply the earlier suggestion to feed the prod CycloneDX SBOM directly to SilkBomb and remove the intermediate purls/purls.txt/sbom-lite pipeline.
`create-dependency-sbom-lists` was invoking `node` on a TypeScript file, so Node could not resolve the `.js` imports to `.ts` files in CI. Switch to `tsx` so the dependency SBOMs and lists are generated, which then lets `update-third-party-notices` find `.sbom/dependencies-prod.json`. Also regenerates THIRD_PARTY_NOTICES.md after the dependency changes.
|
|
||
| - name: Commit and push updated third-party notices | ||
| # Pull request runs check out a detached, unmergeable ref, so there is no | ||
| # branch to push updates to; only commit and push on schedule/dispatch runs. |
There was a problem hiding this comment.
TODO: remove before merging... this is just to test the scanning flows
`node-addon-api@8.8.0` is no longer present in the Linux CI prod dependency list, so `mongodb-sbom-tools generate-3rd-party-notices` rejected the stale `ignoredPackages` entry. Remove it and regenerate THIRD_PARTY_NOTICES.md.
|
@jasonhills-mongodb thanks for the review! I applied the suggestions and merged #1340 into this with snyk features removed. Is the approach to artifactory authentication correct? These env variables aren't set yet so I'm wondering if there's a better way. If not, where could we get the credentials? |
Mirrors how mongosh does kondukto uploads.