ci: add automated vulnerability remediation workflow#182
ci: add automated vulnerability remediation workflow#182ulziibay-kernel wants to merge 2 commits intomainfrom
Conversation
Made-with: Cursor
| env: | ||
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | ||
| run: | | ||
| gh api "/repos/${{ github.repository }}/dependabot/alerts?state=open&per_page=100" > dependabot-alerts.json 2>/dev/null || echo "[]" > dependabot-alerts.json |
There was a problem hiding this comment.
Silent error suppression hides API misconfiguration permanently
Medium Severity
The 2>/dev/null on the gh api call silently discards all stderr output, including authentication and permission errors. If the GitHub App token lacks the required Dependabot alerts: read permission, the API returns a 403, stderr is suppressed, and || echo "[]" creates an empty alerts file. The agent then reports "No open vulnerability alerts" and exits successfully. Since this is a weekly scheduled workflow, the team believes vulnerability remediation is running while it silently does nothing — potentially for weeks or months. Removing 2>/dev/null while keeping the || echo "[]" fallback would preserve resilience against transient failures while making permanent misconfigurations visible in workflow logs.
Made-with: Cursor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| env: | ||
| SOCKET_SECURITY_API_KEY: ${{ secrets.SOCKET_API_TOKEN }} | ||
| run: | | ||
| socket scan create --repo="${{ github.event.repository.name }}" --branch=main --default-branch --report --json > socket-report.json 2>/dev/null || echo '{"healthy":true,"alerts":{}}' > socket-report.json |
There was a problem hiding this comment.
Scan failure silently produces false healthy report
High Severity
When socket scan create fails (bad credentials, network error, service outage, etc.), the || fallback writes {"healthy":true,"alerts":{}} to socket-report.json, making the workflow believe no vulnerabilities exist. Combined with 2>/dev/null suppressing all error output, scan failures are silently treated as a clean bill of health. This defeats the entire purpose of the vulnerability remediation workflow — real vulnerabilities go undetected and unremediated with no indication anything went wrong.


Summary
Adds a weekly Socket.dev vulnerability remediation workflow. Runs a Socket scan with reachability analysis, then uses the Cursor agent to triage alerts and create fix PRs for actionable CVEs.
Adapted for this repo: Go-only, uses root
go.mod, Makefile build/test targets.Test plan
workflow_dispatchare active