Skip to content

Commit ea181fa

Browse files
authored
docs: add ratcheting mode section to how-remediation-works (#600)
* docs: add ratcheting mode section to how-remediation-works Closes #599 * docs: move ratcheting to dedicated page and add to sidebar
1 parent de0f760 commit ea181fa

3 files changed

Lines changed: 99 additions & 1 deletion

File tree

website/docs/how-remediation-works.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ cve-lite . # confirm the finding is resolved
630630

631631
## See also
632632

633+
- [Ratcheting Mode](ratcheting) — adopt CVE Lite CLI as a hard CI gate on codebases with existing vulnerability debt
633634
- [Remediation Strategy](remediation-strategy) — deeper technical detail on parser behaviour, confidence levels, and edge cases
634635
- [Offline Advisory DB](offline-advisory-db.md) — how to sync and use the local database
635-
- [CLI Reference](cli-reference.md) — full flag documentation including `--verbose`, `--fix`, and `--fail-on`
636+
- [CLI Reference](cli-reference.md) — full flag documentation including `--verbose`, `--fix`, `--fail-on`, and `--ratchet`

website/docs/ratcheting.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
title: Ratcheting Mode
3+
description: Use ratcheting to adopt CVE Lite CLI as a hard CI gate on codebases with existing vulnerability debt.
4+
---
5+
6+
# Ratcheting Mode
7+
8+
When adopting CVE Lite CLI as a hard CI gate on a codebase that already has vulnerabilities, `--fail-on` will block every PR until all pre-existing issues are resolved. That is rarely realistic on a production codebase.
9+
10+
Ratcheting lets you accept the current state and only fail on findings introduced above that baseline. Existing vulnerabilities are tracked but do not block - they get cleaned up gradually. Once you fix one, the baseline drops and can never go back up.
11+
12+
---
13+
14+
## Setup
15+
16+
Run once locally to snapshot the current findings:
17+
18+
```bash
19+
cve-lite . --ratchet
20+
```
21+
22+
This creates `.cve-lite/baseline.json` in your project root and exits 0. Commit the file so your whole team and CI share the same baseline.
23+
24+
```bash
25+
git add .cve-lite/baseline.json
26+
git commit -m "chore: establish vulnerability baseline"
27+
```
28+
29+
---
30+
31+
## How it works in CI
32+
33+
No flag changes needed. Once the baseline file exists, every scan automatically suppresses known findings:
34+
35+
```bash
36+
cve-lite . --fail-on high
37+
```
38+
39+
Pre-existing findings are hidden. Only new findings - things introduced above the baseline - trigger failure. Your existing CI commands work exactly as before.
40+
41+
---
42+
43+
## Output
44+
45+
When all findings are suppressed:
46+
47+
```
48+
✓ Scan complete. No known vulnerabilities found.
49+
50+
No new findings above baseline - 7 existing findings suppressed
51+
```
52+
53+
When new findings appear:
54+
55+
```
56+
3 new findings above baseline - 7 existing findings suppressed
57+
```
58+
59+
---
60+
61+
## Updating the baseline
62+
63+
After fixing some vulnerabilities, reset the baseline by running `--ratchet` again:
64+
65+
```bash
66+
cve-lite . --ratchet
67+
git add .cve-lite/baseline.json
68+
git commit -m "chore: update vulnerability baseline"
69+
```
70+
71+
Because the baseline is committed to git, every update is tracked and reversible.
72+
73+
---
74+
75+
## Ignoring the baseline
76+
77+
To run a full scan without suppression, delete or rename `.cve-lite/baseline.json`. No flag needed. The file's presence is what activates ratcheting.
78+
79+
---
80+
81+
## How matching works
82+
83+
A finding is suppressed if every advisory ID on that `name@version` combination was present when the baseline was saved. If a package gains a new advisory ID not in the baseline, that finding surfaces as new - even if the package version itself was already baselined.
84+
85+
This means:
86+
- Same package, same version, same advisory - suppressed
87+
- Same package, same version, new advisory - surfaces as new
88+
- New package not in baseline at all - surfaces as new
89+
90+
---
91+
92+
## See also
93+
94+
- [Workflow Integration](workflow-integration) - pre-commit hooks and GitHub Actions setup
95+
- [How Remediation Works](how-remediation-works) - how fix commands are generated
96+
- [CLI Reference](cli-reference) - full flag documentation

website/sidebars.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const sidebars: SidebarsConfig = {
3030
collapsed: true,
3131
items: [
3232
'workflow-integration',
33+
'ratcheting',
3334
'ai-assistant-integration',
3435
'sarif',
3536
'cyclonedx',

0 commit comments

Comments
 (0)