-
Notifications
You must be signed in to change notification settings - Fork 32
security: pytest harness, dependabot advisories, and OSSF Scorecard remediations #501
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
Merged
WilliamBerryiii
merged 21 commits into
main
from
security/remediate-dependency-advisories
Apr 21, 2026
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
3bdd86e
security(build): remediate dependency security advisories
5e69719
security(evaluation): pin range dependencies to exact versions for CI…
47940eb
Merge branch 'main' into security/remediate-dependency-advisories
WilliamBerryiii a3d827b
build(evaluation): resolve merge conflict taking packaging 26.1
WilliamBerryiii cf38df5
docs(security): document workflow permission exceptions for OSSF Scor…
WilliamBerryiii d79b1a3
docs(security): add AI-generated footer to workflow-permissions
WilliamBerryiii fc77dc6
test(evaluation): add pytest harness, codecov CI, and security pins
0439499
Merge remote-tracking branch 'origin/main' into security/remediate-de…
dc5a4b2
security(deps): pin uv==0.10.9 by sha256 hash (OSSF Pinned-Dependencies)
WilliamBerryiii 3f3f65a
ci(scripts): fix lint, spelling, and dependency conflicts
WilliamBerryiii a71ca21
fix(evaluation): resolve CI lint and packaging conflicts
553cf84
ci(scripts): apply ruff format and restore exact packaging pin
WilliamBerryiii b5f84e2
Merge branch 'main' into security/remediate-dependency-advisories
WilliamBerryiii 3802dce
Merge remote-tracking branch 'origin/main' into security/remediate-de…
179eca8
test(evaluation): align skrl loader test with enable_training_mode API
198433c
Merge remote-tracking branch 'origin/main' into security/remediate-de…
0bb1e62
chore(build): bump setup-uv to v8.1.0 in evaluation-pytests workflow
WilliamBerryiii d6146a2
fix(evaluation): bump packaging to 26.1 and add H1 to workflow-permis…
WilliamBerryiii c1ec916
refactor(evaluation): make SIL scripts env-var configurable and moder…
WilliamBerryiii 74465f3
fix(evaluation): unblock CI by reverting unrelated packaging pin and …
WilliamBerryiii 1491252
ci(workflows): add pr-validation-summary aggregator job
WilliamBerryiii 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
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
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
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,62 @@ | ||
| name: Evaluation Pytest Tests | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| code-coverage: | ||
| description: 'Enable Codecov coverage upload' | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| pytest: | ||
| name: Evaluation Pytest | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: evaluation | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Setup uv | ||
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | ||
|
|
||
| - name: Install dependencies | ||
| run: uv sync --only-group dev | ||
|
|
||
| - name: Run pytest | ||
| run: uv run --only-group dev pytest -v | ||
|
|
||
| - name: Upload coverage.xml artifact | ||
| if: ${{ inputs.code-coverage && !cancelled() }} | ||
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | ||
| with: | ||
| name: evaluation-pytest-coverage-xml | ||
| path: evaluation/logs/coverage.xml | ||
| retention-days: 30 | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| if: ${{ inputs.code-coverage && !cancelled() }} | ||
| uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 | ||
| with: | ||
| files: evaluation/logs/coverage.xml | ||
| use_oidc: true | ||
| fail_ci_if_error: false | ||
| verbose: true | ||
| flags: pytest-evaluation | ||
| name: evaluation-pytest-coverage |
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
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
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
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
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,69 @@ | ||
| --- | ||
| sidebar_position: 4 | ||
| title: Workflow Permissions | ||
| description: GitHub Actions permission scopes and OSSF Scorecard Token-Permissions exception rationale | ||
| author: Microsoft Robotics-AI Team | ||
| ms.date: 2026-02-22 | ||
| ms.topic: reference | ||
| keywords: | ||
| - security | ||
| - github-actions | ||
| - permissions | ||
| - ossf-scorecard | ||
| - token-permissions | ||
| --- | ||
|
|
||
| ## 📋 Overview | ||
|
|
||
| All GitHub Actions workflows in this repository follow the [OpenSSF Scorecard Token-Permissions](https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions) principle: | ||
|
|
||
| - Top-level `permissions:` is `contents: read` (read-only by default). | ||
| - Write-scoped permissions are declared at the **job level** only when a specific step requires them. | ||
| - No workflow grants `permissions: write-all` or omits an explicit top-level `permissions:` block. | ||
|
|
||
| This document enumerates every job-scoped write permission across `.github/workflows/` and records the justification so security auditors and Scorecard reviewers can verify each exception. | ||
|
|
||
| ## 🔒 Job-Scoped Write Permissions | ||
|
|
||
| The 15 write permissions below are required by the action or CLI invoked in the corresponding job. Each grant is the minimum scope needed. | ||
|
|
||
| | Workflow | Job | Permission | Rationale | | ||
| |-----------------------------------|--------------------------------|---------------------------|----------------------------------------------------------------------------------------------------------------------------------------| | ||
| | `check-binary-integrity.yml` | `check-binary-integrity` | `security-events: write` | Required by `github/codeql-action/upload-sarif` to publish binary integrity findings to the Security tab. | | ||
| | `codeql-analysis.yml` | `analyze` | `security-events: write` | Required by `github/codeql-action/analyze` to upload CodeQL SARIF results to the Security tab. | | ||
| | `dast-zap-scan.yml` | `dast-zap-scan` | `security-events: write` | Required by `github/codeql-action/upload-sarif` to publish ZAP DAST findings to the Security tab. | | ||
| | `dependency-pinning-scan.yml` | `dependency-pinning-scan` | `security-events: write` | Required by `github/codeql-action/upload-sarif` to publish SHA-pinning findings to the Security tab. | | ||
| | `gitleaks-scan.yml` | `scan` | `security-events: write` | Required by `github/codeql-action/upload-sarif` to publish secret-scanning findings to the Security tab. | | ||
| | `main.yml` | `dependency-pinning` | `security-events: write` | Inherited by reusable `dependency-pinning-scan.yml`; required for SARIF upload. | | ||
| | `main.yml` | `codeql-analysis` | `security-events: write` | Inherited by reusable `codeql-analysis.yml`; required for SARIF upload. | | ||
| | `main.yml` | `generate-dependency-sbom` | `contents: write` | Required by `gh release upload "${TAG}" dependencies.spdx.json --clobber` to attach the dependency SBOM to the release. | | ||
| | `main.yml` | `attest-release` | `attestations: write` | Required by `actions/attest-build-provenance` and `actions/attest` to create Sigstore provenance attestations. | | ||
| | `main.yml` | `attest-release` | `contents: write` | Required by `gh release upload` to attach `*.sigstore.json` and `*.intoto.jsonl` attestation artifacts to the release. | | ||
| | `main.yml` | `sbom-diff` | `contents: write` | Required by `gh release upload "${TAG}" dependency-diff.md --clobber` to attach the dependency-change report to the release. | | ||
| | `main.yml` | `append-verification-notes` | `contents: write` | Required by `gh release edit` to append artifact-verification instructions to the release body. | | ||
| | `pr-validation.yml` | `dependency-pinning` | `security-events: write` | Inherited by reusable `dependency-pinning-scan.yml`; required for SARIF upload. | | ||
| | `pr-validation.yml` | `codeql-analysis` | `security-events: write` | Inherited by reusable `codeql-analysis.yml`; required for SARIF upload. | | ||
| | `scorecard.yml` | `analysis` | `security-events: write` | Required by `github/codeql-action/upload-sarif` to publish OpenSSF Scorecard findings to the Security tab. | | ||
|
|
||
| ## 🛡️ Defense in Depth | ||
|
|
||
| The release-publishing path uses additional hardening beyond minimum permissions: | ||
|
|
||
| - All actions are SHA-pinned (no floating tags). | ||
| - `persist-credentials: false` on every `actions/checkout` invocation. | ||
| - `id-token: write` is granted only to jobs that mint Sigstore OIDC tokens; the token is never exposed to user-controlled steps. | ||
| - Release-gated jobs (`generate-dependency-sbom`, `attest-release`, `sbom-diff`, `append-verification-notes`) run only when `release-please` produces a release (`needs.release-please.outputs.release_created == 'true'`). | ||
|
|
||
| ## 🔗 Related Resources | ||
|
|
||
| - [OpenSSF Scorecard Token-Permissions check](https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions) | ||
| - [GitHub Actions: Assigning permissions to jobs](https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs) | ||
| - [Release Verification](release-verification.md) | ||
| - [Threat Model](threat-model.md) | ||
|
|
||
| <!-- markdownlint-configure-file { "MD024": false } --> | ||
|
|
||
| <!-- markdownlint-disable MD036 --> | ||
| *🤖 Crafted with precision by ✨Copilot following brilliant human instruction, | ||
| then carefully refined by our team of discerning human reviewers.* | ||
| <!-- markdownlint-enable MD036 --> | ||
|
WilliamBerryiii marked this conversation as resolved.
|
||
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.