CodeQL: static analysis on the pull request, not in a weekly digest - #91
Merged
Conversation
OpenSSF Scorecard reads SAST as 0/10 -- "0 commits out of 30 are checked with a SAST tool" -- and it is one of the six zeroes holding the score at 6.0. `security-and-quality` rather than the default suite. This is a small codebase sitting in the execution path of consequential actions, and the extra queries cost a few minutes a project this size can afford. `build-mode: none`, because the core is stdlib plus pyyaml and click and every extra is imported lazily, so there is nothing to build for the analyser to see the code. **It deliberately does not gate a merge**, and that is recorded in a test rather than left as an omission somebody later reads as an oversight. A static analyser's first run on an unfamiliar codebase is a reading list, not a verdict; the required checks stay `check (3.11)`, `check (3.12)` and `package`. If that changes, `test_codeql_does_not_gate_a_merge` is where the argument gets rewritten. Runs on pull requests, on pushes to main, and weekly -- the schedule so that a new query release reaches code that was merged before it existed. Both actions are pinned to the SHA `scorecard.yml` already uses for `upload-sarif`. Six mutations, six caught: the pull_request trigger dropped, the wrong language analysed, security-events downgraded to read, the timeout removed, the analyze step deleted, and the schedule dropped.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Scorecard's
SASTcheck is 0/10 — "0 commits out of 30 are checked with a SAST tool" — one of six zeroes holding the repository at 6.0. Weight 5 of 97.5, so this is worth about +0.51.What
One workflow.
security-and-qualityrather than the default suite — a small codebase in the execution path of consequential actions can afford the extra queries.build-mode: none, because the core is stdlib pluspyyamlandclickwith every extra imported lazily, so there is nothing to build for the analyser to see the code.Both actions are pinned to the SHA
scorecard.ymlalready uses forupload-sarif.It does not gate a merge
Deliberate, and asserted by
test_codeql_does_not_gate_a_mergeso it reads as a decision rather than an oversight. A static analyser's first run on an unfamiliar codebase is a reading list, not a verdict. The required checks staycheck (3.11),check (3.12)andpackage.Expect findings on the first run. They land in the code-scanning tab and none of them block anything.
Mutation table
pull_requesttrigger droppedsecurity-eventsdowngraded toreadanalyzestep deletedChecks
ruff checkclean; full suite 3905 passed, 45 skipped.Stack
Independent of #90 (release provenance) and the fuzzing PR — all three branch from
main. Only trivial overlap: this touches the middle oftests/test_repository_signals.pywhile #90 appends to the end.