π Logo and cover by our beloved medhi bouchard β€οΈ
Hello π,
Back for a little article about the rebranding of one of the NodeSecure tools: Vulnera (previously vuln, the vuln-era has begun!).
An opportunity for me to also write about this wonderful project that was born with the redesign of the back-end less than a year ago β. If you don't remember I wrote an article:
π’ Feel free to push new sources (we have a guide on how to add/contribute one).
The code was originally designed for vulnerability management within the Scanner. Yet, its API is evolving with the objective of making it a full-fledged project.
We have created a standard format to reconcile the different sources.
exportinterfaceStandardVulnerability{/** Unique identifier for the vulnerability **/id?:string;/** Vulnerability origin, either Snyk, NPM or NodeSWG **/origin:Origin;/** Package associated with the vulnerability **/package:string;/** Vulnerability title **/title:string;/** Vulnerability description **/description?:string;/** Vulnerability link references on origin's website **/url?:string;/** Vulnerability severity levels given the strategy **/severity?:Severity;/** Common Vulnerabilities and Exposures dictionary */cves?:string[];/** Common Vulnerability Scoring System (CVSS) **/cvssVector?:string;/** CVSS Score **/cvssScore?:number;/** The range of vulnerable versions */vulnerableRanges:string[];/** The set of versions that are vulnerable **/vulnerableVersions:string[];/** The set of versions that are patched **/patchedVersions?:string;/** Overview of available patches **/patches?:Patch[];}
You can always use the original formats of each source of course π. We have implemented and exposed TypeScript interfaces for each of them.
Usage in Scanner π¬
On the scanner we have all the necessary information because we go through the dependency tree π. At the end of the process, we recover all vulnerabilities by iterating spec by spec within the hydratePayloadDependencies strategy method.
const{hydratePayloadDependencies,strategy}=awaitvulnera.setStrategy(userStrategyName// SNYK for example);awaithydratePayloadDependencies(dependencies,{useStandardFormat:true,path:location});payload.vulnerabilityStrategy=strategy;
The following diagram explains the overall behavior and interactions between the Scanner and Vulnera.
If you want to learn more about the Payload you can check the TypeScript interface here.
What's next ? π
Some sources are more difficult to exploit than others (for NPM we use Arborist which simplifies our lives).
Fetch vulnerabilities of a given remote package (with support for private registry like verdaccio). At the moment we only support the analysis of a local manifest or a payload of the scanner.
Credits π
This project owes much to our core collaborator Antoine COULON who invested a lot of energy to improve it πͺ.
Fun fact:its first contribution π€ on NodeSecure was also on the old version of the code Scanner that managed vulnerabilities.
Programmatically fetch security vulnerabilities with one or many strategies (NPM Audit, Sonatype, Snyk, Node.js DB).
The vuln-era has begun! Programmatically fetch security vulnerabilities with one or many strategies. Originally designed to run and analyze Scanner dependencies it now also runs independently from an npm Manifest.