-
Notifications
You must be signed in to change notification settings - Fork 66
Add OSS license and vulnerability report workflow #802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
arussell-nvidia
wants to merge
11
commits into
main
Choose a base branch
from
codex/cxr-3577-oss-report-prototype
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9c2d3b4
ci: add OSS license vulnerability report
arussell-nvidia b554357
style: format OSS dependency collector
arussell-nvidia 107d689
style: match ruff format for OSS collector
arussell-nvidia 11899fe
oss: Clarify scanner coverage and license evidence
arussell-nvidia 81277e5
oss: Include REUSE coverage fractions
arussell-nvidia 3f07fa7
Merge remote-tracking branch 'origin/main' into codex/cxr-3577-oss-re…
arussell-nvidia 1b84605
Fix OSS report review findings
arussell-nvidia f0f0963
Resolve full OSS dependency coverage into CycloneDX
arussell-nvidia 1669a81
Exclude generated build trees from SBOM discovery
arussell-nvidia ffdb3df
Resolve remaining fail-closed dependency gaps
arussell-nvidia fcd1c45
Merge remote-tracking branch 'origin/main' into codex/cxr-3577-oss-re…
arussell-nvidia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: OSS license and vulnerability report | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| CORE_APT_DEPS: build-essential cmake glslang-tools libdbus-1-dev libvulkan-dev libwayland-dev libx11-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxkbcommon-dev libxrandr-dev pkg-config wayland-protocols | ||
| VCPKG_COMMIT: d015e31e90838a4c9dfa3eed45979bc70d9357fc # 2026.05.25 | ||
|
|
||
| jobs: | ||
| oss-license-vulnerability-report: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 90 | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install uv | ||
| uses: ./.github/actions/setup-uv | ||
|
|
||
| - name: Install maximum-profile build dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y $CORE_APT_DEPS \ | ||
| autoconf automake libtool pkg-config libudev-dev | ||
|
|
||
| - name: Install CUDA toolkit for maximum-profile configuration | ||
| uses: ./.github/actions/setup-cuda | ||
|
|
||
| - name: Setup pinned vcpkg | ||
| run: | | ||
| git clone https://github.com/microsoft/vcpkg "${RUNNER_TEMP}/vcpkg" | ||
| git -C "${RUNNER_TEMP}/vcpkg" checkout --detach "${VCPKG_COMMIT}" | ||
| "${RUNNER_TEMP}/vcpkg/bootstrap-vcpkg.sh" -disableMetrics | ||
| echo "VCPKG_ROOT=${RUNNER_TEMP}/vcpkg" >> "${GITHUB_ENV}" | ||
|
|
||
| - name: Install REUSE | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install reuse | ||
|
|
||
| - name: Install Trivy | ||
| uses: aquasecurity/setup-trivy@v0.2.6 | ||
| with: | ||
| version: v0.72.0 | ||
|
|
||
| - name: Generate OSS report | ||
| run: | | ||
| ./scripts/run_oss_license_vulnerability_report.sh . | ||
|
|
||
| - name: Publish OSS report summary | ||
| if: always() | ||
| run: | | ||
| if [[ -f oss-report/summary.md ]]; then | ||
| cat oss-report/summary.md >> "${GITHUB_STEP_SUMMARY}" | ||
| elif [[ -f oss-report/dependency-coverage.md ]]; then | ||
| cat oss-report/dependency-coverage.md >> "${GITHUB_STEP_SUMMARY}" | ||
| else | ||
| echo "OSS report generation did not produce summary.md." >> "${GITHUB_STEP_SUMMARY}" | ||
| fi | ||
|
|
||
| - name: Upload OSS report artifact | ||
| if: always() | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: isaacteleop-oss-license-vulnerability-report | ||
| path: oss-report | ||
| if-no-files-found: error | ||
| retention-days: 14 | ||
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
88 changes: 88 additions & 0 deletions
88
docs/source/references/oss_license_vulnerability_report.rst
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| .. _oss-license-vulnerability-report: | ||
|
|
||
| OSS License and Vulnerability Report | ||
| ==================================== | ||
|
|
||
| The ``OSS license and vulnerability report`` workflow publishes resolved | ||
| dependency coverage, a canonical CycloneDX SBOM, vulnerability findings, and | ||
| license metadata. Dependency coverage fails closed even while vulnerability and | ||
| license policy findings remain advisory. | ||
|
|
||
| Generated files | ||
| --------------- | ||
|
|
||
| The workflow uploads the ``isaacteleop-oss-license-vulnerability-report`` | ||
| artifact. It contains: | ||
|
|
||
| - ``dependency-inventory.json`` and ``dependency-inventory.md`` from the | ||
| repository manifest collector. | ||
| - ``dependency-coverage.json`` and ``dependency-coverage.md``, which classify | ||
| every declaration as resolved, explicitly excluded, or unresolved. | ||
| - ``bom.cdx.json``, the canonical CycloneDX 1.6 SBOM scanned by Trivy. | ||
| - ``trivy-vulnerability-report.json`` and, when available, | ||
| ``trivy-vulnerability-report.sarif``. | ||
| - ``reuse-lint.txt`` and, when available, ``reuse.spdx``. | ||
| - ``summary.md``, which is also appended to the GitHub workflow summary. | ||
|
|
||
| Collector coverage | ||
| ------------------ | ||
|
|
||
| ``scripts/collect_oss_dependencies.py`` scans common dependency declarations: | ||
|
|
||
| - Python ``requirements*.txt`` and ``pyproject.toml`` files. | ||
| - npm ``package.json`` files. | ||
| - CMake ``FetchContent_Declare``, ``ExternalProject_Add``, and | ||
| ``CPMAddPackage`` declarations. | ||
| - ``vcpkg.json`` manifests. | ||
| - Docker ``FROM`` image references. | ||
| - GitHub Actions ``uses: owner/action@ref`` references. | ||
|
|
||
| The resolver configures a maximum open-source CMake profile with plugins, | ||
| examples, tests, visualization, and the OAK camera plugin enabled. CMake trace | ||
| output captures expanded ``FetchContent`` declarations, including declarations | ||
| from populated projects. The generated vcpkg status database supplies exact | ||
| installed versions. The resolver also produces an npm lockfile from each npm | ||
| manifest and a universal ``uv`` lock from the combined Python declarations. | ||
|
|
||
| ``dependency-coverage.json`` joins those package-manager and configured-build | ||
| results back to the declaration inventory. A declaration without concrete | ||
| resolver evidence must have a narrow, named exclusion with a reason. Parse | ||
| errors, unsupported package-manager manifests, unexpanded expressions, and | ||
| unmatched declarations fail the job. Adding a new manifest or build option | ||
| therefore cannot silently reduce report coverage. | ||
|
|
||
| Trivy first catalogs the resolved workspace into CycloneDX. The coverage audit | ||
| adds configured CMake and generated vcpkg components to that document, then | ||
| Trivy scans ``bom.cdx.json`` as an SBOM target. ``summary.md`` reports declared, | ||
| resolved, excluded, unresolved, SBOM, and scanner counts separately. | ||
|
|
||
| License hygiene | ||
| --------------- | ||
|
|
||
| REUSE runs before report artifacts are generated, so generated JSON, SARIF, and | ||
| Markdown files do not inflate the missing-license baseline. ``summary.md`` reports | ||
| the lint and SPDX export statuses separately, whether REUSE lint passed, and, when | ||
| available, the number of files with license and copyright metadata. Full details | ||
| remain in ``reuse-lint.txt`` and ``reuse.spdx``. | ||
|
|
||
| Policy mode | ||
| ----------- | ||
|
|
||
| Dependency coverage is always blocking. After the vulnerability and license | ||
| policy is approved, set ``OSS_REPORT_STRICT=true`` in CI to also fail when Trivy | ||
| or REUSE returns a nonzero status. Severity and license thresholds still require | ||
| stakeholder approval; until then, a successful report job means complete | ||
| dependency accounting and generated evidence, not final compliance approval. | ||
|
|
||
| Local use | ||
| --------- | ||
|
|
||
| Run the report locally from the repository root: | ||
|
|
||
| .. code-block:: bash | ||
|
|
||
| ./scripts/run_oss_license_vulnerability_report.sh . | ||
|
|
||
| Local execution requires ``uv``, npm, CMake, Trivy, a bootstrapped vcpkg checkout | ||
| in ``VCPKG_ROOT``, and the same system dependencies used by the maximum CMake | ||
| profile. REUSE remains advisory unless strict policy mode is enabled. |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
Checkout persists credentials unnecessarily.
This job doesn't need to push or authenticate further; persisting credentials to disk widens the blast radius if a subsequently-installed third-party tool (
pip install reuse,aquasecurity/setup-trivy) is compromised.🔒 Proposed fix
- name: Checkout code uses: actions/checkout@v6 + with: + persist-credentials: false📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.26.1)
[warning] 25-26: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents
Source: Linters/SAST tools