-
Notifications
You must be signed in to change notification settings - Fork 19
ci: harden PR pipeline (audit, MSRV, beta matrix, release + docker smoke) #57
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
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9127834
ci: harden PR pipeline (audit, MSRV, release build, beta matrix, dock…
beardthelion 909b4cb
ci: disable credential persistence on checkout steps
beardthelion a11b5f7
fix(deps): bump rustls-webpki to 0.103.13
beardthelion 248441c
ci(audit): suppress no-fix advisories with justification and a re-check
beardthelion b619617
ci(audit): reference tracking issue #76 in the hickory ignores
beardthelion a06fef5
ci(audit): treat hickory-proto removal as drift too
beardthelion 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,38 @@ | ||
| # cargo-audit configuration. | ||
| # | ||
| # cargo-audit reads its config from .cargo/audit.toml (relative to the working | ||
| # directory) or ~/.cargo/audit.toml. It does NOT read a repo-root audit.toml, | ||
| # and there is no CLI flag to point at a config file (`-f` is the lockfile path). | ||
| # This file lives at .cargo/audit.toml for that reason. | ||
| # | ||
| # The audit job stays hard-fail: only the advisories explicitly listed below are | ||
| # suppressed, so any NEW advisory still breaks CI. Each entry below has no | ||
| # available upstream fix; everything fixable is fixed in Cargo.lock instead. | ||
| # | ||
| # Tracking: the hickory ignores are reachable accepted risk. A scheduled re-check | ||
| # (.github/workflows/audit-schedule.yml) runs without these ignores and fails if | ||
| # the lockfile moves off the pinned vulnerable versions while the ignores remain. | ||
|
|
||
| [advisories] | ||
| ignore = [ | ||
| # hickory-proto 0.25.2 (pulled by libp2p-dns 0.44 -> hickory-resolver 0.25). | ||
| # REACHABLE: the node wraps its QUIC transport in the system DNS resolver | ||
| # (crates/gitlawb-node/src/p2p/mod.rs:238), so a malicious DNS response can | ||
| # trigger these DoS paths. No fix is available: the latest libp2p-dns on | ||
| # crates.io is 0.44 and pins hickory 0.25; the fix requires hickory >=0.26.1. | ||
| # REMOVE both once libp2p-dns ships a release using hickory 0.26 (verified | ||
| # 2026-06-21: cargo update -p hickory-proto locks 0 packages; still 0.25.2). | ||
| # Tracking: https://github.com/Gitlawb/node/issues/76 | ||
| "RUSTSEC-2026-0118", # hickory NSEC3 closest-encloser unbounded loop | ||
| "RUSTSEC-2026-0119", # hickory O(n^2) name-compression CPU exhaustion | ||
|
|
||
| # rsa 0.9.10 (Marvin timing sidechannel). Present in Cargo.lock because sqlx | ||
| # resolves sqlx-mysql unconditionally, and sqlx-mysql depends on rsa. cargo | ||
| # audit scans the lockfile, so it flags rsa even though it is NOT linked into | ||
| # our binary: sqlx is built postgres-only (crates/gitlawb-node/Cargo.toml), | ||
| # so the MySQL RSA auth path is never compiled and there is no RSA oracle to | ||
| # attack. No upstream fix exists regardless. REMOVE this ignore if sqlx is | ||
| # ever built with the `mysql` feature, or any other consumer of rsa enters | ||
| # the build, at which point it becomes a real reachable advisory. | ||
| "RUSTSEC-2023-0071", # rsa Marvin attack (no fix; not linked in our build) | ||
| ] |
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,77 @@ | ||
| name: Scheduled Audit | ||
|
|
||
| # Self-expiring suppression check (companion to the PR-blocking audit gate in | ||
| # pr-checks.yml). Runs weekly. It re-runs cargo audit WITHOUT the .cargo/audit.toml | ||
| # ignore list to surface the full advisory set for visibility, and it hard-fails | ||
| # if the lockfile has moved off the pinned vulnerable versions while the ignores | ||
| # are still present, i.e. the upstream fix landed but the ignore was not dropped. | ||
| on: | ||
| schedule: | ||
| - cron: "0 6 * * 1" # Mondays 06:00 UTC | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
|
|
||
| jobs: | ||
| scheduled-audit: | ||
| name: scheduled audit (no ignores) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Set up Rust toolchain | ||
| uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b # stable | ||
| with: | ||
| toolchain: stable | ||
|
|
||
| - name: Cache cargo | ||
| uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0 | ||
| with: | ||
| key: audit-schedule | ||
|
|
||
| - name: Install cargo-audit | ||
| run: cargo install --locked cargo-audit | ||
|
|
||
| # Full advisory report with NO suppressions. Run from a scratch dir that | ||
| # has no .cargo/audit.toml so the ignore list does not apply; never fail | ||
| # the build on this step, it is visibility only. | ||
| - name: Full audit report (ignores not applied) | ||
| run: | | ||
| mkdir -p "$RUNNER_TEMP/full-audit" | ||
| cp Cargo.lock "$RUNNER_TEMP/full-audit/Cargo.lock" | ||
| cd "$RUNNER_TEMP/full-audit" | ||
| { | ||
| echo '### Full cargo audit (no ignores applied)' | ||
| echo '```' | ||
| cargo audit -f Cargo.lock || true | ||
| echo '```' | ||
| } >> "$GITHUB_STEP_SUMMARY" | ||
|
|
||
| # Drift guard: the hickory ignores are only valid while hickory-proto is | ||
| # pinned at 0.25.x. If the lockfile has moved past that, the upstream fix | ||
| # is in and the ignores in .cargo/audit.toml must be removed. Fail loudly. | ||
| - name: Fail if hickory moved past 0.25.x while ignores remain | ||
| run: | | ||
| set -euo pipefail | ||
| version="$(grep -A1 'name = "hickory-proto"' Cargo.lock | grep '^version' | head -1 | cut -d'"' -f2)" | ||
| echo "hickory-proto in Cargo.lock: ${version:-not present}" | ||
| ignores_present=false | ||
| if grep -q 'RUSTSEC-2026-011' .cargo/audit.toml; then | ||
| ignores_present=true | ||
| fi | ||
| # Drift = the lockfile no longer matches what the ignores assume: | ||
| # hickory moved off 0.25.x (fix shipped) OR was removed entirely | ||
| # (dead ignore entries left behind). Both must fail. | ||
| if [ "$ignores_present" = true ] && { [ -z "${version}" ] || [[ "${version}" != 0.25.* ]]; }; then | ||
| echo "::error::hickory-proto is ${version:-absent from Cargo.lock} but the RUSTSEC-2026-0118/0119 ignores are still in .cargo/audit.toml. The upstream fix appears to be available or the dependency is gone; remove the ignores." | ||
| exit 1 | ||
| fi | ||
| echo "No drift: ignore list is consistent with the pinned hickory-proto version." |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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.