Skip to content

ci: add Security workflow (actionlint, gitleaks, cargo-deny, OpenShell pin check) - #102

Open
ilanh wants to merge 1 commit into
mainfrom
chore/security-ci
Open

ilanh wants to merge 1 commit into
mainfrom
chore/security-ci

Conversation

@ilanh

@ilanh ilanh commented Nov 17, 2026

Copy link
Copy Markdown
Owner

What and why

Adds a Security workflow with supply-chain checks for the workflows, the git history, the Rust dependency tree and the OpenShell pin.

Closes #101

  • actionlint on .github/workflows (with shellcheck on run: scripts). ci.yml now pins actions/checkout and actions/cache by commit SHA like the other workflows (checkout moves from v4 to v7.0.1, the version the rest of the repo already uses).
  • gitleaks over the full history, using the binary rather than gitleaks-action.
  • cargo-deny with a new deny.toml: advisories (vulnerable, unmaintained, unsound and yanked crates fail), licenses (only the 11 permissive licenses the tree uses today), bans (duplicate versions warn, wildcards fail) and sources (crates.io and NVIDIA/OpenShell only). It has no advisory ignores. RUSTSEC-2026-0459 does not fire because libsqlite3-sys is in Cargo.lock but not in the build graph (cargo tree -i libsqlite3-sys --target all prints nothing). cargo audit still needs its ignore in .cargo/audit.toml because it reads the whole lockfile.
  • openshell-pin (scripts/verify-openshell-pin.sh): CI does not download OpenShell binaries. It builds the policy crates from the git tag. Release attestations cover OpenShell's packages, and those can be built from a different commit than the tag (the v0.1.8 .deb was built from 22209de, but the tag points to f3d9765), so gh attestation verify --repo NVIDIA/OpenShell would say nothing about the source cargo builds. The script checks that:
    • all OpenShell crates use one tag, with no branch or rev pins;
    • Cargo.lock uses that tag and a single commit;
    • the upstream tag points to that commit now (git ls-remote, peeled);
    • GitHub verified the commit's signature. This part only warns.
  • Tool downloads (scripts/ci-tools.sh): actionlint 1.7.12, gitleaks 8.30.1 and cargo-deny 0.21.0 are downloaded at pinned versions. Each archive is checked against a SHA-256 pinned in the script, not against the release's own checksum file. actionlint is also checked against its build provenance. gitleaks and cargo-deny publish no attestations.
  • scripts/security-local.sh runs the same four checks locally.

Docs: docs/DEVELOPING.md (section 4), CONTRIBUTING.md, SECURITY.md (new "Supply chain" section), AGENTS.md (doc map and dependency rule), the README develop snippet, the PR template, and the CHANGELOG under Unreleased.

Not in this PR: making the new jobs required status checks. That change goes in .github/rulesets/protect-main.json plus scripts/protect-main.sh, and the maintainer decides it.

Verified locally on Linux before pushing: scripts/security-local.sh passes (actionlint clean, gitleaks found no leaks in 79 commits, cargo deny check reports advisories, bans, licenses and sources ok, the pin is ok and its signature is verified). shellcheck passes on the new scripts. As a negative test, a Cargo.lock commit edited by hand fails the pin check.

Checklist

  • Branch is named feat/, fix/, docs/, chore/ or test/ and commits are signed off (git commit -s)
  • scripts/ci-local.sh passes (TOOLCHAIN=1.94 scripts/ci-local.sh): no Rust or generated-docs changes; CI runs it
  • Tests added or updated (tests/cli.rs, fixtures, golden files): n/a (CI-only change)
  • Docs regenerated if directives or flags changed (scripts/gen-docs.sh): n/a
  • Docs updated in this PR for every behaviour change
  • CHANGELOG.md has a line under ## [Unreleased]
  • No secrets in code, fixtures or output

…l pin check)

Closes #101

Signed-off-by: Ilan Harel <ilanharel@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: supply-chain security checks (actionlint, gitleaks, cargo-deny, OpenShell pin verification)

1 participant