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
{{ message }}
Repository navigation
Create rust implementation of the scan result enrichment with library and cli #28
I reviewed this and I think the right plan is to optimize for streaming + selective lookup first, then add a persistent cache only if benchmarks show repeated feed scans are still too expensive.
Recommended implementation plan
1) Rust library first, CLI on top, Python calls the CLI as a subprocess
I would make the Rust crate the source of truth and keep the Python integration thin at first:
scan_enrichment_core (library)
scan-enrich-results (CLI)
optional Python bindings later if subprocess overhead actually matters
That keeps the boundary simple and avoids dragging PyO3/maturin complexity into the first version.
2) Use a two-pass streaming pipeline for very large result sets
For 500k+ results, we should avoid loading the full scan-results JSON into memory.
Recommended CLI flow:
Pass 1: stream the input results JSON and collect only the unique OIDs into a HashSet<String>
scan vt-metadata.json and Notus .notus files and build a matched-only in-memory map for just those OIDs
Pass 2: stream the results again and write enriched JSON incrementally
Why this is a good default:
memory scales with unique OIDs, not total result count
output can be written incrementally with a buffered writer
we avoid holding 500k enriched result objects in RAM
for many real scans, repeated OIDs should be far smaller than result count
Metadata mapping strategy
Default path: selective in-memory map
For one-shot runs, I would not build a full in-memory index of all metadata by default.
Instead:
parse the result set once to find the required OIDs
scan vt-metadata.json sequentially and keep only entries whose OIDs are in the requested set
scan Notus advisory files and keep only advisory entries whose OIDs are in the requested set
This should drastically reduce memory usage versus loading all NASL metadata and all Notus metadata up front.
Persistent cache path: add an embedded DB only for repeated runs
If we expect repeated enrichment runs against the same feed data, then a persistent local cache makes sense.
My recommendation would be:
SQLite first, not RocksDB/sled/LMDB on day 1
Reasoning:
embedded, no service to run
mature and boring in the good way
simple key/value access by OID is easy
straightforward cache invalidation and feed-version tracking
easier to inspect/debug than a custom binary index format
Activity
clawosiris commentedon May 14, 2026
I reviewed this and I think the right plan is to optimize for streaming + selective lookup first, then add a persistent cache only if benchmarks show repeated feed scans are still too expensive.
Recommended implementation plan
1) Rust library first, CLI on top, Python calls the CLI as a subprocess
I would make the Rust crate the source of truth and keep the Python integration thin at first:
scan_enrichment_core(library)scan-enrich-results(CLI)That keeps the boundary simple and avoids dragging PyO3/maturin complexity into the first version.
2) Use a two-pass streaming pipeline for very large result sets
For 500k+ results, we should avoid loading the full scan-results JSON into memory.
Recommended CLI flow:
HashSet<String>vt-metadata.jsonand Notus.notusfiles and build a matched-only in-memory map for just those OIDsWhy this is a good default:
Metadata mapping strategy
Default path: selective in-memory map
For one-shot runs, I would not build a full in-memory index of all metadata by default.
Instead:
vt-metadata.jsonsequentially and keep only entries whose OIDs are in the requested setThis should drastically reduce memory usage versus loading all NASL metadata and all Notus metadata up front.
Persistent cache path: add an embedded DB only for repeated runs
If we expect repeated enrichment runs against the same feed data, then a persistent local cache makes sense.
My recommendation would be:
Reasoning:
Suggested schema idea:
metadata(oid TEXT, source TEXT, feed_version TEXT, payload_json BLOB, PRIMARY KEY (oid, source, feed_version))source = 'vt' | 'notus'feed_versionderived from feed fingerprint / sha256sums / mtime+size digestThen the enrichment flow becomes:
Memory usage guidance
Things to avoid
Vec<Value>vt-metadata.jsoninto a giantHashMapunless we actually need most of itThings to do
serde_json::Deserializerfor streaming inputBufWriterValue, where practicalPractical phased plan
Phase 1: working Rust CLI + library
Phase 2: benchmark and profile
Measure:
Phase 3: add optional persistent cache if needed
If feed rescans dominate repeated runs:
--cache-dir/ default cache pathMy bias on the DB question
I would not start with embedded NoSQL.
For this use case, the priority is:
That usually points to:
Acceptance criteria I’d add
vt-metadata.jsonand Notus.notusadvisory enrichmentIf helpful, I can turn this into a concrete task breakdown (crate layout, interfaces, benchmark harness, cache schema, and CLI contract).
docs(openspec): specify rust result enrichment (#35)
clawosiris commentedon May 14, 2026
Updated the issue description to reflect what PR #36 actually implemented: Rust library/CLI + Python subprocess integration + default Rust path + parity tests. Also documented the remaining gap: selective feed lookup landed, but full streaming / large-input benchmarking did not.
docs: sync issue 28 spec with shipped behavior (#38)
clawosiris commentedon May 14, 2026
Reviewed again after the follow-up workflow/doc merges (including PR #40).
Conclusion: leave this issue open.
The Rust library/CLI, Python subprocess integration, default Rust path, Notus support, SCAP expansion, parity tests, and CI coverage are all in place.
However, the remaining gap documented in the issue still stands:
So this is substantially implemented, but not fully done relative to the original large-scale streaming requirement.
feat: add scalable enrichment benchmark path (#41)