ci(security): add CodeQL code scanning (SAST)#1535
Conversation
Add a CodeQL SAST workflow analyzing the combined javascript-typescript language on pushes to main, pull requests to main, and a weekly schedule. - Least-privilege permissions: contents:read at the top level; the analyze job elevates only actions:read and security-events:write to upload results. - All actions SHA-pinned to 40-char commits with version comments per repo policy (Scorecard PinnedDependencies). - build-mode: none (CodeQL JS/TS needs no build) and queries:security-extended for broader security coverage. - Concurrency group cancels superseded runs. Co-authored-by: Copilot <175574315+pedrofuentes@users.noreply.github.com>
|
Status: REJECTED Sentinel Review ReportRef: ci/codeql-scanning → main Phase 1 — TDD / Test EvidencePR is a single
Phase 1.5 — Fast-path Evaluation🔴 count: 1 | LOC: 53 (≤150: Y) | Security paths: Y (CI/CD pipeline — sensitive surface) | New deps: Y (3 pinned third-party Actions added) | Commit types qualify: N ( Phase 2 — Execution LogSelective dispatch for a
Platform note: dimension sub-agents were dispatched as discrete Findings
Details (ordered by severity)
Verifications that PASSED (not findings — recorded for auditability)
Follow-ups & Actions
Decision rationale
|
|
Closing: Sentinel review (Report SENTINEL-1535-f92b426) found this advanced CodeQL workflow conflicts with the repo's already-enabled CodeQL default setup — GitHub refuses SARIF uploads from an advanced config while default setup is on, so the check fails deterministically. CodeQL SAST is already active via default setup; this workflow is redundant. Keeping default setup. (To switch to advanced/security-extended later, disable default setup in repo Settings → Code security, then re-open.) |
What
Adds the repository's first real SAST workflow: GitHub CodeQL code scanning for the JavaScript/TypeScript codebase. Previously the repo only had OpenSSF Scorecard posture (no actual static analysis).
.github/workflows/codeql.yml:pushtomain,pull_requesttomain, and a weeklyschedule(30 6 * * 1, Mondays 06:30 UTC).contents: read; theanalyzejob elevates onlyactions: read+security-events: write(scoped to the one job that uploads results).javascript-typescriptwithbuild-mode: none(JS/TS needs no build).security-extendedfor broader security coverage.deploy-pages.ymlstyle).SHA-pinning (repo policy)
Every
uses:is pinned to a full 40-char commit SHA with a# vX.Y.Zcomment (resolved viagh api), matching the existingci.yml/scorecard.ymlconvention and satisfying Scorecard PinnedDependencies:actions/checkout9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0github/codeql-action/init8aad20d150bbac5944a9f9d289da16a4b0d87c1egithub/codeql-action/analyze8aad20d150bbac5944a9f9d289da16a4b0d87c1eCodeQL Action v4 is the current major recommended for github.com and is compatible with this repo's Node 24 baseline.
Validation
yaml-lintpassed and structural parse (16/16 semantic assertions) passeduses:confirmed SHA-pinned (40-hex) + version commentpnpm typecheckgreen,pnpm lintgreen (0 warnings),pnpm testgreen (3606 passed, 1 skipped),prettier --checkcleanScope
Only
.github/workflows/codeql.ymladded. No other workflow/source/dependency changes. Default setup was not enabled via API (workflow file only). CI-config addition is TDD-exempt; suite stays green.