From 56cbe9814009c1cb228e542811aa5be6bf54d441 Mon Sep 17 00:00:00 2001 From: Filipe Azevedo Date: Fri, 27 Nov 2026 17:27:14 +0000 Subject: [PATCH 1/4] ci: Replace cargo audit with cargo-deny on every PR Run cargo deny check advisories and cargo deny check bans licenses sources on every pull request, master push and weekly, in place of the scheduled-only cargo audit workflow. --- .github/workflows/audit.yml | 18 -------- .github/workflows/cargo-deny.yml | 37 +++++++++++++++ deny.toml | 77 ++++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+), 18 deletions(-) delete mode 100644 .github/workflows/audit.yml create mode 100644 .github/workflows/cargo-deny.yml create mode 100644 deny.toml diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml deleted file mode 100644 index 96fa5ba1cb8..00000000000 --- a/.github/workflows/audit.yml +++ /dev/null @@ -1,18 +0,0 @@ -# See https://github.com/actions-rs/audit-check -name: Security audit -on: - # push: - # paths: - # - '**/Cargo.toml' - # - '**/Cargo.lock' - schedule: - - cron: '0 0 */7 * *' -jobs: - security_audit: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 - - uses: rustsec/audit-check@69366f33c96575abad1ee0dba8212993eecbe998 #v2.0.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/cargo-deny.yml b/.github/workflows/cargo-deny.yml new file mode 100644 index 00000000000..33289e15e52 --- /dev/null +++ b/.github/workflows/cargo-deny.yml @@ -0,0 +1,37 @@ +name: Cargo Deny + +on: + pull_request: + push: + branches: [master] + schedule: + - cron: "0 6 * * 1" + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + cargo-deny: + name: cargo deny ${{ matrix.checks }} + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + checks: + - advisories + - bans licenses sources + + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + + - uses: taiki-e/install-action@cfdb7ed4ccc7c7dce37759eae89dc5674b469b39 # v2.90.3 + with: + tool: cargo-deny + + - run: cargo deny check ${{ matrix.checks }} diff --git a/deny.toml b/deny.toml new file mode 100644 index 00000000000..fa836f542d5 --- /dev/null +++ b/deny.toml @@ -0,0 +1,77 @@ +[graph] +all-features = false +no-default-features = false + +[advisories] +version = 2 +yanked = "warn" +ignore = [] + +[licenses] +version = 2 +private = { ignore = true } +allow = [ + "MIT", + "Apache-2.0", + "Apache-2.0 WITH LLVM-exception", + "BSD-2-Clause", + "BSD-3-Clause", + "ISC", + "Unicode-3.0", + "Unicode-DFS-2016", + "CDLA-Permissive-2.0", + "CC0-1.0", + "MPL-2.0", + "Zlib", + "0BSD", + "BSL-1.0", + "Unlicense", + "PostgreSQL", +] +confidence-threshold = 0.8 + +# The workspace crates do not inherit the workspace license (only graph_derive +# sets `license.workspace`) and are not `publish = false`, so the private +# exemption above does not reach them. They carry the workspace license. +clarify = [ + { crate = "gnd", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph-chain-common", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph-chain-ethereum", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph-chain-near", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph-core", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph-graphql", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph-node", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph-runtime-derive", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph-runtime-test", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph-runtime-wasm", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph-server-http", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph-server-index-node", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph-server-json-rpc", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph-server-metrics", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph-store-postgres", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graph-tests", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graphman", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graphman-server", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "graphman-store", expression = "MIT OR Apache-2.0", license-files = [] }, + { crate = "test-store", expression = "MIT OR Apache-2.0", license-files = [] }, +] + +[bans] +multiple-versions = "warn" +# Path dependencies between workspace crates count as wildcards because the +# crates are not `publish = false`; the upstream manifests are left as they are. +wildcards = "allow" +highlight = "all" +workspace-default-features = "allow" +external-default-features = "allow" + +[sources] +unknown-registry = "deny" +unknown-git = "deny" +allow-registry = ["https://github.com/rust-lang/crates.io-index"] +allow-git = [ + "https://github.com/graphprotocol/pgtemp", + "https://github.com/graphprotocol/stable-hash", + "https://github.com/tower-rs/tower", +] From 20ec6f08881dafb92287a8a577cd182a7213ace2 Mon Sep 17 00:00:00 2001 From: Filipe Azevedo Date: Fri, 27 Nov 2026 17:29:21 +0000 Subject: [PATCH 2/4] ci: Drop the cargo-deny schedule; PRs gate on it --- .github/workflows/cargo-deny.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/cargo-deny.yml b/.github/workflows/cargo-deny.yml index 33289e15e52..cc1429e6764 100644 --- a/.github/workflows/cargo-deny.yml +++ b/.github/workflows/cargo-deny.yml @@ -4,8 +4,6 @@ on: pull_request: push: branches: [master] - schedule: - - cron: "0 6 * * 1" workflow_dispatch: concurrency: From cc07e3f93652f4299ed62506982e658bc1fa6c31 Mon Sep 17 00:00:00 2001 From: Filipe Azevedo Date: Fri, 27 Nov 2026 17:31:06 +0000 Subject: [PATCH 3/4] ci: Bump cargo-deny workflow actions to latest --- .github/workflows/cargo-deny.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cargo-deny.yml b/.github/workflows/cargo-deny.yml index cc1429e6764..f82464fc018 100644 --- a/.github/workflows/cargo-deny.yml +++ b/.github/workflows/cargo-deny.yml @@ -26,9 +26,9 @@ jobs: - bans licenses sources steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - uses: taiki-e/install-action@cfdb7ed4ccc7c7dce37759eae89dc5674b469b39 # v2.90.3 + - uses: taiki-e/install-action@073e1fd0bc889c9aee68dbaaa927cde1b5653a83 # v2.90.11 with: tool: cargo-deny From 239b044ceee01c68c7f8303920c6d4401b021e61 Mon Sep 17 00:00:00 2001 From: Filipe Azevedo Date: Fri, 27 Nov 2026 18:24:05 +0000 Subject: [PATCH 4/4] ci: Ignore RustSec advisories that don't apply or have no fix yet --- deny.toml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/deny.toml b/deny.toml index fa836f542d5..757b3fda9a8 100644 --- a/deny.toml +++ b/deny.toml @@ -5,7 +5,39 @@ no-default-features = false [advisories] version = 2 yanked = "warn" -ignore = [] +ignore = [ + # Unmaintained, no drop-in replacement + { id = "RUSTSEC-2022-0061", reason = "parity-wasm is unmaintained; graph-runtime-wasm uses it directly to parse modules and inject gas, replacing it needs a code change" }, + { id = "RUSTSEC-2024-0436", reason = "paste is unmaintained; compile-time proc macro pulled in by alloy-primitives and syn-solidity, latest alloy-core still depends on it" }, + { id = "RUSTSEC-2024-0449", reason = "unsafe-libyaml is unmaintained; pulled in by serde_yaml 0.9, replacing it is a code change across several crates" }, + { id = "RUSTSEC-2026-0542", reason = "humantime is unmaintained; pulled in by object_store 0.14.2, the latest release" }, + { id = "RUSTSEC-2026-0543", reason = "chrono is unmaintained (informational, no vulnerability); a direct dependency used throughout the codebase" }, + # Not applicable + { id = "RUSTSEC-2026-0387", reason = "crypto-bigint 0.5 timing side channels only matter for secret operands; graph-node holds no private keys (signature recovery on public chain data only); the fix needs crypto-bigint 0.7, which alloy does not support yet" }, + # wasmtime: fixed only in 48.x+, whose cranelift needs rustc 1.95; rust-toolchain.toml pins 1.94 for rust-lang/rust#152942. + # graph-node runs core wasm modules only (parity_wasm parse, then wasmtime::Module, runtime/wasm/src/mapping.rs), + # never wasmtime::component, and does not depend on wasmtime-wasi or wasmtime-wasi-http. + { id = "RUSTSEC-2026-0316", reason = "wasmtime component model only; not used" }, + { id = "RUSTSEC-2026-0327", reason = "wasmtime component model only; not used" }, + { id = "RUSTSEC-2026-0353", reason = "wasmtime component model only; not used" }, + { id = "RUSTSEC-2026-0354", reason = "wasmtime component model only; not used" }, + { id = "RUSTSEC-2026-0355", reason = "wasmtime component model only; not used" }, + { id = "RUSTSEC-2026-0356", reason = "wasmtime component model only; not used" }, + { id = "RUSTSEC-2026-0357", reason = "wasmtime component model only; not used" }, + { id = "RUSTSEC-2026-0358", reason = "wasmtime component model only; not used" }, + { id = "RUSTSEC-2026-0361", reason = "wasmtime component model only; not used" }, + { id = "RUSTSEC-2026-0363", reason = "wasmtime component model only; not used" }, + { id = "RUSTSEC-2026-0378", reason = "wasmtime component model only; not used" }, + { id = "RUSTSEC-2026-0424", reason = "wasmtime component model only; not used" }, + { id = "RUSTSEC-2026-0572", reason = "wasmtime component model only; not used" }, + { id = "RUSTSEC-2026-0566", reason = "wasmtime-wasi only; not a dependency" }, + { id = "RUSTSEC-2026-0571", reason = "wasmtime-wasi-http only; not a dependency" }, + { id = "RUSTSEC-2026-0567", reason = "only builds without the wasmtime `threads` feature abort; graph-node builds with default features" }, + { id = "RUSTSEC-2026-0569", reason = "Caller::get_module_export is not used" }, + { id = "RUSTSEC-2026-0362", reason = "needs mixed sync and async calls into wasm on one Store; graph-node only uses call_async" }, + { id = "RUSTSEC-2026-0359", reason = "needs long GC rec-group type chains; parity_wasm parses modules first and accepts MVP types only" }, + { id = "RUSTSEC-2026-0379", reason = "AFFECTS aarch64 builds (Cranelift br_table); accepted until the toolchain pin moves and wasmtime can go to 48.7+" }, +] [licenses] version = 2