ci: supply-chain security gate (OSV-Scanner + Socket) [failproofai-394]#391
Conversation
Add an OSV-Scanner workflow that scans bun.lock against OSV.dev (GitHub/npm advisories + the OpenSSF malicious-packages feed) on every PR (incl. Dependabot bumps), pushes to main, and weekly, failing on ANY known-vulnerable or malicious dependency. Document the policy + a Socket behavioral layer in SECURITY.md, add an osv-scanner.toml allow-list, and a README supply-chain status badge. Remediate the 18 pre-existing transitive advisories the gate surfaced (brace-expansion, flatted, minimatch, picomatch, postcss, vite, ws) by refreshing bun.lock within range, with overrides pinning postcss to the patched 8.5.x line (Next.js pins the vulnerable 8.4.31) and holding eslint-plugin-react-hooks at main's 7.0.1 so the refresh doesn't also bump the linter. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 28 minutes and 55 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds an OSV-Scanner GitHub Actions job that checks out the repo and scans ChangesSupply Chain Security Implementation
🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
osv-scanner-reusable.yml declares security-events:write at its top level; the PR-gate job grants only contents:read (required for Dependabot's read-only token), which GitHub rejects at startup since a called workflow can't request more than the caller grants — hence the startup_failure. Invoke the SHA-pinned osv-scanner-action directly in a single contents:read job instead: simpler, works on Dependabot PRs, and still blocks on any finding via the scanner's non-zero exit. Drops the SARIF/Security-tab upload (deferred). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/osv-scanner.yml:
- Around line 39-40: Update the "Checkout" step that uses
actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 to disable credential
persistence by adding the with: persist-credentials: false setting; locate the
step named "Checkout" (the block that calls uses: actions/checkout@...) and add
the persist-credentials: false under its with configuration so the GitHub token
is not written to local git config.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7ed5b21c-da53-4a70-923c-7e7aae6b4ec8
📒 Files selected for processing (2)
.github/workflows/osv-scanner.ymlSECURITY.md
✅ Files skipped from review due to trivial changes (1)
- SECURITY.md
actions/checkout writes GITHUB_TOKEN into .git/config by default. The scan job does no git operations after checkout, so set persist-credentials: false to avoid leaving the token available to later steps (zizmor 'artipacked' / CodeRabbit review on #391). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
failproofai is a reliability/guardrail layer for AI coding agents, not a security tool. Reframe the supply-chain rationale around what it actually is: an npm package that runs locally inside users' agent sessions, so a compromised dependency would reach their machines. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
What & why
Step one of hardening the project against supply-chain attacks. The repo had no dependency-security scanning, so a malicious or vulnerable dependency (including via Dependabot bumps) could land unnoticed. This adds a CI gate that flags supply-chain threats on every PR.
The gate — OSV-Scanner (
.github/workflows/osv-scanner.yml)bun.locktree against OSV.dev — GitHub/npm advisories plus the OpenSSF malicious-packages feed (confirmed malware: typosquats, account-takeover injections, …).main, and weekly (catches advisories disclosed after merge).contents: readjob calls the SHA-pinnedosv-scanner-actiondirectly and fails on any finding (the scanner exits non-zero).contents: readkeeps it working on Dependabot's read-only token. Theosv-scanner.tomlallow-list is auto-loaded from the repo root.Behavioral layer — Socket
OSV-Scanner is advisory-based. Socket (via its GitHub App) adds behavioral detection of novel attacks (malicious install scripts, suspicious network/fs access, obfuscation) before they reach any advisory DB. See
SECURITY.md.Remediation (required by block-on-any-finding)
The new gate surfaced 18 pre-existing transitive advisories (9 High, 9 Medium) in
brace-expansion, flatted, minimatch, picomatch, postcss, vite, ws. All fixable — remediated by refreshingbun.lockwithin range, plus twooverrides:postcss→ patched 8.5.x (Next.js pins the vulnerable 8.4.31).eslint-plugin-react-hooksheld at main's7.0.1, so the refresh doesn't also bump the linter (avoids unrelated lint-rule churn).Scan now reports "No issues found."
Also added
SECURITY.md— policy, triage/allow-list runbook, maintainer setup, vulnerability reporting.osv-scanner.toml— documented allow-list (currently empty; tree is clean).Validation
bun run lint: 0 errors (matches main)bun run build: success (Next build OK with the postcss override)bun run test:run: 1690 passedactionlint: cleanMaintainer follow-ups (need repo admin; see SECURITY.md)
OSV-Scanner) as a required status check formain.SOCKET_SECURITY_API_KEY+ Socket CI action.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Chores