-
-
Notifications
You must be signed in to change notification settings - Fork 4
ci: supply-chain hardening (PR 1/2) — Node 24, harden-runner, Dependabot cooldown, CodeQL #42
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
Nelson Spence (Fieldnote-Echo)
merged 6 commits into
main
from
chore/supply-chain-ci-hardening
May 25, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a76cb89
ci: bump actions to Node 24 + add harden-runner across workflows
Fieldnote-Echo b6c73ca
ci: add Dependabot version updates with a 7-day cooldown
Fieldnote-Echo 6654601
ci: add CodeQL code scanning for Rust, Python, and Actions
Fieldnote-Echo 350b319
ci: bump codeql-action v3 (node20) -> v4 (node24)
Fieldnote-Echo 4a73aa3
ci: skip CodeQL on fork PRs (read-only token can't upload SARIF) (#42…
Fieldnote-Echo 7027d5e
Merge branch 'main' into chore/supply-chain-ci-hardening
Fieldnote-Echo 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,64 @@ | ||
| # Dependabot version updates. Docs: https://docs.github.com/en/code-security/reference/supply-chain-security/dependabot-options-reference | ||
| # Every ecosystem carries a 7-day cooldown: no dependency is bumped same-day, so a | ||
| # freshly-published malicious release (the "mini shai-hulud" npm-worm class of | ||
| # supply-chain attack) has a week to be flagged/yanked before we'd auto-PR it. | ||
| version: 2 | ||
| updates: | ||
| # PRIMARY TARGET: actions are SHA-pinned in .github/workflows; Dependabot keeps | ||
| # those pins current (and re-pins to the new SHA), just delayed 7 days. One | ||
| # grouped PR keeps the action bumps from flooding the queue. | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| cooldown: | ||
| default-days: 7 | ||
| open-pull-requests-limit: 5 | ||
| groups: | ||
| github-actions: | ||
| patterns: | ||
| - "*" | ||
|
|
||
| # Cargo workspace root: core `ordvec` + the `ordvec-python` binding member | ||
| # (single workspace Cargo.lock). Group minor+patch into one PR; majors stay | ||
| # separate for manual review. | ||
| - package-ecosystem: "cargo" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| cooldown: | ||
| default-days: 7 | ||
|
Fieldnote-Echo marked this conversation as resolved.
|
||
| open-pull-requests-limit: 5 | ||
| groups: | ||
| cargo-minor-patch: | ||
| update-types: | ||
| - "minor" | ||
| - "patch" | ||
|
|
||
| # ordvec-python declared Python deps (numpy). Grouped; no-op if nothing parseable. | ||
| - package-ecosystem: "pip" | ||
| directory: "/ordvec-python" | ||
| schedule: | ||
| interval: "weekly" | ||
| cooldown: | ||
| default-days: 7 | ||
|
Fieldnote-Echo marked this conversation as resolved.
|
||
| open-pull-requests-limit: 5 | ||
| groups: | ||
| pip-minor-patch: | ||
| update-types: | ||
| - "minor" | ||
| - "patch" | ||
|
|
||
| # fuzz/ is a workspace-EXCLUDED standalone crate (own Cargo.lock), nightly-only | ||
| # cargo-fuzz tooling. Dev-only surface, low priority — group all, tight PR limit. | ||
| - package-ecosystem: "cargo" | ||
| directory: "/fuzz" | ||
| schedule: | ||
| interval: "weekly" | ||
| cooldown: | ||
| default-days: 7 | ||
|
Fieldnote-Echo marked this conversation as resolved.
|
||
| open-pull-requests-limit: 2 | ||
| groups: | ||
| fuzz-deps: | ||
| patterns: | ||
| - "*" | ||
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,78 @@ | ||
| name: codeql | ||
|
|
||
| # CodeQL code scanning (GitHub's static-analysis / variant-analysis engine). | ||
| # Scans the Rust core crate, the PyO3 Python bindings, and the GitHub Actions | ||
| # workflows themselves, surfacing security findings as code-scanning alerts. | ||
| # | ||
| # build-mode: none — CodeQL's Rust support and build-less ("no-build") database | ||
| # creation are GA (CodeQL >= 2.23.3). Rust, Python, and `actions` are all | ||
| # analysed WITHOUT a compiler/interpreter run, so no `cargo build` (and no | ||
| # MSRV toolchain) is needed here; the database is built directly from source. | ||
| # This keeps the scan fast and independent of the build matrix. | ||
| # | ||
| # Least-privilege permissions: `security-events: write` is the only elevated | ||
| # scope (required to upload SARIF / publish alerts); `contents: read` + | ||
| # `actions: read` are read-only. Nothing else is granted. | ||
| # | ||
| # Because this workflow runs UNATTENDED on a cron schedule AND holds | ||
| # `security-events: write`, every third-party action is SHA-pinned (immutable) | ||
| # — a compromised mutable tag (@v4/@v6) cannot auto-execute on a scheduled, | ||
| # write-scoped runner. harden-runner audits egress as the first step. | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
| schedule: | ||
| # Weekly. Wednesday 07:42 UTC — deliberately off the audit.yml slot | ||
| # (Monday 06:17 UTC) so the two scheduled scans never collide. | ||
| - cron: "42 7 * * 3" | ||
|
|
||
| # Least-privilege: read-only at the workflow level; the analyze job elevates to | ||
| # security-events: write (the minimum CodeQL needs to publish alerts). | ||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: codeql-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| analyze: | ||
| name: analyze (${{ matrix.language }}) | ||
| runs-on: ubuntu-latest | ||
| # Skip CodeQL on PRs from forks: a forked PR gets a read-only GITHUB_TOKEN, | ||
| # so the SARIF upload (needs security-events: write) can't succeed and would | ||
| # fail noisily. push-to-main + the weekly schedule still scan everything that | ||
| # lands, and same-repo PRs still get PR-time scanning. (CodeQL is also not a | ||
| # required status check, so a fork PR is never blocked either way.) | ||
| if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} | ||
| permissions: | ||
| security-events: write # upload SARIF / publish code-scanning alerts | ||
| contents: read # checkout source | ||
| actions: read # read workflow run metadata (required by CodeQL) | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| language: [rust, python, actions] | ||
| steps: | ||
| - name: Harden runner | ||
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
| # No-build database creation (GA for rust/python/actions). | ||
| build-mode: none | ||
|
|
||
| - name: Perform CodeQL analysis | ||
| uses: github/codeql-action/analyze@7211b7c8077ea37d8641b6271f6a365a22a5fbfa # v4 | ||
| with: | ||
| category: "/language:${{ matrix.language }}" |
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.
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.