Simpl-Resultat/.forgejo/workflows/audit.yml
le king fu 1c982e85c7
All checks were successful
PR Check — Frontend / frontend (pull_request) Successful in 3m11s
PR Check — Rust / rust (pull_request) Successful in 14m39s
fix(deps): accept RUSTSEC-2026-0459 behind a resolver guard
libsqlite3-sys 0.30.1 (bundled SQLite 3.46) is reachable on both shipped
targets, and its fix (>= 0.39) cannot be reached: links = "sqlite3" keeps a
single version in the graph, and sqlx-sqlite caps it below 0.38 while every
tauri-plugin-sql depends on sqlx ^0.8. audit.yml has been red every day since
2026-11-10 for this one advisory.

Per Max's decision, ADR 0018 gains a third admission case: a reachable
advisory whose fix is out of reach of any resolution of the graph, and whose
exploitation already needs local access to the user's account, may be listed
with a dated entry, a follow-up issue (#546) and a blocking resolver guard.

scripts/check-sqlite-advisory-block.sh lifts our SQLite-stack constraints in
a scratch copy of the manifest and lock and lets cargo resolve: it fails as
soon as libsqlite3-sys >= 0.39 becomes reachable, or on any other failure. A
canary without tauri-plugin-sql and sqlx must reach the fix. check-rust.yml
runs it (and the script path now triggers the workflow); REVIEW.md lists it
as a high-level file.

Fixes #542

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 08:11:07 -05:00

71 lines
2.7 KiB
YAML

name: Security audit
# Daily RustSec coverage (#232).
#
# check-rust.yml runs on PRs that change src-tauri/ and once a week on main,
# and its cargo audit step never fails the job — without this workflow a new
# advisory published against an unchanged dependency would go unnoticed.
#
# Runs without a Rust toolchain: cargo-audit only reads Cargo.lock, so the
# binary is invoked directly instead of as a `cargo` subcommand. That keeps
# this to ~1 min, where a daily check-rust would hold the capacity-1 runner
# for several minutes.
#
# Note: PATH is deliberately NOT overridden at job level (unlike check-rust,
# which needs /root/.cargo/bin for the toolchain) so that the install dir
# taiki-e/install-action appends to $GITHUB_PATH stays effective.
#
# This job reads .cargo/audit.toml from the checkout root, which lists the
# advisories accepted for this project (#310). A green run therefore means "no
# advisory outside that list", not "no advisory at all" — the justification and
# the removal criteria for each entry live in that file, and the policy behind
# it in docs/adr/0018-suppression-advisories-non-atteignables.md. One entry,
# RUSTSEC-2026-0459 (#542), is reachable: its fix is blocked upstream, and a
# check-rust.yml step guards that block, since this job has no Rust toolchain.
on:
schedule:
# 06:00 UTC daily
- cron: '0 6 * * *'
workflow_dispatch:
# What this key does on Forgejo 8.0.3: see the comment on `concurrency` in
# check-rust.yml (#376). That measurement covers push and pull_request runs;
# this workflow only runs on schedule and workflow_dispatch, which it does
# not cover.
concurrency:
group: ci-audit-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
audit:
runs-on: ubuntu
container: ubuntu:22.04
steps:
- name: Install Node.js 24
run: |
apt-get update
apt-get install -y --no-install-recommends \
curl ca-certificates git tar gzip
# Node.js is required by actions/checkout, a JavaScript action that
# needs `node` in the container PATH (taiki-e/install-action is a
# composite action).
curl -fsSL https://deb.nodesource.com/setup_24.x | bash -
apt-get install -y nodejs
node --version
- name: Checkout
uses: https://github.com/actions/checkout@v4
- name: Install cargo-audit
uses: https://github.com/taiki-e/install-action@v2
with:
tool: cargo-audit
# Unlike the PR run in check-rust.yml, this one is meant to fail loudly:
# it IS the notification channel for a newly published advisory.
- name: cargo audit
run: cargo-audit audit --file src-tauri/Cargo.lock