Repository navigation
ci(codeql): add Rust CodeQL coverage - #86
WomB0ComB0 wants to merge 1 commit into
Conversation
security.yml declares languages '["actions"]', so CodeQL analysed only the workflow files under .github/ — the on-chain Rust in resq-airspace/, resq-delivery/ and resq-gating/ had no coverage. Code-scanning default setup is not-configured on this repository and does not cover Rust here either. Adds a dedicated advanced-setup workflow pinned to codeql-action v4.38.1 with languages: rust, mirroring the equivalent workflow in the crates repository, which uploads /language:rust analyses successfully today.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAdds a GitHub Actions workflow for Rust CodeQL analysis. It runs on configured pushes, pull requests, a weekly schedule, and manual dispatch. It checks out the repository, builds and analyzes Rust code, and uploads results. ChangesRust CodeQL analysis
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Merge Risk: ⚪ Minimal · up to The workflow adds Rust security analysis alongside existing Actions scanning. No merge-blocking issue is established; normal workflow validation remains appropriate. Architecture SummaryArchitecture risk: 🔵 Low · up to The changed surface does not map to a changed system, dependency edge, entrypoint, or external dependency. Changed systems: None identified. Architecture concerns Review detailsBefore / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Audit Results: PASSThe changes in this pull request have been audited for security vulnerabilities, logic bugs, and performance issues. The new CodeQL workflow for Rust is well-configured and follows established best practices:
No issues were identified. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
What
Adds
.github/workflows/codeql.ymlto this repository, restoring CodeQLcoverage of its Rust sources after it lapsed.
Why
security.ymlcalls the org reusablesecurity-scan.ymlwithlanguages: '["actions"]'. That analyses the workflow files under.github/and nothing else, so the on-chain Rust in
resq-airspace/,resq-delivery/and
resq-gating/is not analysed.Nothing covers it implicitly today either — code-scanning default setup is
not-configuredon this repository:This repository did have Rust coverage, and lost it
Rust was analysed here, by default setup, until default setup was switched
off. The stored analyses show it:
/language:rustrows under thedynamic/github-code-scanning/codeql:analyzekey, ending the day default setupstopped. See
GET /repos/resq-software/programs/code-scanning/analyses, filtered to/language:rust. Rust coverage stopped with it, and nothing replaced it.This PR does not add Rust coverage that never existed; it restores coverage
that lapsed, and puts it in a repo-local workflow that cannot be switched off
by a default-setup toggle elsewhere.
The
cratesrepository has the identicalsecurity.ymllanguage input, butcarries a dedicated
codeql.yml, and consequently does get Rust coverage.This PR closes that gap the same way.
Why a separate workflow rather than adding
"rust"tosecurity.ymlAdding
rustto the existinglanguagesinput is a one-line change and wasthe first thing considered. It was rejected for a concrete reason:
The reusable revision this repository pins (
73b9edb8) carriescontinue-on-error: trueon its CodeQL Analyze step — it is there totolerate a default-setup collision on other repositories. Routing Rust through
that caller would mean a genuine Rust extraction failure passes as green, and
this repository would look scanned without being scanned. Since the whole
point of this PR is to stop exactly that situation, Rust gets its own caller
with failures left visible.
The dedicated workflow also pins the
codeql-actionversion already provenagainst Rust in
crates, rather than the older one the pinned reusable stilluses.
vendor/is nominally analysed, not meaningfully analysedWorth stating plainly, because this PR's own run log says so. The Rust
extraction splits cleanly along the first-party /
vendor/line: thefirst-party files under
resq-airspace/,resq-delivery/andresq-gating/extract without error, and the files under
vendor/extract with errors. Threevendored manifests fail to resolve at all:
and every file beneath
vendor/then draws:So
vendor/lands in the database as syntax with no semantic analyzer andno macro expansion. The suite that runs here is dominated by
path-problemdataflow/taint queries, which need resolved types and expanded macros to follow
a value from source to sink. On heavily macro-driven Solana crates, skipping
macro expansion removes most of the code those queries would have to traverse.
The honest statement is therefore: this PR gives the first-party Rust real
CodeQL coverage, and gives
vendor/a listing in the database that should notbe mistaken for analysis. That is still a strict improvement over the status
quo of no Rust coverage, and it is the reason to merge.
Follow-up, deliberately not in this PR, because either direction is a
judgement call the reviewer should make:
paths-ignore: vendor/**via aninitconfig, so the extraction summarystops implying coverage that is not there; or
vendor/is genuinelyanalysed — which is the option that matches the original intent, since these
are locally patched crates.
Disclosure: Rust CodeQL has found almost nothing in this org
Material to a PR whose value proposition is Rust coverage.
crateshas beenrunning
/language:rustfor months, and it has raised a single alert ever:crates#39,rust/unused-variableatcrates/resq-health/src/main.rs, severitynote,since fixed. Nothing at a security severity. It is a quality rule, from the
security-and-qualitysuite this workflow also requests.A reviewer should weigh that honestly. The counter-argument is that it is an
argument about base rate, not about this repository:
cratesis off-chaintooling, whereas the code this PR covers is on-chain program logic handling
custody and authorization, where the CWE-825/CWE-770/CWE-078 queries in the
suite are far more apposite. It is also the standard argument for any
static-analysis gate — the value is in the run that eventually catches
something.
I do not think it is a reason to withdraw the PR. It is a reason not to
describe this as closing a meaningful security gap without qualification.
Verification
rustis the correct CodeQL language identifier, and has no alias form —confirmed against
src/languages/builtin.jsoningithub/codeql-action.CodeQL (Rust)issuccess, and the analysis it produced is stored under this workflow's ownanalysis_key(.github/workflows/codeql.yml:codeql,refs/pull/86/merge),not default setup's.
git ls-remote --tags:actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1→refs/tags/v7.0.1✓github/codeql-action@1c5b675653bb5c22dbe9b12b556ec555138e09fd→refs/tags/v4.38.1✓actionlint— clean (exit 0), control-confirmed against a deliberatelybroken workflow which correctly raised
expressionandsyntax-checkerrors.
persist-credentials: falseon the checkout; nothing in the job pushes.Notes for the reviewer
Do not enable default setup on this repository without removing this
workflow first. If it is turned on, it will start rejecting this workflow's
uploads with
CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled, and — because the org reusableswallows that rejection with
continue-on-error— Rust coverage woulddisappear behind a green check.
Default setup can cover Rust here: it lists
["actions","rust"]asavailable and it did analyse Rust on this repository until it was switched
off. The two are simply mutually exclusive — enabling one disables the
other's uploads. Either is a defensible configuration; running both is not.
The first run takes a few minutes: the Rust extractor resolves cargo
manifests (
LoadManifest) rather than running a fullcargo build. Thatdesign is also why the three unresolvable
vendor/manifests degrade tosyntax-only rather than failing the job.