You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,9 +30,9 @@ Network scanning has a fallback chain in `bitprobe/scanner/engines/network/__ini
30
30
31
31
## Data
32
32
33
-
- CVE data: `bitprobe/scanner/data/cve_db.sqlite` (primary) with `cve_db.json`as fallback/legacy (`cve_db.py`, `cve_db_manager.py`, `cve_updater.py`). Refresh via `bitprobe update-cve-db` (NVD API key recommended, see README).
33
+
- CVE data: `~/.bitsentry/data/cve_db.sqlite` (override with `BITSENTRY_DATA_DIR`), with the source-tree database used only as a one-time legacy migration source. Refresh via `bitsentry update-cve-db`; the default path installs a verified release snapshot before incremental NVD catch-up.
34
34
- ASN/IP intel DB: `asn_db_updater.py`, refreshed via `bitsentry update-db`.
35
-
- Neither DB is checked into git (`bitprobe/data/cve_db.sqlite` is gitignored — a prior commit removed a large SQLite file from the repo for this reason).
35
+
- Neither generated database is checked into git. Published CVE snapshots live in reserved `cve-db-*` GitHub Releases.
bitsentry update-cve-db #snapshot if needed, otherwise incremental sync
78
73
```
79
74
80
-
If you skip CVE bootstrap, the first scan may still run but will only auto-fetch a **short recent-publication window**—not enough for historical product/CVE exposure. See [CVE database](#cve-database)below for details.
75
+
If you skip this step, the first scan uses the same snapshot bootstrap automatically. See [CVE database](#cve-database) for direct-NVD and offline fallback behavior.
81
76
82
77
### Option 2: manual setup
83
78
@@ -88,8 +83,7 @@ pip install -r requirements.txt
88
83
89
84
# Same post-install DB steps as Option 1 (use python bitsentry.py if bitsentry is not on PATH)
BitProbe stores CVEs in a local SQLite database (`bitprobe/data/cve_db.sqlite`) and matches them **by detected product and version** during scans—not by “CVEs published in the last N days.”
156
+
BitProbe stores mutable CVE data in `~/.bitsentry/data/cve_db.sqlite` and matches CVEs by detected product and version. Set `BITSENTRY_DATA_DIR` to use a different data directory.
163
157
164
158
| Phase | What happens |
165
159
|---|---|
166
-
|**Bootstrap**|Populates the local DB (one-time or after a wipe)|
160
+
|**Bootstrap**|Downloads and verifies the published full-corpus snapshot|
167
161
|**Incremental sync**| Fetches only NVD records modified since the last cursor (fast) |
168
162
|**Scan**| Fingerprints the target, then queries the DB for that product/CPE |
169
163
170
-
A short publication window (for example `--days 30`) only controls **what gets downloaded into the DB**. It does not limit scan logic. For real exposure coverage, bootstrap with a full or multi-year mirror first, then rely on incremental updates.
171
-
172
-
**Recommended first-time setup:**
164
+
The default command installs a verified snapshot when the database is missing or incomplete, then fetches changes made after the snapshot cursor:
173
165
174
166
```bash
175
-
# Optional but strongly recommended (higher NVD rate limits)
176
-
export NVD_API_KEY="your-nvd-api-key"
177
-
178
-
# One-time: build a complete local mirror (slow; ~350k CVEs)
179
-
python bitsentry.py update-cve-db --full
180
-
181
-
# Alternative: compromise bootstrap (~15 years of publications)
182
-
python bitsentry.py update-cve-db --years 15
183
-
184
-
# Ongoing refresh (incremental when a sync cursor exists)
185
167
python bitsentry.py update-cve-db
186
168
187
-
# Inspect local store
169
+
# Install the snapshot without an incremental NVD catch-up
170
+
python bitsentry.py update-cve-db --snapshot-only
171
+
172
+
# Inspect local coverage and counts
188
173
python bitsentry.py cve-stats
189
174
```
190
175
191
-
**Other options:**
176
+
Direct-NVD modes skip the snapshot. BitSentry splits long NVD date ranges into 119-day windows:
192
177
193
178
```bash
194
-
# Quick bootstrap only (~recent publications; not sufficient alone for deep history)
179
+
# Rebuild the complete corpus directly from NVD
180
+
python bitsentry.py update-cve-db --full
181
+
182
+
# Raw unfiltered crawl (best-effort offset resumption)
183
+
python bitsentry.py update-cve-db --raw-full
184
+
185
+
# Build partial publication-window databases
195
186
python bitsentry.py update-cve-db --days 30
187
+
python bitsentry.py update-cve-db --years 15
188
+
189
+
# Synchronize directly without downloading a snapshot
190
+
python bitsentry.py update-cve-db --no-snapshot
196
191
197
192
# Skip automatic CVE refresh at scan startup
198
193
export BITSENTRY_SKIP_CVE_UPDATE=1
199
194
```
200
195
201
-
On scan startup, if the DB is empty, BitProbe may run a **7-day publication bootstrap** so the tool stays usable without blocking on a full NVD download. Run `update-cve-db --full` or `--years 15` before relying on CVE findings in production assessments.
196
+
Set `NVD_API_KEY` for the higher NVD request limit. Interrupted windowed updates resume from the last committed page. BitSentry checksum-verifies snapshots and installs them atomically. If the snapshot is unavailable on an empty installation, it falls back to a 30-day publication database and warns that coverage is partial.
202
197
203
-
Direct product commands are also available via `python bitprobe/bitprobe.py ...`(same flags: `--full`, `--years`, `--days`).
198
+
Direct product commands are also available via `python bitprobe/bitprobe.py ...`with the same flags.
0 commit comments