Skip to content

ci(security): add CodeQL static analysis - #734

Merged
forkwright merged 1 commit into
mainfrom
ci/add-codeql
Aug 25, 2026
Merged

ci(security): add CodeQL static analysis#734
forkwright merged 1 commit into
mainfrom
ci/add-codeql

Conversation

@forkwright

Copy link
Copy Markdown
Owner

CodeQL ran in three of twelve fleet repos. This one was not among them, so nothing read its source for injection paths, unsafe patterns, or over-broad workflow permissions — cargo audit, cargo deny and OSV all read the dependency list, not the code.

What this adds

job scans timeout
analyze-actions the workflow definitions themselves — untrusted input reaching a run block, permissions wider than needed, unpinned references 30m
analyze-rust the crate source 90m

Scheduled weekly plus on push to main, so it adds no latency to the merge path. Free on a public repository.

Sourced from aletheia, not from the template

workflow/templates/ci/codeql.yml is the stalest copy of this file in the fleet (kanon#3644). It differs from aletheia's live version in three ways, all regressions:

  • No timeout-minutes on either job. A hung CodeQL run reaches GitHub's six-hour default.
  • An older actions/checkout pin — v6 where aletheia is on v7.0.1.
  • permissions: {} where aletheia states an explicit contents: read default-deny with the reasoning attached.

Copying the template into eight repos would have planted those three regressions everywhere at once. The rollout script asserts every job carries a timeout-minutes before writing — that being the specific thing the template lacks, and the specific thing nobody notices until a job has been running six hours.

Part of a fleet-wide pass

Eight public repos are getting this. typikon and dioptron take analyze-actions alone — they carry no Cargo manifest, so a Rust scan would analyse nothing and fail looking for a build. gnomon is skipped: it is private and its Actions minutes are exhausted (kanon#3638), so it would gain nothing today.

CodeQL ran in three of twelve fleet repos. This repo was not one of them, so
nothing read its source for injection, unsafe patterns or over-broad workflow
permissions -- cargo audit, cargo deny and OSV all read the dependency list
rather than the code.

Two jobs, matching the fleet form:

  analyze-actions   scans the workflow definitions themselves -- untrusted
                    input reaching a run block, permissions wider than needed,
                    unpinned references. Applies to any repo with workflows.
  analyze-rust      scans the crate source.

Copied from aletheia rather than from workflow/templates/ci/codeql.yml, which
is the stalest copy of this file in the fleet (kanon#3644). The template carries
no timeout-minutes on either job -- so a hung CodeQL run reaches GitHub's
six-hour default -- pins an older actions/checkout, and sets `permissions: {}`
where aletheia states an explicit default-deny with its reasoning attached.
Sourcing eight repos from the template would have planted those three
regressions everywhere at once.

Asserted before writing that every job carries a timeout, because that is the
specific thing the template is missing and the specific thing nobody notices
until a job has been running for six hours.

Free on a public repository, and scheduled weekly rather than per-PR so it adds
no latency to the merge path.
@forkwright
forkwright merged commit 9793cdb into main Aug 25, 2026
16 checks passed
@forkwright
forkwright deleted the ci/add-codeql branch August 25, 2026 01:18
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