Skip to content

feat: seckit fix command + audit check for Dependabot security updates - #15

Merged
segraef merged 3 commits into
mainfrom
feat/fix-command
Oct 11, 2026
Merged

segraef merged 3 commits into
mainfrom
feat/fix-command

Conversation

@segraef

@segraef segraef commented Oct 11, 2026

Copy link
Copy Markdown
Owner

What

  1. seckit audit now checks Dependabot security updates. The policy (templates/policy-github.yml) marks them required and enforce already turns them on, but audit never checked. It now records security.dependabot_security_updates and fails when the setting is disabled, paused or unreadable. Bash and PowerShell.
  2. New seckit fix [DIR] command (fix_deps.sh / fix_deps.ps1): applies safe, same-major fixes to vulnerable npm dependencies.
    • Default: rewrites package-lock.json only, --ignore-scripts, never touches node_modules, never commits or pushes.
    • Tries osv-scanner fix --strategy=in-place, falls back to npm audit fix when osv fails (it errors on lockfiles with file: deps).
    • --dry-run writes nothing; --install also updates node_modules (scripts still off).
    • Prints before/after counts by severity and what still needs a major upgrade. Exits 1 if high/critical remain or the audit could not run (fails closed).
    • Non-npm manifests print "not supported yet".

Why

Found on a real repo: Dependabot alerts were on but security-update PRs were off, so 134 alerts sat unfixed, including a critical Next.js RCE. Neither audit nor scan flagged the setting, and SecKit had no way to apply fixes.

Testing

  • audit.sh / audit.ps1 against a repo with the setting off: row fails as expected; API refusal (no admin) records unknown without crashing.
  • fix_deps.sh on throwaway npm fixtures (minimist, lodash, node-fetch): safe bumps applied, major-only item listed, dry-run leaves the lockfile byte-identical, registry outage and skipped workspaces fail closed. Same results from fix_deps.ps1.
  • Runs under stock macOS /bin/bash 3.2.
  • bash check.sh: RESULT: green.

No automated test for fix (needs the npm registry, does not fit check.sh).

🤖 Generated with Claude Code

https://claude.ai/code/session_01QgSpYbut4TczrUrE1hUKeg

segraef and others added 3 commits October 10, 2026 20:57
policy-github.yml lists dependabot_security_updates as required and
enforce already turns it on, but audit never read it back. Query
repos/{owner}/{repo}/automated-security-fixes and record
security.dependabot_security_updates as enabled, disabled, paused or
unknown. Same check in audit.ps1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New fix_deps.sh / fix_deps.ps1, dispatched as `seckit fix [DIR]` and
menu item f. Finds package-lock.json files, applies same-major fixes
with osv-scanner fix (in-place, minor, no-introduce) then npm audit fix
--package-lock-only --ignore-scripts (fallback when osv fails). Prints
before/after severity counts, version changes, and what still needs a
major upgrade. --dry-run works on a temp copy, --install also updates
node_modules (still --ignore-scripts). Never commits or pushes. Exit 1
while high/critical remain. Other ecosystems are reported as not
supported yet. fix_deps.sh added to shellcheck in check.sh and CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm audit prints {"error":...} with exit 0 when the registry is unreachable;
fix_deps.sh read that as 0 critical / 0 high and exited 0. Treat a missing
metadata.vulnerabilities as unknown and count it as a failure, matching
fix_deps.ps1. A workspace lockfile skipped by --dry-run now keeps its
before-count instead of reporting clean (both scripts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QgSpYbut4TczrUrE1hUKeg
@segraef
segraef merged commit 373275a into main Oct 11, 2026
6 checks passed
@segraef
segraef deleted the feat/fix-command branch October 11, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant