ci (security): SBOM generation - #30
Open
turbobobbytraykov wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an opt-in GitHub Actions workflow to generate and (for releases) attach an SPDX 2.2 SBOM for the project’s NuGet package, using a pinned sbom-tool .NET local tool manifest stored under a nested .config directory.
Changes:
- Introduces
.github/workflows/sbom.ymlto generate SBOMs on PR label (generate sbom) and on published releases, and to upload/attach the resulting artifacts. - Adds
.config/sbom-tool/dotnet-tools.jsonto pinmicrosoft.sbom.dotnettoolfor reproducible restores isolated from the repo’s root tool manifest.
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 workflow to build/pack and generate SBOM artifacts, then attach SBOM to releases. |
| .config/sbom-tool/dotnet-tools.json | New nested local-tool manifest to pin sbom-tool used by the SBOM workflow. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+46
to
+54
| - name: Pack NuGet package | ||
| run: > | ||
| dotnet pack src/IgniteUI.Blazor.GridLite/IgniteUI.Blazor.GridLite.csproj | ||
| --configuration ${{ env.BUILD_CONFIGURATION }} | ||
| -p:RunNodeBuild=false | ||
| -p:GeneratePackageOnBuild=false | ||
| -p:Version=${{ env.PACKAGE_VERSION }} | ||
| -o ./artifacts | ||
|
|
…for improved security (we hope)
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
IgniteUI.Blazor.GridLiteNuGet 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 asIgniteUI.Blazor.GridLite.<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.