Skip to content

Commit d6b2054

Browse files
authored
Merge pull request #80 from sonukapoor/feature/issue-77-readme-offline-support
[Enhancement] Make offline advisory DB support prominent in the README
2 parents 38d101f + faef41a commit d6b2054

1 file changed

Lines changed: 130 additions & 9 deletions

File tree

README.md

Lines changed: 130 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,29 @@
2727

2828
**CVE Lite CLI** helps developers scan their projects for known package vulnerabilities without signing up for an expensive platform. It is built for the moment right before release, when you want a clear answer, a practical fix plan, and a tool you can actually afford to use.
2929

30+
## New: Offline advisory DB support
31+
32+
CVE Lite CLI now supports a local advisory database workflow for teams that cannot allow runtime outbound advisory API calls.
33+
34+
That means you can:
35+
36+
- sync advisory data ahead of time
37+
- scan projects fully offline
38+
- use the tool in restricted, enterprise, or air-gapped environments more easily
39+
40+
Example offline workflow:
41+
42+
```bash
43+
# Build the local advisory database
44+
cve-lite advisories sync
45+
46+
# Scan using the default local advisory DB
47+
cve-lite /path/to/project --offline
48+
49+
# Or scan using a specific local advisory DB file
50+
cve-lite /path/to/project --offline-db /path/to/advisories.db
51+
```
52+
3053
## Quick start
3154

3255
Install globally:
@@ -74,6 +97,15 @@ cve-lite /path/to/project --sarif --output reports/scan.sarif
7497

7598
# Use a custom advisory endpoint
7699
cve-lite /path/to/project --osv-url https://security.company.internal/osv
100+
101+
# Build the local advisory DB for offline scans
102+
cve-lite advisories sync
103+
104+
# Scan with zero runtime advisory API calls
105+
cve-lite /path/to/project --offline
106+
107+
# Use a specific local advisory DB file
108+
cve-lite /path/to/project --offline-db /path/to/advisories.db
77109
```
78110

79111
## What it looks like
@@ -145,6 +177,7 @@ The project emphasizes:
145177
- direct vs transitive visibility
146178
- top-priority fixes and a suggested remediation plan
147179
- JSON and SARIF output for automation
180+
- offline scanning through a local advisory database
148181
- configurable advisory endpoint support via `--osv-url` for internal proxies or mirrors
149182
- a small, reviewable runtime footprint
150183

@@ -166,19 +199,73 @@ This section is here to make the scope clear. CVE Lite CLI aims to complement th
166199

167200
## Network behavior and privacy
168201

169-
CVE Lite CLI is a local-first scanner. It parses dependency information locally, uses local caching to reduce repeated lookups, and in standard mode queries OSV for advisory data needed for matching.
202+
CVE Lite CLI is a local-first scanner. It parses dependency information locally, uses local caching to reduce repeated lookups, and in standard mode queries OSV for advisory data needed for matching. It also now supports a local advisory database workflow for offline scans with zero runtime advisory API calls.
170203

171204
It does not require a hosted account, cloud dashboard, or source code upload.
172205

173206
For the full explanation, see [Network Behavior and Privacy](https://github.com/sonukapoor/cve-lite-cli/blob/main/src/docs/network-and-privacy.md).
174207

175-
### Planned support for stricter environments
208+
### Offline workflow
209+
210+
For teams in controlled or restricted environments, the intended model is:
211+
212+
1. sync advisory data into a local database
213+
2. distribute that database as needed
214+
3. scan projects using the local DB instead of runtime OSV API calls
215+
216+
Sync the local advisory database:
217+
218+
```bash
219+
cve-lite advisories sync
220+
```
221+
222+
Write the advisory database to a specific path:
223+
224+
```bash
225+
cve-lite advisories sync --output /path/to/advisories.db
226+
```
227+
228+
Scan using the default local advisory DB:
229+
230+
```bash
231+
cve-lite . --offline
232+
```
233+
234+
Scan using an explicit local advisory DB file:
176235

177-
Support for stricter network-controlled environments is planned on the roadmap, including:
236+
```bash
237+
cve-lite . --offline-db /path/to/advisories.db
238+
```
239+
240+
Keep the local advisory DB fresh with a scheduled job when needed. For example, teams can run a cron job, CI job, or other scheduler to refresh the advisory DB periodically:
241+
242+
```bash
243+
cve-lite advisories sync --output /path/to/advisories.db
244+
```
245+
246+
That helps ensure offline scans continue using current advisory data without requiring developers to remember to refresh the DB manually every time.
247+
248+
Standard online mode remains available when you want live OSV-backed scans:
249+
250+
```bash
251+
cve-lite . --osv-url https://security.company.internal/osv
252+
```
253+
254+
### Advisory DB freshness
255+
256+
The local advisory DB is only as current as the last successful sync.
257+
258+
For now, the recommended model is:
178259

179-
- offline scanning mode with zero outbound calls
180-
- custom advisory endpoint support for internal mirrors or proxies
181-
- local advisory database input for controlled or air-gapped workflows
260+
- sync the advisory DB on a schedule using cron, CI, or another automation system
261+
- distribute the refreshed DB where needed
262+
- run offline scans against that updated DB
263+
264+
A future improvement is to add built-in advisory DB freshness metadata, such as:
265+
266+
- last sync timestamp reporting
267+
- a TTL-style warning when the DB is older than a recommended threshold
268+
- clearer CLI guidance when a local advisory DB should be refreshed
182269

183270
## Detecting malicious package incidents
184271

@@ -209,6 +296,7 @@ CVE Lite CLI is designed as a **local-first, metadata-only** scanner. Unlike tra
209296
* **Lockfile-Driven Accuracy:** By parsing `package-lock.json`, `pnpm-lock.yaml`, or `yarn.lock`, the tool avoids the "it works on my machine" discrepancy. It scans the *exact* dependency tree that will be deployed.
210297
* **Intelligent Triage:** The Analysis engine utilizes the lockfile's graph structure to distinguish between dependencies you manage directly and those brought in by third-party packages (transitive). This allows for a "Fix the Root" strategy rather than chasing individual nested vulnerabilities.
211298
* **Performance Optimization:** A local TTL (Time-To-Live) cache stores advisory results. This ensures that subsequent scans—common in iterative development or CI/CD retry loops—are near-instant and respect external API rate limits.
299+
* **Offline-Capable Advisory Flow:** Advisory data can be synced into a local SQLite database and reused for offline scans with zero runtime advisory API calls.
212300
* **Standards-Based Output:** Results are natively available in **SARIF (Static Analysis Results Interchange Format)** and **JSON**, ensuring compatibility with modern DevSecOps dashboards and IDE integrations.
213301

214302
## What makes it stand out
@@ -225,6 +313,8 @@ CVE Lite CLI is designed as a **local-first, metadata-only** scanner. Unlike tra
225313
It is intended for developers and teams who want useful security checks without paying for a large commercial product.
226314
- **local-first**
227315
It reads your project locally and uses package/version matching against OSV advisories.
316+
- **offline-capable**
317+
It can sync and scan against a local advisory database for zero-runtime-network workflows.
228318
- **release-focused**
229319
It is especially useful before a release, in CI, or during final dependency cleanup.
230320

@@ -289,15 +379,26 @@ cve-lite /path/to/project --sarif --output reports/scan.sarif
289379

290380
The CLI can be used in CI/CD pipelines and can fail builds based on severity thresholds.
291381

292-
### 9. Local cache
382+
### 9. Offline advisory DB support
383+
384+
The CLI can sync the official OSV npm advisory dump into a local SQLite advisory database and scan against it later with zero runtime advisory API calls.
385+
386+
That makes it more practical for:
387+
388+
- enterprise environments
389+
- restricted CI systems
390+
- air-gapped workflows
391+
- teams that want explicit local advisory control
392+
393+
### 10. Local cache
293394

294395
It caches advisory detail results locally so repeated scans are faster and make fewer repeated requests.
295396

296-
### 10. Clear final scan status
397+
### 11. Clear final scan status
297398

298399
At the end of each run, CVE Lite CLI prints a short final status line so users immediately know whether the scan was clean or whether they should start with the priority fixes above.
299400

300-
### 11. Small runtime footprint
401+
### 12. Small runtime footprint
301402

302403
This project intentionally keeps runtime dependencies minimal to reduce attack surface and keep the tool easier to review.
303404

@@ -308,6 +409,8 @@ CVE Lite CLI is intentionally designed with a very small dependency surface.
308409
**Runtime dependencies**
309410
- `yaml`
310411
- `yarn-lockfile`
412+
- `better-sqlite3`
413+
- `fflate`
311414

312415
**Development dependencies**
313416
- `@types/node`
@@ -326,13 +429,21 @@ CVE Lite CLI is a good fit for:
326429
- teams that want a lightweight dependency scan in CI
327430
- developers who want a second opinion alongside other tools
328431
- OSS maintainers who need a practical scan before publishing
432+
- teams that need offline or controlled-network dependency scanning
329433

330434
## Supported workflows
331435

332436
### Local development
333437

334438
Run it before a release, during dependency cleanup, or after a major package upgrade.
335439

440+
For offline-capable local workflows:
441+
442+
```bash
443+
cve-lite advisories sync
444+
cve-lite . --offline
445+
```
446+
336447
### CI/CD
337448

338449
This repository also uses CVE Lite CLI in its own GitHub Actions workflow to scan itself as part of CI. See [`self-scan.yml`](https://github.com/sonukapoor/cve-lite-cli/blob/main/.github/workflows/self-scan.yml).
@@ -359,6 +470,13 @@ Use JSON output for custom reporting:
359470
cve-lite . --json > cve-lite-report.json
360471
```
361472

473+
Use an offline local advisory DB in controlled environments:
474+
475+
```bash
476+
cve-lite advisories sync --output ./.cache/advisories.db
477+
cve-lite . --offline-db ./.cache/advisories.db --json > cve-lite-report.json
478+
```
479+
362480
## Comparison with other tools
363481

364482
CVE Lite CLI is not trying to be everything for everyone. It is designed to be one of the easiest and most actionable vulnerability scanners for JavaScript and TypeScript developers who want fast release-time checks without the cost and complexity of a full security platform.
@@ -376,6 +494,7 @@ Compared with other tools in this space, CVE Lite CLI focuses on:
376494
- support for **npm**, **pnpm**, and **Yarn** lockfiles
377495
- **SARIF** and **JSON** output for CI and automation
378496
- a **lightweight**, **security-conscious** dependency footprint
497+
- **offline local advisory DB support** for controlled environments
379498
- a **developer-friendly** option for teams that want useful **CVE scanning without paying for a larger commercial product**
380499

381500
### At a glance
@@ -451,6 +570,7 @@ To keep the project honest, here is what it does **not** do in the current versi
451570
- it does not scan container images, binaries, secrets, or IaC
452571
- it does not replace a full application security program
453572
- it is currently focused on JS/TS dependency scanning
573+
- local advisory sync performance will need continued optimization as the advisory dataset grows
454574

455575
## Positioning
456576

@@ -471,6 +591,7 @@ CVE Lite CLI is evolving from a vulnerability scanner into a comprehensive remed
471591
* **Official GitHub Action:** Create a dedicated Action for one-line setup in CI/CD pipelines.
472592
* **Expanded Lockfile Support:** Introduce parsers for emerging JS/TS ecosystems, including `bun.lockb`.
473593
* **IDE Integration:** Develop a lightweight extension to highlight vulnerable packages directly within the code editor.
594+
* **Workflow Integration Guidance:** Expand official workflow patterns for local scripts, hooks, CI, and offline developer adoption.
474595

475596
### Phase 3: Maturity & Compliance (Long-Term)
476597
* **Standardized SBOM Support:** Add the ability to export findings as an **SBOM (Software Bill of Materials)** in CycloneDX or SPDX formats.

0 commit comments

Comments
 (0)