ci (security): SBOM generation - #25
Open
turbobobbytraykov wants to merge 1 commit into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an opt-in GitHub Actions workflow to generate an SPDX 2.2 SBOM for the Infragistics.QueryBuilder.Executor NuGet package without modifying the published package, and pins sbom-tool as a nested .NET local tool.
Changes:
- Introduces
.github/workflows/sbom.ymlto pack the package, generate/verify the SBOM, upload artifacts, and (on releases) attach a zipped SBOM to the release. - Adds a nested .NET tool manifest at
.config/sbom-tool/dotnet-tools.jsonto pinmicrosoft.sbom.dotnettoolv4.1.5 for the workflow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/sbom.yml | New on-demand SBOM generation + artifact upload + optional release asset attachment workflow. |
| .config/sbom-tool/dotnet-tools.json | Pins sbom-tool as a nested local tool manifest for isolated restore/use in the SBOM workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| run: > | ||
| dotnet pack Infragistics.QueryBuilder.Executor.csproj | ||
| --configuration ${{ env.BUILD_CONFIGURATION }} | ||
| -p:Version=${{ env.PACKAGE_VERSION }} |
| - name: Generate SBOM | ||
| working-directory: .config/sbom-tool | ||
| run: > | ||
| dotnet tool run sbom-tool -- generate |
Comment on lines
+7
to
+10
| "commands": [ | ||
| "sbom-tool" | ||
| ], | ||
| "rollForward": true |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add on-demand SBOM generation workflow
What
Adds an opt-in GitHub workflow that generates an SPDX 2.2 SBOM for the
Infragistics.QueryBuilder.ExecutorNuGet package using Microsoft's sbom-tool. The SBOM is produced out-of-band — the published package itself is never modified and no SBOM is embedded in it.Why
ci.ymlandbuild-and-publish.ymlcompletely untouched — zero impact on existing workflow performance.Changes
New:
.github/workflows/sbom.ymlgenerate sbomlabel to a PR (label must exist in the repo).sbomjob (ubuntu-latest): packs the NuGet package (0.0.0-pr.<PR#>for PRs, the release tag for releases), restores the pinned sbom-tool, generates the SBOM against the packed artifact (-b) with dependency scanning from the repo root (-bc), verifiesmanifest.spdx.json+.sha256exist, and uploads two artifacts with 1-day retention:nupkg— the unmodified package the SBOM describes (listed with its hash in the SBOM's files section)sbom-spdx_2.2— just the_manifest/spdx_2.2directoryattach-to-releasejob (release trigger only): downloads the SBOM artifact, zips it asInfragistics.QueryBuilder.Executor.<tag>.spdx_2.2.zip, and attaches it to the release viagh release upload --clobber.cancel-in-progressto avoid duplicate runs from repeated labeling.New:
.config/sbom-tool/dotnet-tools.jsonPins
microsoft.sbom.dotnettool4.1.5 as a dotnet local tool. Design notes:.config/dotnet-tools.json):dotnet tool restorediscovery only walks up the directory tree, so the plaindotnet tool restorerun bybuild-and-publish.ymlnever downloads sbom-tool — verified locally that a root restore restores only the existing tools."rollForward": trueis required because the tool targets net8.0 while runners carry newer SDKs only.--tool-manifest, and runs it withworking-directory: .config/sbom-toolbecausedotnet tool runhas no--tool-manifestoption (manifest discovery is cwd-based).Validation (local)
sbom-tool generate(v4.1.5, sha256-verified binary) against the build output exited 0 and produced a validmanifest.spdx.json.dotnet tool restore --tool-manifest .config/sbom-tool/dotnet-tools.json→ tool 4.1.5 restored;dotnet tool run sbom-tool -- generate …from.config/sbom-tool→ exit 0, SBOM produced with the nupkg listed in its files section.dotnet tool restoredoes not touch sbom-tool.Notes for reviewers
generate sbomlabel needs to be created in the repository before the PR trigger can be used.rollForwardbehavior on a runner without the net8 runtime could not be fully simulated locally (net8 is installed here); the first labeled-PR run confirms it.dotnet-tools.jsonmanifests, so sbom-tool version bumps are manual.