Repository navigation
chore(security): add action for fixing vulnerabilities - #4453
Conversation
Adds a composite action that audits Yarn projects, re-resolves vulnerable packages in the lockfile, hands remaining advisories to Copilot CLI, verifies that changes stay within release lines, and creates or updates a pull request. Runs weekly in rnx-kit, and can be run locally with `node --run fix-vulnerabilities`.
- Rename script to `action.mts` and prompt to `prompt.template.md` - Require a clean worktree including untracked files, since rejected changes are cleaned up with `git clean` Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Jason Morse (JasonVMo)
left a comment
There was a problem hiding this comment.
I'm curious whether you have tried to just run the agents with an explicit set of instructions? I have a fix security updates skill in FURN for instance that I run manually but it would be good to compare the results.
This looks very cool and I see the agent fallback, but I worry about fragility. It would be good to do a comparison.
- Quote arguments on Windows instead of letting Node concatenate them unquoted with `shell: true`, which split arguments containing spaces (e.g. `--allow-tool=shell(yarn dedupe)`) and printed DEP0190 - Read `npmMinimalAgeGate` with `--json` since Yarn colors its output on GitHub Actions, which caused the age gate disabled pass to be skipped - Pass `--no-auto-update` so that Copilot CLI runs the pinned version Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
I have no data for this but I find this approach to be more consistent than just running everything through agents. The first few steps are always the same. List all alerts, try to update the affected packages individually. It is only when we need to traverse up the dependency tree and make decisions that agents are used. |
Copilot CLI matches shell permission rules on the first-level subcommand only, so `shell(yarn npm audit)` and `shell(yarn npm info)` never matched and every such command was denied on CI. Allowing `shell(yarn npm)` would also allow e.g. `yarn npm publish`, so remove them instead. The script already re-audits Copilot's changes. Also list the allowed commands in the prompt so Copilot doesn't attempt pipes or other commands. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Some data:
|
Agent evals
|
Description
Adds a composite action that audits Yarn projects, re-resolves vulnerable packages in the lockfile, hands remaining advisories to Copilot CLI, verifies that changes stay within release lines, and creates or updates a pull request. Runs weekly in rnx-kit, and can be run locally with
node --run fix-vulnerabilities.Test plan