fix(security): CI hardening — permissions, npm ci, Dependabot, CODEOWNERS (SDK-6067/6069/6071)#83
fix(security): CI hardening — permissions, npm ci, Dependabot, CODEOWNERS (SDK-6067/6069/6071)#83AakashHotchandani wants to merge 2 commits into
Conversation
…NERS (SDK-6067, SDK-6069, SDK-6071)
Batched mechanical CI/config hardening for the nightwatch sample repo:
- SDK-6067 (CWE-732): add a least-privilege top-level `permissions:` block to
reviewing_changes.yml (`contents: read`, `checks: write`). The job only reads
the repo for checkout and writes check runs via github-script; previously it
inherited broad default GITHUB_TOKEN scopes.
- SDK-6069 (CWE-1357): add .github/dependabot.yml (weekly npm + github-actions
updates) so transitive CVEs are surfaced automatically, and switch
`npm install` -> `npm ci` for reproducible, lockfile-pinned CI installs.
- SDK-6071 (CWE-284): widen CODEOWNERS `.github/*` -> `.github/**` so the
recursive glob actually covers `.github/workflows/` (single-level `*` left
workflow files without required Code Owner review).
Verified: both YAML files parse (js-yaml); workflow `permissions` resolves to
{contents: read, checks: write}; `npm ci` succeeds against the committed
lockfile (so the install-command switch will not break CI).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…rget-branch/grouping pr-review on #83 flagged that CODEOWNERS uses last-match-wins, so the trailing catch-all '*' rule still won for .github/ files and SDK-6071's bypass was not actually closed by the glob widening alone. Reorder so '*' precedes '.github/**', making the .github/** rule the last (winning) match for workflow/config files. Also applied the two review nits: explicit target-branch: master on both Dependabot ecosystems, and a groups: block to batch github-actions bumps. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🤖 Automated review (pr-review agent) — final (re-reviewed after fix)Verdict: ✅ Approve — Risk: Low · 0 critical · 0 warnings · 0 suggestions (head Initial review found one blocking issue, now fixed: CODEOWNERS uses last-match-wins, so the original Per-ticket:
Per-file confidence: all three files → 🟢 All Clear.
|
Summary
Batched, mechanical CI/config hardening for three tickets (same repo, same type).
permissions:toreviewing_changes.yml.github/dependabot.yml+ switchnpm install→npm ci.github/*→.github/**Details
SDK-6067 — workflow token scopes. The workflow had no
permissions:block, so it inherited broad defaultGITHUB_TOKENscopes. The job only checks out the repo and creates check runs viaactions/github-script, so it's scoped to exactly:SDK-6069 — dependency drift. Adds
.github/dependabot.ymlwith weekly npm and github-actions update schedules (the latter also helps the unpinned-actions risks tracked elsewhere in this audit), and switches the install step tonpm cifor reproducible, lockfile-pinned installs.SDK-6071 — CODEOWNERS gap.
.github/*is a single-level glob that does not match.github/workflows/*, leaving workflow files without required Code Owner review. Widened to.github/**.Verification
permissionsresolves to{contents: read, checks: write}.npm cisucceeds against the committed lockfile — thenpm install→npm ciswitch will not break CI..github/only (CODEOWNERS, reviewing_changes.yml, new dependabot.yml).Jira: SDK-6067, SDK-6069, SDK-6071
🤖 Generated with Claude Code