feat(#518): harden framework security scanning (CodeQL + Scorecard + Dependabot + SECURITY.md + release-artifact guard)#523
Conversation
- CodeQL (.github/workflows/codeql.yml) — actions + javascript-typescript (bash stays on Semgrep r/bash); results to code-scanning - OSSF Scorecard (.github/workflows/scorecard.yml) + README badge - Dependabot (.github/dependabot.yml) — github-actions ecosystem (the repo's only dependency surface; no package manifests) - SECURITY.md — private vulnerability reporting + supported versions - Release-artifact content guard: extract-subpacks-on-release.yml now scans the built marketplace/ bundle with gitleaks (filesystem) + placeholder-diffs any bundled onboarding.yaml vs onboarding.example.yaml (#517), failing pre-publish - Decision recorded in AgDR-0065 Note: the GitHub-native settings (secret scanning + push protection, code-scanning default setup, Dependabot alerts) can't be set from code — delivered as an operator checklist in the PR. Full-history secret sweep already runs via the existing gitleaks job. This PR closes the code-expressible ACs; the settings ACs stay open. Refs #518 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
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. |
| persist-credentials: false | ||
|
|
||
| - name: Run analysis | ||
| uses: ossf/scorecard-action@v2 |
atlas-apex
left a comment
There was a problem hiding this comment.
Code Review: PR #523
Commit: 1677b66dd5fc511091eab856e0ba2fcdf75081d1
Summary
Dog-foods the framework repo's own security posture: adds CodeQL (actions + javascript-typescript matrix), OSSF Scorecard + README badge, Dependabot (github-actions ecosystem), SECURITY.md, a release-artifact content guard in extract-subpacks-on-release.yml, and AgDR-0065. The GitHub-native settings half (secret scanning / push protection / Dependabot alerts / code-scanning default-setup) is honestly deferred to an operator checklist, hence Refs #518 not Closes.
Checklist Results
- Architecture & Design: Pass
- Code Quality: Pass
- Testing: Pass (workflows validate; CodeQL
actionsjob already green on this SHA) - Security: Pass
- Performance: Pass (weekly cron + push/PR cadence is conventional)
- PR Description & Glossary: Pass (6-row glossary, clear deferred-scope disclosure)
- Summary Bullet Narrative: Pass (every bullet is what + why)
- Technical Decisions (AgDR): Pass (AgDR-0065 linked; numbering clean — 0063/0064 exist on dev, 0065 is next free)
- Adopter Handbooks: N/A (no migration files, no domain code, no TS/Py/Go/Rust source in diff)
Issues Found
None.
Verification performed
- CodeQL permissions — top-level
contents: read, job escalates tosecurity-events: write(required for SARIF upload) +contents: read. Least-privilege, correct.fail-fast: falsematrix is right so one language failure doesn't mask the other. - Scorecard permissions —
security-events: write(upload-sarif) +id-token: write(required forpublish_results: true→ the README badge) +contents: read. Exactly the documented Scorecard scope, nothing broader.persist-credentials: falseon checkout is the recommended Scorecard hardening. Correct. - Dependabot schema —
version: 2,github-actions,directory: "/", weekly/monday, PR limit 5. Valid;github-actionsis genuinely the repo's only real dependency surface (no package manifests), and the comment documents the "add an ecosystem when a manifest appears" extension path. - Artifact-guard — gitleaks pinned to
ghcr.io/gitleaks/gitleaks:v8.18.4;detect --no-git --source /repo/marketplace --redact --exit-code 1is the correct filesystem-mode invocation (no git history needed for a built bundle). The placeholder-diff loop uses process substitution< <(find ...), which requires bash — GitHubrun:defaults to bash onubuntu-latest, so this is safe. The[ -f onboarding.example.yaml ]guard degrades gracefully (confirmed the file exists at repo root on this SHA, from #517).diff -qagainst the example fails the build unless byte-identical to the placeholder — correct semantics. - Honest scope — the deferred items (secret scanning, push protection, code-scanning default-setup, Dependabot alerts) are genuinely GitHub Settings toggles that cannot be expressed in committed files. The "Deliberately NOT added" and "Operator checklist" sections disclose this clearly, and the AgDR's Options table records why the agent did not flip them via
gh api(externally-visible admin change, wrong actor). Legitimately not-code;Refs #518is the correct linkage. - Pinning posture — all actions pinned by tag (
@v4/@v3/@v2), matching the existingsecurity-scan.ymlconvention. Consistent with repo norms. - Commit-message-quality handbook (advisory) — HEAD commit has a substantive multi-bullet body explaining what + why and references the ticket. No finding.
Suggestions (non-blocking)
suggestion:Tag-pinning (@v4etc.) matches repo convention and is fine to merge as-is, but Scorecard's own "Pinned-Dependencies" check will recommend SHA-pinning for the new workflows once it runs. Consider a follow-up to SHA-pin all workflow actions repo-wide to lift that score — best handled as one sweep across every workflow, not piecemeal here.
Verdict
APPROVED
The workflows are correct and least-privilege, the artifact guard's bash idioms are safe under GitHub's default shell, the deferred scope is honestly disclosed as non-code, and AgDR + glossary + narrative summary all check out. CI is green on this SHA (CodeQL actions passed; JS/TS analyze pending is expected first-run behaviour). Author is the maintainer, so submitting as a comment-approval.
🤖 Reviewed by Rex (Code Reviewer Agent)
📌 Reviewed commit: 1677b66dd5fc511091eab856e0ba2fcdf75081d1
Summary
.github/workflows/codeql.yml) —actions+javascript-typescriptmatrix (CodeQL doesn't analyse bash — that stays on the existing Semgrepr/bashjob — but it now covers the GitHub Actions workflows themselves andsite/copy-for-ai.js).security-extendedqueries; results to the Code scanning tab..github/workflows/scorecard.yml) + a live README badge — weekly supply-chain posture (branch protection, token scope, pinned actions, dangerous-workflow patterns)..github/dependabot.yml) —github-actionsecosystem weekly. That's the repo's only real dependency surface (nopackage.json/requirements.txt/go.mod); the config is structured so a future manifest just adds an ecosystem.extract-subpacks-on-release.ymlnow scans the builtmarketplace/bundle (filesystem, not git history) with gitleaks and placeholder-diffs any bundledonboarding.yamlagainstonboarding.example.yaml(reusing [Feature] Keep onboarding config out of git: example-file + gitignore + commit-time guard #517's signal), failing the build before publish. Closes the "secrets/config shipped inside a release artifact" gap.Deliberately NOT added (with reasons)
r/bash— the repo has no real JS/TS app source (only a staticsite/copy-for-ai.js), which CodeQLjavascript-typescriptnow covers. Adding JS Semgrep rulesets would be noise on an empty surface.security-scan.ymlgitleaks job checks out withfetch-depth: 0(full history). No new job needed.These are repo Settings toggles, externally-visible on the public repo. Per your call, I did not flip them via
gh api; please enable them in Settings → Code security:dependabot.ymlhere covers version updates; alerts are a settings toggle)#518 stays partially open until the four boxes above are ticked — hence
Refs #518, notCloses.Testing
python3 yaml.safe_loadon all four workflow/config files → valid.actionlinton the three workflows → no errors (only pre-existing shellcheck-style notes in the untouched summary block).bash -non the artifact-guard run block (docker + process-substitution idiom) → parses clean.markdownlintclean onSECURITY.md+ the AgDR.Refs #518
Glossary
actionslanguage scans workflow files,javascript-typescriptscans JS/TS.*.exampleplaceholders (from #517).