Skip to content

ci: add ruff, zizmor, and CodeQL static analysis - #2

Merged
CryptoFewka merged 2 commits into
mainfrom
ci/static-analysis
Jul 22, 2026
Merged

ci: add ruff, zizmor, and CodeQL static analysis#2
CryptoFewka merged 2 commits into
mainfrom
ci/static-analysis

Conversation

@CryptoFewka

Copy link
Copy Markdown
Owner

Adds three static-analysis passes and the workflow hardening needed to run them clean. Validated green on the fork (CI + CodeQL); CodeQL surfaced no alerts.

What

  • ruff (pyflakes F rules) and zizmor (GitHub Actions security auditor) run in the ci.yml static job.
  • CodeQL (codeql.yml, new) scans Python and the native C sources (the DLL injector, cryptbase RNG stub, and XCurl CA shim, cross-compiled with mingw so the extractor observes them).

Hardening (surfaced by zizmor)

  • persist-credentials: false on every actions/checkout (verified: no workflow uses the persisted git token; releases go through gh / softprops).
  • Stopped expanding workflow_dispatch inputs (force_rebuild / publish / channel) inline in run: blocks, binding them to env: vars instead (template-injection).
  • Pinned codeql-action to its commit SHA rather than the annotated-tag object (zizmor impostor-commit).

Also

  • Removed one unused import ruff flagged in tests/test_auth_settings.py.

Local + CI results: ruff, zizmor, and actionlint clean; 221 tests pass; CodeQL green with 0 alerts.

Written with Claude Code

CryptoFewka and others added 2 commits July 22, 2026 07:57
Wire three static-analysis passes into CI and harden the workflows so they
run clean against them:

- ruff (pyflakes F rules) and zizmor (GitHub Actions security auditor) run
  in the ci.yml static job. CodeQL scans Python and the native C sources
  (the DLL injector, cryptbase RNG stub, and XCurl CA shim, cross-compiled
  with mingw so the extractor observes them) via a new codeql.yml.
- Harden every workflow to pass zizmor: set persist-credentials: false on
  all actions/checkout steps, and stop expanding workflow_dispatch inputs
  (force_rebuild / publish / channel) inline in run blocks, binding them to
  env vars instead (the template-injection findings).
- Drop an unused import ruff flagged in tests/test_auth_settings.py.

Validated locally: ruff, zizmor, and actionlint all clean; 221 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pmkUWS6teoMZUUnMJG7Gr
codeql-action v3 is an annotated tag, so the git-ref API returns the tag
object SHA (3b0bd1d), not a commit. zizmor's online impostor-commit audit
correctly flags pinning to it as "a commit that doesn't belong to the
repo". Pin the underlying commit (4187e74) the tag resolves to. This only
surfaces with an API token, hence it passed locally (offline) but failed in
CI where GH_TOKEN enables zizmor's online audits.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014pmkUWS6teoMZUUnMJG7Gr
@CryptoFewka
CryptoFewka merged commit ddec87c into main Jul 22, 2026
11 checks passed
@CryptoFewka
CryptoFewka deleted the ci/static-analysis branch July 23, 2026 02:02
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.

1 participant