ci(codeql): add minimal-scope CodeQL workflow (security-extended, weekly + push-to-main) - #74396
ci(codeql): add minimal-scope CodeQL workflow (security-extended, weekly + push-to-main)#74396bbasketballer75 wants to merge 2 commits into
Conversation
…kly + push-to-main)
There was a problem hiding this comment.
Pull request overview
Adds a new GitHub Actions workflow to run CodeQL code scanning on main pushes and on a weekly schedule, focusing on higher-signal security queries to detect CVE-class issues in the primary code ecosystems (Python and JS/TS).
Changes:
- Introduces a minimal CodeQL workflow running
security-extendedqueries only. - Scans
pythonandjavascript-typescriptvia a matrix job, with actions pinned to full SHAs. - Triggers on push-to-
main, weekly cron (Mon 06:00 UTC), andworkflow_dispatch.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Related: #10344 already adds |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the narrowly scoped security workflow proposal. The current main checkout has no CodeQL workflow, so the premise remains valid, but this version cannot run as submitted.
Problems
.github/workflows/codeql.yml:53and:65usegithub/codeql-action@3b0bd1d116c0bde30213346b22d4f634d96a2fb0. That SHA does not resolve in the action repository; both analysis steps will fail before scanning..github/workflows/codeql.yml:59addssecurity-extendedto CodeQL's default query set; it does not make that suite exclusive. The stated minimal query policy therefore is not implemented.
Suggested changes
- Replace both CodeQL action pins with a verified full SHA for the intended release, then retain the repository's SHA-pin convention.
- If security-extended-only is intended, disable default queries and declare that suite through CodeQL configuration; otherwise update the scope description.
- At
.github/workflows/codeql.yml:24, remove unsupported[codeql skip]; GitHub documents[skip ci]but not that token.
This is an automated hermes-sweeper review.
… skip token
The github/codeql-action SHA (3b0bd1d1...) pinned by the original commit
does not resolve in the action repository -- verified via the GitHub API
(422 'No commit found for SHA'), so both matrix legs would fail before
scanning anything. Replaced with the real, API-verified current v3 SHA
for both the init and analyze steps.
Also fixes two review findings: the header comment claimed
security-extended was the exclusive query set ('CVE-class findings
only'), but queries: security-extended augments CodeQL's default suite,
it doesn't replace it -- reworded to state that accurately. Dropped the
non-functional '[codeql skip]' commit-message token from the docs;
GitHub only recognizes '[skip ci]' for this.
|
Addressed the hermes-sweeper review:
Re: the #10344 collision on the same new file path — leaving that for a maintainer to reconcile since it's a different PR, not something I can resolve from this side. |
|
suggesting changes The workflow is syntactically valid and uses SHA-pinned actions, least-privilege permissions, and non-persisted checkout credentials. However, it only triggers on pushes to main, a weekly schedule, or manual dispatch. It therefore cannot provide the claimed PR-critical CodeQL gate: a vulnerable pull request can merge without a CodeQL result, and the first automatic scan occurs after merge. Add a fork-safe pull_request path or invoke the same analysis from the existing PR CI before treating this as mergeable.
Security evidence:
Review setup: I reviewed a run-owned local rebase or patch replay against current GitHub Not checked:
Signed: GPT-5.6-luna-max in Codex |
Summary
Adds a minimal-scope GitHub CodeQL workflow for CVE-class findings on push-to-
mainand on a weekly Monday 06:00 UTC schedule.Scope (deliberately minimal)
security-extendedonly (NOTsecurity-and-quality— too FP-heavy on a single-maintainer Python codebase)python+javascript-typescript(the two source ecosystems on this side; workflow files are pinned to commit SHAs and already covered bysupply-chain-audit.yml, so excluded here)workflow_dispatchactions/checkout@de0fac2e4…,github/codeql-action@3b0bd1d11…)Why not also enable the other GitHub security toggles?
dependabot.ymlalready exists and is scoped togithub-actionsonly with an explicit pinning-vs-auto-bump policy in its header comment. Enabling general Dependabot version updates would conflict with that.osv-scanner.ymlandsupply-chain-audit.ymlalready exist in.github/workflows/— adding CodeQL on top gives incremental value (source-level taint analysis) without duplicating them.Cost estimate
Test plan
workflow_dispatchfrom this PR branch and confirm both matrix legs (python,javascript-typescript) complete successfully against the currentmainsecurity-extended's expected baseline