Skip to content

Commit f394788

Browse files
authored
Merge pull request #90 from sonukapoor/feature/issue-75-workflow-integration-guidance
[Docs] Add developer workflow integration guidance
2 parents e1f2c9a + 3b51eba commit f394788

2 files changed

Lines changed: 105 additions & 18 deletions

File tree

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,86 @@ cve-lite advisories sync --output ./.cache/advisories.db
530530
cve-lite . --offline-db ./.cache/advisories.db --json > cve-lite-report.json
531531
```
532532

533+
## Recommended workflow patterns
534+
535+
CVE Lite CLI is most useful when teams make it part of an explicit workflow instead of relying on developers to remember a one-off command.
536+
537+
The recommended pattern is:
538+
539+
1. choose a scan command that matches your environment
540+
2. wire it into scripts, hooks, CI, or scheduled refresh jobs
541+
3. keep the behavior explicit so developers and security reviewers can see exactly when scans run and whether network access is involved
542+
543+
### Package scripts
544+
545+
Add a simple script to the consuming project so developers have a memorable command:
546+
547+
```json
548+
{
549+
"scripts": {
550+
"security:scan": "cve-lite .",
551+
"security:scan:offline": "cve-lite . --offline"
552+
}
553+
}
554+
```
555+
556+
This is the best default for most teams because it is visible, easy to document, and easy to reuse in local development and CI.
557+
558+
### Opt-in postinstall usage
559+
560+
Some teams want dependency scanning to run immediately after packages are installed. CVE Lite CLI supports that workflow, but it is recommended as an explicit opt-in in the consuming project rather than hidden default behavior in the tool itself.
561+
562+
For example:
563+
564+
```json
565+
{
566+
"scripts": {
567+
"postinstall": "cve-lite . --offline || true"
568+
}
569+
}
570+
```
571+
572+
Why this is opt-in:
573+
574+
- install hooks should be visible to the team using them
575+
- controlled environments often prefer offline scanning for install-time checks
576+
- explicit project scripts are easier to review, tune, and disable than implicit package behavior
577+
578+
### Git hooks
579+
580+
For teams that want a lightweight local gate before code leaves a workstation, a git hook can be a good fit:
581+
582+
```bash
583+
cve-lite . --fail-on high
584+
```
585+
586+
This works well in `pre-push` or another team-approved hook if you want to catch high-severity dependency issues before changes are shared.
587+
588+
### CI pipelines
589+
590+
For CI, a strong baseline is:
591+
592+
```bash
593+
cve-lite . --verbose --fail-on high
594+
```
595+
596+
For controlled or restricted environments, sync the advisory DB separately and then scan offline:
597+
598+
```bash
599+
cve-lite advisories sync --output ./.cache/advisories.db
600+
cve-lite . --offline-db ./.cache/advisories.db --verbose --fail-on high
601+
```
602+
603+
### Scheduled advisory DB refresh
604+
605+
If you use offline mode, keep the advisory DB fresh with a scheduler such as cron, CI, or an internal automation system:
606+
607+
```bash
608+
cve-lite advisories sync --output /path/to/advisories.db
609+
```
610+
611+
This keeps offline scans current without forcing every developer machine or build runner to make live advisory API calls during the scan itself.
612+
533613
## Comparison with other tools
534614

535615
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.

src/docs/network-and-privacy.md

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Network Behavior and Privacy
22

3-
CVE Lite CLI is a local-first dependency vulnerability scanner for JavaScript and TypeScript projects. This document explains what it does locally, when it makes external calls, and how support for stricter environments is planned.
3+
CVE Lite CLI is a local-first dependency vulnerability scanner for JavaScript and TypeScript projects. This document explains what it does locally, when it makes external calls, and how it supports stricter environments today.
44

55
## Overview
66

@@ -56,38 +56,45 @@ Some teams, especially in enterprise, regulated, or restricted CI environments,
5656

5757
This document exists to make that behavior explicit and reviewable.
5858

59-
## Planned support for stricter environments
59+
## Support for stricter environments
6060

61-
CVE Lite CLI is being extended to better support environments with stricter network controls.
62-
63-
Planned capabilities include:
61+
CVE Lite CLI already supports multiple patterns for teams with stricter network controls.
6462

6563
### Offline mode
6664

67-
A future offline mode is intended to allow scans with zero outbound network calls, using only locally available advisory data or cache content.
65+
Offline scans can run with zero outbound advisory API calls by using a local advisory database.
66+
67+
Example workflow:
68+
69+
cve-lite advisories sync
70+
cve-lite . --offline
6871

69-
Example target workflow:
72+
Or with an explicit DB path:
7073

71-
cve-lite scan --offline
74+
cve-lite advisories sync --output /path/to/advisories.db
75+
cve-lite . --offline-db /path/to/advisories.db
7276

7377
### Custom advisory endpoint support
7478

75-
A future custom endpoint option is intended to allow organizations to route advisory lookups through an internal proxy or mirrored service.
79+
Organizations can route standard online advisory lookups through an internal proxy or mirrored service with `--osv-url`.
7680

77-
Example target workflow:
81+
Example workflow:
7882

79-
cve-lite scan --osv-url https://security.company.internal/osv
83+
cve-lite . --osv-url https://security.company.internal/osv
8084

81-
### Local advisory database input
85+
### Advisory DB freshness
8286

83-
A future local advisory database option is intended to support controlled environments where advisory data is supplied from an approved internal source.
87+
Offline scans report advisory DB freshness and warn when the local DB appears stale or is missing sync metadata.
8488

85-
Example target workflow:
89+
This makes the tradeoff explicit:
8690

87-
cve-lite scan --advisory-db ./internal-advisories.json
91+
- offline scans avoid runtime advisory API calls
92+
- advisory data is only as current as the last successful sync
8893

89-
## Roadmap note
94+
### Operational model
9095

91-
These stricter execution modes are planned so teams can adopt CVE Lite CLI even when direct outbound access to public services is limited or disallowed.
96+
For many teams, the recommended model is:
9297

93-
The goal is to preserve the same local-first developer experience while giving security-conscious organizations clearer deployment options.
98+
- sync advisory data on a schedule from a connected environment
99+
- distribute the local advisory DB where needed
100+
- run offline scans in controlled developer, CI, or restricted-network environments

0 commit comments

Comments
 (0)