Skip to content

Commit 5da2aec

Browse files
committed
Improve CVE workflow
Signed-off-by: Daniel Farrell <[email protected]>
1 parent cb69524 commit 5da2aec

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

.agents/workflows/cve-fix.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#### Fixing CVEs
22

3+
**All commands should be run from the repository root directory.**
4+
35
**Before starting, user must:**
46

57
Install grype:
@@ -117,7 +119,7 @@ Submodules may have different (non-vulnerable) versions. Check `git diff` for un
117119
- Go minor version (1.X => 1.Y)
118120
- K8s minor version (v0.A => v0.B)
119121

120-
Revert changes. Low/Medium CVEs: skip to Step 9. High/Critical: consult team.
122+
Revert changes. Low/Medium CVEs: skip to step 9. High/Critical: consult team.
121123

122124
Remove `toolchain` lines and extra blank lines added by `go mod tidy`:
123125

@@ -137,7 +139,7 @@ Expected: Dependency file updates only.
137139
##### 5. Clean Binaries
138140

139141
```bash
140-
make clean-generated
142+
make clean
141143
```
142144

143145
Removes build artifacts to avoid false positives.
@@ -160,7 +162,7 @@ CVE(s) for this package should no longer appear.
160162
make unit
161163
```
162164

163-
**Note**: When fixing multiple packages, skip this step for each package and run once at end.
165+
**Note**: When fixing multiple packages, skip for each and run once at end.
164166

165167
Build errors may indicate incompatible dependency versions for this branch.
166168

@@ -178,6 +180,25 @@ Expected: Only go.mod/go.sum files (for modules that changed).
178180

179181
Follow commit templates in @.agents/commit-templates.md (CVE Fixes section). Use "in /[module]" format if only coredns or tools files changed.
180182

183+
```bash
184+
# Single CVE:
185+
git commit -s -m "$(cat <<'EOF'
186+
Bump [abbreviated-package] for [CVE-ID]
187+
188+
Full package: [full-package-path]
189+
EOF
190+
)"
191+
192+
# Multiple CVEs:
193+
git commit -s -m "$(cat <<'EOF'
194+
Bump [abbreviated-package] for CVEs
195+
196+
Full package: [full-package-path]
197+
Fixes: [CVE-ID-1], [CVE-ID-2]
198+
EOF
199+
)"
200+
```
201+
181202
After each commit, rescan to check for newly introduced CVEs:
182203
```bash
183204
grype . --config .grype.yaml -o table
@@ -266,7 +287,8 @@ EOF
266287

267288
##### Common Issues
268289

269-
- **CVE persists after update**: Verify you used correct FIXED-IN version; replace directives should have been caught in Step 3
290+
- **CVE persists**: Verify you used correct FIXED-IN version; replace directives should have been caught in Step 3
270291
- **New CVE appears after fix**: Dependency downgrades can introduce CVEs; fix immediately (Step 8 rescan catches these)
271292
- **Tests fail**: Try different version; check CI logs
293+
- **Large dependency updates**: Some packages update many transitive deps; may break old branches; check Go/K8s compatibility
272294
- **make unit "no route to host"**: User must run `sudo systemctl restart docker` (agent can't use sudo)

0 commit comments

Comments
 (0)