<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: NodeSecure</title>
    <description>The latest articles on DEV Community by NodeSecure (@nodesecure).</description>
    <link>https://dev.to/nodesecure</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F6062%2F43c0ffd0-bc13-4c49-8846-ce3efbdafd52.png</url>
      <title>DEV Community: NodeSecure</title>
      <link>https://dev.to/nodesecure</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nodesecure"/>
    <language>en</language>
    <item>
      <title>NodeSecure hidden capability: mama</title>
      <dc:creator>Thomas.G</dc:creator>
      <pubDate>Sat, 10 Jan 2026 07:12:29 +0000</pubDate>
      <link>https://dev.to/nodesecure/nodesecure-hidden-capability-mama-2mn2</link>
      <guid>https://dev.to/nodesecure/nodesecure-hidden-capability-mama-2mn2</guid>
      <description>&lt;p&gt;Hello 👋&lt;/p&gt;

&lt;p&gt;I'm starting a new &lt;strong&gt;short&lt;/strong&gt;-article series focused on highlighting lesser-known parts of the &lt;a href="https://github.com/NodeSecure" rel="noopener noreferrer"&gt;NodeSecure&lt;/a&gt; project. The goal is to help new contributors by giving them a clearer view of the back-end building blocks that power the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Chapter 1: mama
&lt;/h2&gt;

&lt;p&gt;Mama stand for &lt;code&gt;ManifestManager&lt;/code&gt;. This package was designed to manage and load an npm manifest (a &lt;code&gt;package.json&lt;/code&gt; file, for simplicity).&lt;/p&gt;

&lt;p&gt;Under the hood, it uses &lt;code&gt;@nodesecure/npm-types&lt;/code&gt; to provide precise, up-to-date types (including runtime-related fields). We will dive into that package in another article.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ManifestManager&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@nodesecure/mama&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// synchronous version: ManifestManager.fromPackageJSONSync&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mama&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;ManifestManager&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fromPackageJSON&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cwd&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mama&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This package provides many utilities used across back-end components in the Scanner monorepo.&lt;/p&gt;

&lt;p&gt;Here are a few of them:&lt;/p&gt;

&lt;h3&gt;
  
  
  Integrity
&lt;/h3&gt;

&lt;p&gt;You can easily extract a hash by using the &lt;strong&gt;readonly&lt;/strong&gt; getter &lt;code&gt;integrity&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mama&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;integrity&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Scanner uses this to assert that the &lt;code&gt;package.json&lt;/code&gt; in the tarball matches the one uploaded to the registry (known as &lt;a href="https://blog.vlt.sh/blog/the-massive-hole-in-the-npm-ecosystem" rel="noopener noreferrer"&gt;manifest confusion&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Here are the properties we hash:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  name,
  version,
  dependencies,
  license: license ?? "NONE",
  scripts
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When a mismatch is detected, the tool reports it as a global warning, as shown in the CLI UI:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjhne0n0haij6y2uuu8oa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjhne0n0haij6y2uuu8oa.png" alt="NodeSecure global warnings" width="800" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  module type
&lt;/h3&gt;

&lt;p&gt;Inspired by the recent &lt;a href="https://github.com/antfu/node-modules-inspector/" rel="noopener noreferrer"&gt;node-modules-inspector&lt;/a&gt; tool built by Antfu, we re-implemented the same module type detection:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// "dts" | "faux" | "dual" | "esm" | "cjs"&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mama&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;moduleType&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  entry files
&lt;/h3&gt;

&lt;p&gt;mama can recursively extract entry files using the Node.js &lt;code&gt;exports&lt;/code&gt; field (or legacy fields like &lt;code&gt;main&lt;/code&gt;). The API is lazy and returns an &lt;code&gt;IterableIterator&amp;lt;string&amp;gt;&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;([...&lt;/span&gt;&lt;span class="nx"&gt;mama&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getEntryFiles&lt;/span&gt;&lt;span class="p"&gt;()]);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This API is used in the &lt;em&gt;tarball&lt;/em&gt; package in combination with JS-X-Ray’s EntryFilesAnalyser.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;scanFiles&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ScannedFilesResult&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;location&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;manifest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;composition&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;spdx&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
    &lt;span class="nf"&gt;getTarballComposition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="nx"&gt;conformance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;extractLicenses&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;]);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;SourceCodeScanner&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;manifest&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;iterate&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;manifest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;manifest&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getEntryFiles&lt;/span&gt;&lt;span class="p"&gt;()]&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;flatMap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;filterJavaScriptFiles&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
    &lt;span class="na"&gt;javascript&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;composition&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;files&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;flatMap&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;filterJavaScriptFiles&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;conformance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;spdx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;composition&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;code&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  author
&lt;/h3&gt;

&lt;p&gt;Parse the NPM &lt;code&gt;author&lt;/code&gt; field if present and then return a &lt;code&gt;Contact&lt;/code&gt; interface.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;Contact&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;email&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;url&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example, &lt;code&gt;John Doe &amp;lt;john.doe@gmail.com&amp;gt;&lt;/code&gt; produces the following object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"John Doe"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"john.doe@gmail.com"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Others
&lt;/h3&gt;

&lt;p&gt;The module also provides additional utilities around reading and managing manifests, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Parsing package specs (including scope/org, package name, and semver range)&lt;/li&gt;
&lt;li&gt;Detecting local lockfiles&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The end
&lt;/h2&gt;

&lt;p&gt;The full module documentation is available &lt;a href="https://github.com/NodeSecure/scanner/tree/master/workspaces/mama" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks you for reading&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>security</category>
    </item>
    <item>
      <title>Securizing your GitHub org</title>
      <dc:creator>Thomas.G</dc:creator>
      <pubDate>Sun, 19 Feb 2023 15:48:01 +0000</pubDate>
      <link>https://dev.to/nodesecure/securize-your-github-org-4lb7</link>
      <guid>https://dev.to/nodesecure/securize-your-github-org-4lb7</guid>
      <description>&lt;p&gt;Hello 👋&lt;/p&gt;

&lt;p&gt;I started open source a bit naively (like everyone I guess 😊).&lt;/p&gt;

&lt;p&gt;But the more I progress and the more important/popular some of my projects become 😎. That's great, but at some point you have to &lt;strong&gt;deal&lt;/strong&gt; with a lot of things &lt;strong&gt;related to security&lt;/strong&gt; (like Vulnerability disclosure).&lt;/p&gt;

&lt;p&gt;You start to hear and see a lot of &lt;strong&gt;scary stories&lt;/strong&gt; around you 😱. Not to mention all the &lt;strong&gt;acronyms&lt;/strong&gt; where you don't understand anything at first 😵 (VMT, CVE, SAST, SCA, CNA ...).&lt;/p&gt;

&lt;p&gt;As I was working on an open source security project, I put pressure on myself to be ready. Also as a member of the &lt;a href="https://github.com/nodejs/security-wg" rel="noopener noreferrer"&gt;Node.js Security WG&lt;/a&gt; I thought it was an interesting topic and that I was probably not the only one who was worried about not being up to the task 😖.&lt;/p&gt;

&lt;p&gt;So I rolled up my sleeves and tackled the problem 💪. Here is my feedback/journey on how I improved the security of my &lt;a href="https://github.com/NodeSecure" rel="noopener noreferrer"&gt;NodeSecure&lt;/a&gt; GitHub organization.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👀 We use Node.js and JavaScript (but most recommendations are valid for other ecosystems).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Security Policy and Vulnerability Disclosure
&lt;/h2&gt;

&lt;p&gt;Adding a root &lt;code&gt;SECURITY.md&lt;/code&gt; file explaining how developers and security researchers should report vulnerability is important. You don't want a security threat to &lt;strong&gt;be turned into a public issue&lt;/strong&gt; (This gives you time to analyze and possibly fix &lt;strong&gt;before disclosure&lt;/strong&gt;).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ If you are a developer, never report a security threat using a public GitHub issue. &lt;strong&gt;This is a serious mistake&lt;/strong&gt;. This could even put your business/team at &lt;strong&gt;risk&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I don't want to bullshit you, so let me share with you the &lt;strong&gt;OpenSSF guide&lt;/strong&gt; that helped me set up my first reporting strategy: &lt;a href="https://github.com/ossf/oss-vulnerability-guide/blob/main/maintainer-guide.md" rel="noopener noreferrer"&gt;Guide to implementing a coordinated vulnerability disclosure process for open source projects&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I started from scratch by reading this guide and taking inspiration from &lt;a href="https://github.com/ossf/oss-vulnerability-guide/tree/main/templates" rel="noopener noreferrer"&gt;their templates&lt;/a&gt; 🐤. As a small open source team we don't especially have DNS or mail servers (not even a defined &lt;strong&gt;V&lt;/strong&gt;ulnerability &lt;strong&gt;M&lt;/strong&gt;anagement &lt;strong&gt;T&lt;/strong&gt;eam A.K.A &lt;strong&gt;VMT&lt;/strong&gt;).&lt;/p&gt;

&lt;p&gt;I was a bit puzzled to put my personal email as I'm not alone 😟. &lt;/p&gt;

&lt;p&gt;I quickly learned that Github added a new feature &lt;a href="https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability" rel="noopener noreferrer"&gt;to report/create private security issue&lt;/a&gt; 😍. You can enable it in the &lt;code&gt;Security&lt;/code&gt; tab (I think it's also now possible to enable it on every repositories at once).&lt;/p&gt;

&lt;p&gt;And this is what it finally looks like:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fimqmjdj2ewiiud0bpmbs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fimqmjdj2ewiiud0bpmbs.png" alt="NodeSecure SECURITY.md" width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Use OpenSSF scorecard
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7kdfnqxjora14q8eil20.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7kdfnqxjora14q8eil20.png" alt="scorecard" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://securityscorecards.dev/" rel="noopener noreferrer"&gt;OSSF scorecard&lt;/a&gt; initiative is really good to assess your project against security best practices. &lt;a href="https://devopsjournal.io/blog/2022/12/08/Adding-OSSF-scorecard-action-to-your-repo" rel="noopener noreferrer"&gt;I am not the first to write about this&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can easily setup the GitHub action workflow by following those &lt;a href="https://github.com/ossf/scorecard-action#installation" rel="noopener noreferrer"&gt;instructions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once configured, you will have a set of alerts available in the &lt;code&gt;Security&lt;/code&gt; tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi0tib69edbeitcsoomec.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi0tib69edbeitcsoomec.png" alt="Scorecard scanning alerts" width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will give you an overview of the different subjects to improve (workflows, dependencies etc). Each of these alerts contains a full description of the actions to be taken to fix the problem.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F000q8acla8raunyu8kva.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F000q8acla8raunyu8kva.png" alt="OSSF Scorecard" width="800" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have personally used these recommendations to dig and train myself. The next chapters will help you improve your score.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;📢 By the way &lt;a href="https://github.com/NodeSecure/cli" rel="noopener noreferrer"&gt;NodeSecure CLI&lt;/a&gt; has a first-class support of the scorecard.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  🔓 Enable branch protection
&lt;/h2&gt;

&lt;p&gt;I am a bad student 😳. Almost all of my projects had no branch protection on the &lt;code&gt;main&lt;/code&gt; / &lt;code&gt;master&lt;/code&gt; branch 🙈.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To set up the protection, go to &lt;code&gt;Settings&lt;/code&gt; &amp;gt; &lt;code&gt;Branches&lt;/code&gt; and edit your main branch. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;GitHub has quite a few options on the subject 😵. If you don't know what to choose in terms of options, &lt;strong&gt;don't check anything&lt;/strong&gt; (it's &lt;strong&gt;ok&lt;/strong&gt; to begin ✔️).&lt;/p&gt;

&lt;p&gt;If you want to be more restrictive, be &lt;strong&gt;careful&lt;/strong&gt; because it could block you (some options are only viable in projects with many contributors/reviewers).&lt;/p&gt;

&lt;p&gt;As far as I am concerned I often choose:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Require a pull request before merging&lt;/li&gt;
&lt;li&gt;Require conversation resolution before merging&lt;/li&gt;
&lt;li&gt;Require status checks to pass before merging&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  🐲 Workflows Hardening
&lt;/h2&gt;

&lt;p&gt;I fell down when I saw all that it was necessary to know to secure workflows with GitHub actions 😲.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You must pay attention to the &lt;a href="https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs" rel="noopener noreferrer"&gt;permissions granted to your jobs / GITHUB_TOKEN&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://michaelheap.com/ensure-github-actions-pinned-sha/" rel="noopener noreferrer"&gt;Ensure your GitHub Actions are pinned to a SHA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Hardening the runner (see the &lt;a href="https://blog.stepsecurity.io/announcing-general-availability-of-harden-runner-a7597a1410da" rel="noopener noreferrer"&gt;StepSecurity HardenRunner&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Probably a lot of other stuff I haven't had time to see yet 😆&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fortunately there is a &lt;a href="https://app.stepsecurity.io/" rel="noopener noreferrer"&gt;great free online tool&lt;/a&gt; that help you by doing all the hard work (it will open a pull-request and automatically fix issues).&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1617557370728767488-427" src="https://platform.twitter.com/embed/Tweet.html?id=1617557370728767488"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1617557370728767488-427');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1617557370728767488&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;The tool was created by &lt;a href="https://www.stepsecurity.io/" rel="noopener noreferrer"&gt;StepSecurity&lt;/a&gt;. I had the opportunity to talk with the CEO and they listen to the maintainers which is really cool. &lt;br&gt;
Thanks to them ❤️!&lt;/p&gt;
&lt;h2&gt;
  
  
  Configure Dependabot
&lt;/h2&gt;

&lt;p&gt;It is recommended to use &lt;a href="https://github.blog/2020-06-01-keep-all-your-packages-up-to-date-with-dependabot/" rel="noopener noreferrer"&gt;Dependabot&lt;/a&gt; for updating your dependencies and GitHub actions (yes, it also supports updating workflows in a secure way 😍).&lt;/p&gt;

&lt;p&gt;You only need to add a &lt;code&gt;.github/dependabot.yml&lt;/code&gt; config file. Personally I recommend a &lt;strong&gt;weekly&lt;/strong&gt; interval (with a lot of projects &lt;strong&gt;daily is a bit horrible&lt;/strong&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
&lt;span class="na"&gt;updates&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;package-ecosystem&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;github-actions&lt;/span&gt;
    &lt;span class="na"&gt;directory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/&lt;/span&gt;
    &lt;span class="na"&gt;schedule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;interval&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;weekly&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;package-ecosystem&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm&lt;/span&gt;
    &lt;span class="na"&gt;directory&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;/&lt;/span&gt;
    &lt;span class="na"&gt;schedule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;interval&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;weekly&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The StepSecurity tool we have seen in the previous chapter is also capable of doing it 🚀. &lt;/p&gt;



&lt;p&gt;Also, think to enable &lt;a href="https://docs.github.com/en/code-security/dependabot/dependabot-alerts/about-dependabot-alerts" rel="noopener noreferrer"&gt;Dependabot alerts&lt;/a&gt; in the &lt;code&gt;Security&lt;/code&gt; tab. This will allow the bot to open pull-request to fix known vulnerabilities by looking at your dependencies (&lt;strong&gt;referenced in package.json or others&lt;/strong&gt;).&lt;/p&gt;
&lt;h2&gt;
  
  
  🔬 Adding CodeQL scanning
&lt;/h2&gt;

&lt;p&gt;To enhance security even more you can add a &lt;a href="https://snyk.io/learn/application-security/static-application-security-testing/" rel="noopener noreferrer"&gt;SAST&lt;/a&gt; tool like &lt;a href="https://codeql.github.com/" rel="noopener noreferrer"&gt;CodeQL&lt;/a&gt;. Like scorecard it will report security scanning alert but for your codebase.&lt;/p&gt;

&lt;p&gt;Here an example:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqsycrb5ew1tztvr7rj6z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqsycrb5ew1tztvr7rj6z.png" alt="prototype-pollution" width="800" height="492"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A great way to make sure that newly added code does not contain vulnerabilities that were &lt;strong&gt;obvious to detect&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;👀 Note that once again StepSecurity can set up the workflow for you.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  📜 Enable Security advisories (and others)
&lt;/h2&gt;

&lt;p&gt;Github Security tab as a lot of cool features that help you maintain the security of your project. If you have followed all my previous chapters, most of them should be enabled now.&lt;/p&gt;

&lt;p&gt;Make sure to also enable &lt;code&gt;Secret scanning alerts&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futrx752lf9m382tbpunn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futrx752lf9m382tbpunn.png" alt="Github Security" width="800" height="438"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For an organization many of these parameters can be forced on all repositories. Go to &lt;code&gt;Settings&lt;/code&gt; &amp;gt; &lt;code&gt;Code security and analysis&lt;/code&gt;. You will have the options to enable/disable all.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa8f5cpwva9te0m15yb0s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa8f5cpwva9te0m15yb0s.png" alt="Github Security" width="611" height="333"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  💡 OpenSSF Best Pratices program
&lt;/h2&gt;

&lt;p&gt;Previously known as CII-Best-Practices, this program indicates that the project uses a set of security-focused best development practices for open source software.&lt;/p&gt;

&lt;p&gt;So I registered my first project on the &lt;a href="https://bestpractices.coreinfrastructure.org/en" rel="noopener noreferrer"&gt;website&lt;/a&gt;. It was a good surprise because it allowed me to question the quality of my documentation and tests 😬.&lt;/p&gt;

&lt;p&gt;Seeing the different levels and questions really helps you think about what you're missing (and possibly learn about the concepts you don't know about yet.. Like &lt;a href="https://snyk.io/blog/building-sbom-open-source-supply-chain-security/" rel="noopener noreferrer"&gt;SBOM&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9pn6g2gcoyelkniwopy0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9pn6g2gcoyelkniwopy0.png" alt="CII-Best-Practices" width="800" height="147"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I am still working on completing the first step/badge for the CLI project which now has a score of &lt;strong&gt;8.7&lt;/strong&gt; out of &lt;strong&gt;10&lt;/strong&gt; 🎉 on the OpenSSF scorecard.&lt;/p&gt;
&lt;h2&gt;
  
  
  🎯 Conclusion
&lt;/h2&gt;

&lt;p&gt;That's it for this article. I've covered what I've done/learned in the last couple of months. Here are some really cool additional links 💃:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/ossf/wg-best-practices-os-developers/blob/main/docs/Concise-Guide-for-Evaluating-Open-Source-Software.md#readme" rel="noopener noreferrer"&gt;Concise Guide for Evaluating Open Source Software 2023-01-03&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ossf/wg-best-practices-os-developers/blob/main/docs/Concise-Guide-for-Developing-More-Secure-Software.md#readme" rel="noopener noreferrer"&gt;Concise Guide for Developing More Secure Software 2023-01-03&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you work with NPM, I invite you to read our latest article about package managers:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/nodesecure" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F6062%2F43c0ffd0-bc13-4c49-8846-ce3efbdafd52.png" alt="NodeSecure" width="200" height="200"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F702314%2Fecb88ea8-6968-4326-82d1-8c9a97273a30.jpeg" alt="" width="800" height="1066"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/nodesecure/everything-you-need-to-know-package-managers-286c" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;📦 Everything you need to know: package managers&lt;/h2&gt;
      &lt;h3&gt;Antoine Coulon for NodeSecure ・ Nov 18 '22&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#npm&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#node&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#opensource&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;p&gt;Obviously, I probably &lt;strong&gt;still have a lot to learn&lt;/strong&gt;. But I hope this will help other maintainers/developers ❤️.&lt;/p&gt;

&lt;p&gt;🙏 Thanks for reading me 🙏&lt;/p&gt;

</description>
      <category>career</category>
      <category>productivity</category>
      <category>discuss</category>
    </item>
    <item>
      <title>JS-X-Ray 6.0</title>
      <dc:creator>Thomas.G</dc:creator>
      <pubDate>Mon, 16 Jan 2023 15:48:18 +0000</pubDate>
      <link>https://dev.to/nodesecure/js-x-ray-60-49ah</link>
      <guid>https://dev.to/nodesecure/js-x-ray-60-49ah</guid>
      <description>&lt;p&gt;Hello 👋&lt;/p&gt;

&lt;p&gt;It's been a while since the &lt;strong&gt;last article&lt;/strong&gt; on JS-X-Ray 😲!&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/nodesecure" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F6062%2F43c0ffd0-bc13-4c49-8846-ce3efbdafd52.png" alt="NodeSecure" width="200" height="200"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F314815%2F128a0b56-a103-4bc8-92b6-ce3738e98770.jpg" alt="" width="400" height="400"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/nodesecure/js-x-ray-3-0-0-3ddn" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;JS-X-Ray 3.0&lt;/h2&gt;
      &lt;h3&gt;Thomas.G for NodeSecure ・ Feb 28 '21&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#node&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#opensource&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;In this article I will present you the latest major version 👀. I didn't do an article on version 4 and 5 because they didn't introduce new features (only breaking changes on the API).&lt;/p&gt;

&lt;h2&gt;
  
  
  📢 What is JS-X-Ray ?
&lt;/h2&gt;

&lt;p&gt;If you are new in town, &lt;a href="https://github.com/NodeSecure/js-x-ray" rel="noopener noreferrer"&gt;JS-X-Ray&lt;/a&gt; is an open source JavaScript SAST (Static Application Security Testing). The tool analyzes your JavaScript sources for patterns that may affect the security and quality of your project 😎.&lt;/p&gt;

&lt;p&gt;Among the notable features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retrieving dependencies (CJS &amp;amp; ESM support) and detecting suspicious import/require.&lt;/li&gt;
&lt;li&gt;Detecting unsafe RegEx.&lt;/li&gt;
&lt;li&gt;Detecting obfuscated source (and provide hints on the tool used).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As well as a lot of &lt;a href="https://github.com/NodeSecure/js-x-ray#warnings-legends" rel="noopener noreferrer"&gt;other detections&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Major release 4 and 5
&lt;/h2&gt;

&lt;p&gt;These versions introduced changes on warnings (and we improved how we manage them in the codebase). We added new descriptors for each of them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;i18n (for translation in &lt;a href="https://github.com/NodeSecure/ci" rel="noopener noreferrer"&gt;CI&lt;/a&gt; or &lt;a href="https://github.com/NodeSecure/cli" rel="noopener noreferrer"&gt;CLI&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;experimental&lt;/li&gt;
&lt;li&gt;severity (Information, Warning, Critical)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Those information are visible in the &lt;a href="https://github.com/NodeSecure/cli" rel="noopener noreferrer"&gt;NodeSecure CLI&lt;/a&gt; interface:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0xjxew9sh7xm07wxhkef.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0xjxew9sh7xm07wxhkef.png" alt="NodeSecure" width="396" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Major release 6
&lt;/h2&gt;

&lt;p&gt;🐬 Ok, let's dive into this major release to discover the surprises 🎉 it has in store for us.&lt;/p&gt;

&lt;h3&gt;
  
  
  🚀 Introducing VariableTracer
&lt;/h3&gt;

&lt;p&gt;Almost a year of work on this &lt;a href="https://github.com/NodeSecure/estree-ast-utils/blob/main/src/utils/VariableTracer.js" rel="noopener noreferrer"&gt;new mechanism / class&lt;/a&gt; that brings a whole new dimension to JS-X-Ray.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tracer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;VariableTracer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;enableDefaultTracing&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;crypto.createHash&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;followConsecutiveAssignment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;moduleName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;crypto&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;walk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This class is able to follow all declarations, assignments and patterns (and those even through very obscure patterns).&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;aA&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Function&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prototype&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;call&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;bB&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aA&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;call&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bB&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;bB&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;crypto&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createHash&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nf"&gt;cr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;md5&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// weak-crypto warning is throw here&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This allows us to implement Probes in a much simpler way (which makes maintenance and testing much easier).&lt;/p&gt;

&lt;p&gt;Here an example with the &lt;code&gt;isWeakCrypto&lt;/code&gt; probe:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;validateNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;tracer&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getCallExpressionIdentifier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;importedModules&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;crypto&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getDataFromIdentifier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;
    &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;identifierOrMemberExpr&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;crypto.createHash&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
  &lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;By default the Tracer follows all ways of &lt;code&gt;requiring&lt;/code&gt; dependencies with CJS and also usage of &lt;code&gt;eval&lt;/code&gt; or &lt;code&gt;Function&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  🚧 Removing unsafe-assign warning
&lt;/h3&gt;

&lt;p&gt;This warning was required at the beginning of the project because it was difficult for me to correctly identify some malicious patterns.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwscxxpedjz513w9rtxds.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwscxxpedjz513w9rtxds.png" alt="NodeSecure" width="699" height="417"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, with the introduction of the new Tracer, which is very complete and precise, this warning no longer makes sense has it only generates unnecessary noise and false positives.&lt;/p&gt;
&lt;h3&gt;
  
  
  📜 Better ESM source parsing
&lt;/h3&gt;

&lt;p&gt;We previously had a lot of &lt;code&gt;parsing-error&lt;/code&gt; warnings because the NodeSecure scanner failed to detect if the file was using either CJS or ESM. &lt;/p&gt;

&lt;p&gt;That new version will automatically retry with ESM enabled if it fails with CJS.&lt;/p&gt;
&lt;h3&gt;
  
  
  📉 Reducing false positives
&lt;/h3&gt;

&lt;p&gt;To continue the momentum of the previous sections. This version drops a lot of warnings and significantly improves others.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reducing false positives for &lt;code&gt;encoded-literal&lt;/code&gt; warning by introducing new way of detecting safe values.&lt;/li&gt;
&lt;li&gt;Improve &lt;code&gt;short-identifiers&lt;/code&gt; by also storing ClassDeclaration, MethodDefinition and Function parameters.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We are also introducing a new &lt;code&gt;suspicious-file&lt;/code&gt; warning when a file contain more than 10 encoded-literal warnings to avoid having file with hundreds or thousands of warnings.&lt;/p&gt;

&lt;p&gt;Of the &lt;strong&gt;500&lt;/strong&gt; most popular NPM packages, we previously had &lt;strong&gt;24k&lt;/strong&gt; warnings with version 5. The latest version brings that number down to approximatively &lt;strong&gt;5k&lt;/strong&gt; warnings.&lt;/p&gt;
&lt;h3&gt;
  
  
  🔬 Improving coverage
&lt;/h3&gt;

&lt;p&gt;A lot of work has been done to add unit tests on all the probes of the project. We are near 100% of coverage 💪.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F07uejv3fgthptaymwj5j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F07uejv3fgthptaymwj5j.png" alt="NodeSecure" width="689" height="69"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks to the amazing work of our contributors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/Kawacrepe" rel="noopener noreferrer"&gt;Vincent DHENNIN&lt;/a&gt; - &lt;a class="mentioned-user" href="https://dev.to/kawacrepe"&gt;@kawacrepe&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/PierreDemailly" rel="noopener noreferrer"&gt;Pierre DEMAILLY&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/mathieu-kahlaoui-0887a1158/" rel="noopener noreferrer"&gt;Mathieu KA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/M4gie" rel="noopener noreferrer"&gt;M4gie&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  👀 What's next ?
&lt;/h2&gt;

&lt;p&gt;Here what I'm working for the next major release:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adding support of TypeScript sources (probably by allowing a customization of the parser).&lt;/li&gt;
&lt;li&gt;A new API that allows to dynamically extend the SAST with new custom probes (and custom warnings).&lt;/li&gt;
&lt;li&gt;Introducing new built-in detections and warnings (unsafe URL etc).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I will continue to work to reduce the number of false positives and keep improving obfuscated codes detection.&lt;/p&gt;



&lt;p&gt;Please think to drop a star on github ❤️!&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/NodeSecure" rel="noopener noreferrer"&gt;
        NodeSecure
      &lt;/a&gt; / &lt;a href="https://github.com/NodeSecure/js-x-ray" rel="noopener noreferrer"&gt;
        js-x-ray
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      JavaScript &amp;amp; Node.js open-source SAST scanner. A static analyser for detecting most common malicious patterns 🔬.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/4438263/213887379-c873eb89-8786-4b5c-8a59-dcca49e01cb8.jpg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F4438263%2F213887379-c873eb89-8786-4b5c-8a59-dcca49e01cb8.jpg" alt="@nodesecure/js-x-ray"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
    &lt;a href="https://github.com/NodeSecure/js-x-ray" rel="noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/2f50fb2c3897c7425c0ab3ed9c8e0bb5d9747c9d54c89e478f01eb8940609e7c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64796e616d69632f6a736f6e2e7376673f7374796c653d666f722d7468652d62616467652675726c3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f4e6f64655365637572652f6a732d782d7261792f726566732f68656164732f6d61737465722f776f726b7370616365732f6a732d782d7261792f7061636b6167652e6a736f6e2671756572793d242e76657273696f6e266c6162656c3d56657273696f6e" alt="npm version"&gt;
    &lt;/a&gt;
    &lt;a href="https://github.com/NodeSecure/js-x-ray/blob/master/LICENSE" rel="noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/a1cfb6cf43f37a7ae7f25341599401997596b0df3d1526d56b18c43f7c7b1604/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4e6f64655365637572652f6a732d782d7261792e7376673f7374796c653d666f722d7468652d6261646765" alt="license"&gt;
    &lt;/a&gt;
    &lt;a href="https://api.securityscorecards.dev/projects/github.com/NodeSecure/js-x-ray" rel="nofollow noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/6238a84a645fda299cf5ed18c005a1ed29244fe4d0ce73ef4d02f11c04a4af64/68747470733a2f2f6170692e736563757269747973636f726563617264732e6465762f70726f6a656374732f6769746875622e636f6d2f4e6f64655365637572652f6a732d782d7261792f62616467653f7374796c653d666f722d7468652d6261646765" alt="ossf scorecard"&gt;
    &lt;/a&gt;
    &lt;a href="https://github.com/NodeSecure/js-x-ray/actions?query=workflow%3A%22Node.js+CI%22" rel="noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/1afbdbc19894f6c522e873d9345aaf3f62987fef18558408bcfdee4d5c2ed655/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4e6f64655365637572652f6a732d782d7261792f6e6f64652e6a732e796d6c3f7374796c653d666f722d7468652d6261646765" alt="github ci workflow"&gt;
    &lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;JavaScript AST analysis. This package has been created to export the &lt;a href="https://github.com/NodeSecure/cli" rel="noopener noreferrer"&gt;NodeSecure&lt;/a&gt; AST analysis to enable better code evolution and allow better access to developers and researchers.&lt;/p&gt;
&lt;p&gt;The goal is to quickly identify dangerous code and patterns for developers and security researchers. Interpreting the results of this tool will still require you to have basic knowledge of secure coding.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Goals&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;The objective of the project is to detect potentially suspicious JavaScript code. The target is code that is added or injected for malicious purposes.&lt;/p&gt;

&lt;p&gt;Most of the time hackers will try to hide the behaviour of their code as much as possible to avoid being spotted or easily understood. The work of the library is to understand and analyze these patterns that will allow us to detect malicious code.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Feature Highlight&lt;/h2&gt;
&lt;/div&gt;


&lt;ul&gt;

&lt;li&gt;Retrieve required dependencies and files for Node.js&lt;/li&gt;

&lt;li&gt;Detect unsafe regular expressions&lt;/li&gt;

&lt;li&gt;Get warnings when the AST analysis detects a…&lt;/li&gt;

&lt;/ul&gt;
&lt;/div&gt;
&lt;br&gt;
  &lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/NodeSecure/js-x-ray" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;That's it for today! Thanks for reading me 😉&lt;/p&gt;

</description>
      <category>gratitude</category>
    </item>
    <item>
      <title>📦 Everything you need to know: package managers</title>
      <dc:creator>Antoine Coulon</dc:creator>
      <pubDate>Fri, 18 Nov 2022 09:51:21 +0000</pubDate>
      <link>https://dev.to/nodesecure/everything-you-need-to-know-package-managers-286c</link>
      <guid>https://dev.to/nodesecure/everything-you-need-to-know-package-managers-286c</guid>
      <description>&lt;p&gt;Welcome everyone! This article is the first one of the &lt;strong&gt;Everything you need to know&lt;/strong&gt;, a Software Engineering series.&lt;/p&gt;

&lt;p&gt;In this series, I will try to give you a solid basic understanding about Software Engineering concepts I consider important.&lt;/p&gt;

&lt;p&gt;All modern computer systems include tools that automate the process of installing, uninstalling and updating software.&lt;/p&gt;

&lt;p&gt;This responsibility is that of a package manager and several can intervene within the same computer system.&lt;/p&gt;

&lt;h3&gt;
  
  
  Operating system
&lt;/h3&gt;

&lt;p&gt;The majority of Unix-based operating systems embed a package manager as standard, providing a multitude of different packages very simply.&lt;/p&gt;

&lt;p&gt;If you have ever used a Linux distribution such as Ubuntu or Debian, you've probably used a package manager before. If I say &lt;code&gt;apt-get update&lt;/code&gt; does that ring a bell?&lt;/p&gt;

&lt;p&gt;This command tells APT to update all versions of packages installed. &lt;a href="https://en.wikipedia.org/wiki/APT_(software)" rel="noopener noreferrer"&gt;APT (Advanced Packaging Tool)&lt;/a&gt; is a package manager embedded very widely as standard on Linux operating systems. To install a package, you can for example enter the command &lt;code&gt;apt-get install &amp;lt;package&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Programming language
&lt;/h3&gt;

&lt;p&gt;Most programming languages ​​can embed their own with package managers, either natively or provided within their respective ecosystem.&lt;/p&gt;

&lt;p&gt;Take for example &lt;a href="https://www.npmjs.com" rel="noopener noreferrer"&gt;npm&lt;/a&gt;, the default package manager for Node.js. We can also mention &lt;a href="https://pip.pypa.io/en/stable/getting-started/" rel="noopener noreferrer"&gt;pip&lt;/a&gt; for Python, &lt;a href="https://www.nuget.org/" rel="noopener noreferrer"&gt;NuGet&lt;/a&gt; for C#, &lt;a href="https://getcomposer.org/" rel="noopener noreferrer"&gt;Composer&lt;/a&gt; for PHP, etc. Similar to APT, npm makes it easy to install packages using the &lt;code&gt;npm install &amp;lt;package&amp;gt;&lt;/code&gt; command.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For this article, I decided to take npm as an example.&lt;br&gt;
npm is indeed a very good support to highlight the advantages but also the disadvantages that a package manager can have.&lt;br&gt;
The advantages and disadvantages listed in the following part are valid for all package managers.&lt;/p&gt;

&lt;p&gt;npm is installed alongside Node.js. To reproduce these examples, [you only need to install Node.js here].&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In four parts, we will see what are the main reasons for such an expansion of package managers to all layers of a computer system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.  Ease of use and maintenance of packages&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The main interest of a package manager is obviously to simplify the installation of dependencies external to our application. Before the rise of npm in January 2010, the dependencies of a JavaScript application were mostly installed manually. By "manual installation" I mean:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;downloading a zip archive from a remote server&lt;/li&gt;
&lt;li&gt;unzipping the archive in the project&lt;/li&gt;
&lt;li&gt;manual referencing of the installed version, and this with each update of a dependency. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With a package manager like npm, we therefore benefit from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simplified installation of a package &lt;code&gt;npm install &amp;lt;package&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The simplified update of a package &lt;code&gt;npm update &amp;lt;package&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The simplified removal of a package &lt;code&gt;npm uninstall &amp;lt;package&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The packages are installed in a &lt;strong&gt;node_modules&lt;/strong&gt; folder adjacent to the application and which is entirely managed by npm. All packages located in the node_modules folder can be directly imported from the application.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In general, each programming language natively embeds its own module resolution management mechanism.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;1.1. Install&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In order for a package to be installed, we first need a name which is in most cases used as a unique identifier. Naming conventions can differ from one ecosystem to another.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;rxjs 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this command, the package manager will search within the registry for a package that has the name &lt;strong&gt;rxjs&lt;/strong&gt;. When the version is not specified, the package manager will usually install the latest available version.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.2. Use&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// ECMAScript Modules (ESM)&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rxjs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// CommonJS&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;rxjs&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The module systems integrated into the programming languages ​​make it possible to import a library installed locally and sometimes remotely (like Go or Deno for example). In this case with Node.js, the package must be installed locally in a node_modules folder. With Node.js, &lt;a href="https://nodejs.org/api/modules.html#all-together" rel="noopener noreferrer"&gt;the module resolution algorithm&lt;/a&gt; allows the dependency to be in a node_modules folder either adjacent to the source code or in a parent folder (which sometimes leads to an unexpected behavior).&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Managing the consistency of installed packages
&lt;/h3&gt;

&lt;p&gt;Now, let's dive into a little more detail on one very important aspect that a package manager must manage: &lt;strong&gt;state consistency between installed packages&lt;/strong&gt;. So far, installing a package looks like a trivial task, which is just to automate downloading a package of a certain version and making it available in a conventional folder that the application has access to.&lt;/p&gt;

&lt;p&gt;However this management of consistency between packages turns out to be relatively difficult and the way of modeling the dependency tree varies according to the ecosystems. Most of the time, we talk about a dependency tree, but we can also talk about a dependency graph, in particular a directed graph.&lt;/p&gt;

&lt;p&gt;If you are not familiar with the concept of directed graphs, I invite you &lt;a href="https://dev.to/antoinecoulon/master-directed-graphs-by-example-with-javascript-4oef"&gt;to read the series of articles I wrote about it on dev.to with examples in JavaScript&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The implementations of these data structures can be drastically different depending on the ecosystem of a package manager, but also between package managers of the same ecosystem (npm, yarn, pnpm for Node.js for example).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;How to ensure that all developers share the same dependencies and therefore the same versions of each underlying library?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Still in the context of npm, let's take for example a very simple list of dependencies, expressed as an object in the &lt;em&gt;package.json&lt;/em&gt; file:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;package.json&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; 
  &lt;/span&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"myDependencyA"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;0.1.0"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This object describes a dependency of our project on the &lt;em&gt;myDependencyA&lt;/em&gt; library downloadable from the npm registry. &lt;a href="https://semver.org/" rel="noopener noreferrer"&gt;Semantic Versioning&lt;/a&gt; here constrains the version of the library to be installed (here lower than 0.1.0). &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Semantic version management (commonly known as SemVer) is the application of a very precise specification to characterize the version of software. For more information on this subject, I invite you to take a look at the official specification &lt;a href="https://semver.org/lang/fr/" rel="noopener noreferrer"&gt;https://semver.org/lang/fr/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In our case, by remaining on the classic &lt;code&gt;&amp;lt;major&amp;gt;.&amp;lt;minor&amp;gt;.&amp;lt;patch&amp;gt;&lt;/code&gt; scheme, we express the possibility of installing all the versions of &lt;em&gt;myDependencyA&lt;/em&gt; from "0.0.1" to "0.0.9". This therefore means that any version of the dependency that respects the range is considered valid. On the other hand, this also means that if a developer A installs the dependency at 2 p.m. and a developer B installs the dependency at 5 p.m., they may both not have the same dependency tree if ever a new version of &lt;em&gt;myDependencyA&lt;/em&gt; is released in the meantime.&lt;/p&gt;

&lt;p&gt;The npm dependency resolution algorithm will by default favor the installation of the most recent dependency that respects the semantic management described in the &lt;em&gt;package.json&lt;/em&gt;. By specifying &lt;code&gt;npm install myDependencyA&lt;/code&gt;, the most recent version of &lt;em&gt;myDependencyA&lt;/em&gt; will be installed respecting the constraint "&amp;lt;1.0.0" (version strictly lower than "1.0.0").&lt;/p&gt;

&lt;p&gt;The major problem with this approach &lt;strong&gt;is the lack of stability and reproducibility of the dependency tree from one computer to another&lt;/strong&gt;, for example between developers or even on the machine used in production. Imagine that version 0.0.9 of &lt;em&gt;myDependencyA&lt;/em&gt; has just been released with a bug and your production machine is about to do an &lt;code&gt;npm install&lt;/code&gt; on Friday at 5:59 PM…&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi9f9zvaod4ox4y7eru1k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi9f9zvaod4ox4y7eru1k.png" alt="Production deployment on friday night"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The very simple example is often referred as &lt;code&gt;version drift&lt;/code&gt;. This is why a single description file (in this case package.json) &lt;strong&gt;cannot be enough to guarantee an identical and reproducible representation of a dependency tree&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Other reasons include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;using a different version of the package manager whose dependency installation algorithm may change.&lt;/li&gt;
&lt;li&gt;publishing a new version of an indirect dependency (the dependencies of the dependencies we list in the package.json here), which would result in the new version therefore being uploaded and updated.&lt;/li&gt;
&lt;li&gt;the use of a different registry which for the same version of a dependency exposes two different libraries at a time T.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Lockfiles to the rescue&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To ensure the reproducibility of a dependency tree, we therefore need more information that &lt;strong&gt;would ideally describe the current state of our dependency tree&lt;/strong&gt;. This is exactly what lockfiles do. These are files created and updated when the dependencies of a project are modified.&lt;/p&gt;

&lt;p&gt;A lockfile is generally written in &lt;em&gt;JSON&lt;/em&gt; or &lt;em&gt;YAML&lt;/em&gt; format to simplify the readability and understanding of the dependency tree by a human. A lockfile makes it possible to describe the dependency tree in a very precise way and &lt;strong&gt;therefore to make it deterministic and reproducible from one environment to another&lt;/strong&gt;. So it's important to commit this file to Git and make sure everyone is sharing the same lockfile.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;package-lock.json&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"myProject"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"myDependencyA"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0.0.5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"resolved"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://registry.npmjs.org/myDependencyA/-/myDependencyA-0.0.5.tgz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"integrity"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sha512-DeAdb33F+"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"B"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0.0.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"resolved"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://registry.npmjs.org/B/-/B-0.0.1.tgz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"integrity"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sha512-DeAdb33F+"&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;dependencies&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;B&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For npm, the basic lockfile is called &lt;em&gt;package-lock.json&lt;/em&gt;. In the snippet above, we can precisely see several important information:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The version of myDependencyA is fixed at "0.0.5" so even if a new version is released, npm will install "0.0.5" no matter what.&lt;/li&gt;
&lt;li&gt;Each indirect dependency describes its set of dependencies with versions that also describe their own versioning constraints.&lt;/li&gt;
&lt;li&gt;In addition to the version, the contents of the dependencies can be checked with the comparison of hashes which can vary according to the registers used.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A lockfile therefore tries to accurately describes the dependency tree, which allows it to remain consistent and reproducible over time at each installation.&lt;/p&gt;

&lt;p&gt;⚠️ &lt;strong&gt;But...&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Lockfiles don't solve all inconsistency problems! Package managers implementations of the dependency graph can sometimes lead to inconsistencies. For a long time, npm's implementation introduced &lt;a href="https://rushjs.io/pages/advanced/phantom_deps/" rel="noopener noreferrer"&gt;Phantom Dependencies&lt;/a&gt; and also &lt;a href="https://rushjs.io/pages/advanced/npm_doppelgangers/" rel="noopener noreferrer"&gt;NPM doppelgangers&lt;/a&gt; which are very well explained on the &lt;a href="https://rushjs.io/" rel="noopener noreferrer"&gt;Rush.js&lt;/a&gt; documentation website (advanced topics that are out of the scope of this blog post).&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Provision of distributed and transparent databases via open-source
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Distributed registries&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A package manager is a client that acts as a gateway to a distributed database (often called a registry). This allows in particular to share an infinite number of open-source libraries around the world. It is also possible to define company-wide private registries in a secured network, within which libraries would be accessible. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/verdaccio/verdaccio" rel="noopener noreferrer"&gt;Verdaccio&lt;/a&gt; allows to setup a private proxy registry for Node.js&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The availability of registries has greatly changed the way software is developed by facilitating access to millions of libraries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transparent access to resources&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The other benefit of open-source package managers is that they most often expose platforms or tools that allow browsing through published packages. Accessing source code and documentation has been trivialized and made very transparent. It is therefore possible for each developer to have an overview or even to fully investigate the code base of a published library.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Security and integrity
&lt;/h2&gt;

&lt;p&gt;Using open-source registries with millions of publicly exposed libraries is pretty convenient, but what about &lt;em&gt;security&lt;/em&gt;?&lt;/p&gt;

&lt;p&gt;It is true that open-source registries represent ideal targets for hackers: &lt;a href="https://therecord.media/malware-found-in-npm-package-with-millions-of-weekly-downloads/" rel="noopener noreferrer"&gt;all you have to do is take control of a widely used library (downloaded millions of times a week) and inject malicious code into it, and no one will realize!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this part, we will see the solutions implemented by package managers and registries to deal with these attacks and limit the risks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integrity safety for each installed package&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Given that a package can be installed from any registry, it is important to implement verification mechanisms at the level of the content of the downloaded package, to ensure that no malicious code has been injected during the download, regardless of its origin.&lt;/p&gt;

&lt;p&gt;For this, integrity metadata is associated with each installed package. For example with npm, an integrity property is associated with each package in the lockfile. This property contains a cryptographic hash which is used to accurately represent the resource the user expects to receive. This allows any program to verify that the content of the resource matches what was downloaded. For example for &lt;code&gt;@babel/core&lt;/code&gt;, this is how integrity is represented in package-lock.json:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"@babel/core"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"7.16.10"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"resolved"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://registry.npmjs.org/@babel/core/-/core-7.16.10.tgz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;  
   &lt;/span&gt;&lt;span class="nl"&gt;"integrity"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sha512 pbiIdZbCiMx/MM6toR+OfXarYix3uz0oVsnNtfdAGTcCTu3w/JGF8JhirevXLBJUu0WguSZI12qpKnx7EeMyLA=="&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's take a closer look at how integrity can drastically reduce the risk of injecting malicious code by hashing source code.&lt;/p&gt;

&lt;p&gt;As a reminder:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We call hash function, a particular function which, from a datum supplied as input, calculates a digital fingerprint used to quickly identify the initial datum, in the same way as a signature to identify a person. &lt;a href="https://en.wikipedia.org/wiki/Hash_function" rel="noopener noreferrer"&gt;Wikipedia&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's take for example a simple case:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// my-library&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;someJavaScriptCode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;addUser&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's imagine that this JavaScript code represents a resource that a user might want to download. Using the &lt;em&gt;SHA1&lt;/em&gt; hash function, we get the hash &lt;code&gt;7677152af4ef8ca57fcb50bf4f71f42c28c772be&lt;/code&gt;.&lt;br&gt;
If ever malicious code is injected, the library's fingerprint will by definition change because the input (source code here) to the hash function will have changed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// my-library&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;someJavaScriptCode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;processMaliciousCode&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// this is injected, the user is not  expecting that&lt;/span&gt;
  &lt;span class="nf"&gt;addUser&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After injecting the malicious code, still using the same &lt;em&gt;SHA1&lt;/em&gt; hash function, we obtain &lt;code&gt;28d32d30caddaaaafbde0debfcd8b3300862cc24&lt;/code&gt; as the digital fingerprint.&lt;br&gt;
So we get as results:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Original code = &lt;code&gt;7677152af4ef8ca57fcb50bf4f71f42c28c772be&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Malicious code = &lt;code&gt;28d32d30caddaaaafbde0debfcd8b3300862cc24&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All package managers implement strict specifications on this approach to integrity. For example, npm respects the W3C's "Subresource Integrity or SRI" specification, which describes the mechanisms to be implemented to reduce the risk of malicious code injection.&lt;br&gt;
You can jump directly &lt;a href="https://w3c.github.io/webappsec-subresource-integrity/" rel="noopener noreferrer"&gt;here&lt;/a&gt; to the specification document if you want to dig deeper.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security constraints at the author level&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To strengthen security at the level of open-source packages, more and more constraints are emerging on the side of project authors and maintainers. Recently, GitHub, which owns npm, announced that it is &lt;a href="https://github.blog/2022-02-01-top-100-npm-package-maintainers-require-2fa-additional-security/" rel="noopener noreferrer"&gt;forcing two-factor authentication (2FA) for contributors to the 100 most popular packages&lt;/a&gt;. The main idea around these actions is to secure resources upstream by limiting write access to open-source packages and identifying people more precisely.&lt;/p&gt;

&lt;p&gt;It's important to also mention that there are tools that can be used to perform automatically scans and audits continuously. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Built-in tools&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In order to automate the detection of vulnerabilities, many package managers natively integrate tools allowing to scan the installed libraries. Typically, these package managers communicate with databases that list all known and referenced vulnerabilities. For example, &lt;a href="https://github.com/advisories" rel="noopener noreferrer"&gt;GitHub Advisory Database&lt;/a&gt; is an open-source database that references thousands of vulnerabilities across multiple ecosystems (Go, Rust, Maven, NuGet, etc) e.g. &lt;code&gt;npm audit&lt;/code&gt; command uses this database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Third-party tools&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/NodeSecure" rel="noopener noreferrer"&gt;NodeSecure&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At &lt;strong&gt;NodeSecure&lt;/strong&gt; we are building free open source tools to secure the Node.js &amp;amp; JavaScript ecosystem. Our biggest area of expertise is in package and code analysis.&lt;/p&gt;

&lt;p&gt;Here are some example of the available tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/NodeSecure/cli" rel="noopener noreferrer"&gt;@nodesecure/cli&lt;/a&gt;, a CLI that allow you to deeply analyze the dependency tree of a given package or local Node.js project&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/NodeSecure/js-x-ray" rel="noopener noreferrer"&gt;@nodesecure/js-x-ray&lt;/a&gt;, a SAST scanner (A static analyser for detecting most common malicious patterns)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/NodeSecure/vulnera" rel="noopener noreferrer"&gt;@nodesecure/vulnera&lt;/a&gt;, a Software Component Analysis (SCA) tool&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/NodeSecure/ci" rel="noopener noreferrer"&gt;@nodesecure/ci&lt;/a&gt;, a tool allowing to run SAST, SCA and many more analysis in CI/CDs or in a local environment&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://snyk.io/" rel="noopener noreferrer"&gt;Snyk&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Snyk is the most popular all-around solution for securing applications or cloud-based infrastructures. Snyk &lt;a href="https://snyk.io/plans/" rel="noopener noreferrer"&gt;offers a free-tier&lt;/a&gt; with SAST and SCA analysis.&lt;/p&gt;

&lt;p&gt;To ensure continuous detection of vulnerabilities, it is recommended to run scans each time packages are installed/modified.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There you go, you now know what issues are addressed and solved by package managers!&lt;/p&gt;

&lt;p&gt;Package managers are complex tools that aim to make life easier for us as developers, but can quickly become problematic if misused.&lt;/p&gt;

&lt;p&gt;It is therefore important to understand the issues they deal with and the solutions provided in order to be able to put into perspective several package managers of the same ecosystem. In the end, it's a tool like any other and it must mobilize thinking in the same way as when libraries/frameworks/programming languages ​​are used.&lt;/p&gt;

&lt;p&gt;Don't also forget to take into account security issues and use automated tools which can drastically reduce the attack surface!&lt;/p&gt;

</description>
      <category>npm</category>
      <category>node</category>
      <category>opensource</category>
    </item>
    <item>
      <title>NodeSecure Vuln-era</title>
      <dc:creator>Thomas.G</dc:creator>
      <pubDate>Thu, 21 Jul 2022 08:15:29 +0000</pubDate>
      <link>https://dev.to/nodesecure/announcing-nodesecure-vulnera-22a6</link>
      <guid>https://dev.to/nodesecure/announcing-nodesecure-vulnera-22a6</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;😍 Logo and cover by our beloved &lt;a href="https://www.linkedin.com/in/mehdi-bouchard/" rel="noopener noreferrer"&gt;medhi bouchard&lt;/a&gt; ❤️&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hello 👋,&lt;/p&gt;

&lt;p&gt;Back for a little article about the rebranding of one of the NodeSecure tools: &lt;a href="https://github.com/NodeSecure/vuln" rel="noopener noreferrer"&gt;Vulnera&lt;/a&gt; (previously &lt;em&gt;vuln&lt;/em&gt;, the &lt;strong&gt;vuln-era&lt;/strong&gt; has begun!).&lt;/p&gt;

&lt;p&gt;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:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/nodesecure" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F6062%2F43c0ffd0-bc13-4c49-8846-ce3efbdafd52.png" alt="NodeSecure" width="200" height="200"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F314815%2F128a0b56-a103-4bc8-92b6-ce3738e98770.jpg" alt="" width="400" height="400"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/nodesecure/announcing-new-node-secure-back-end-1dp9" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Announcing new NodeSecure back-end&lt;/h2&gt;
      &lt;h3&gt;Thomas.G for NodeSecure ・ Sep 11 '21&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#node&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Don't wait and dive in 🌊 with me to discover this tool 💃.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Vulnera ? 👀
&lt;/h2&gt;

&lt;p&gt;Vulnera is a package that allows you to &lt;strong&gt;programmatically&lt;/strong&gt; fetch your Node.js project vulnerabilities from &lt;strong&gt;multiple sources or strategies&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;NPM Audit (&lt;a href="https://github.com/advisories" rel="noopener noreferrer"&gt;Github Advisory Database&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ossindex.sonatype.org/" rel="noopener noreferrer"&gt;Sonatype OSS Index&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;deprecated&lt;/code&gt; &lt;a href="https://github.com/nodejs/security-wg/tree/main/vuln" rel="noopener noreferrer"&gt;Node.js Security WG Database&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Snyk&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;📢 Feel free to push new sources (we have &lt;a href="https://github.com/NodeSecure/vuln/blob/main/docs/adding_new_strategy.md" rel="noopener noreferrer"&gt;a guide&lt;/a&gt; on how to add/contribute one).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The code was originally designed for vulnerability management within the &lt;a href="https://github.com/NodeSecure/scanner" rel="noopener noreferrer"&gt;Scanner&lt;/a&gt;. Yet, its API is &lt;strong&gt;evolving&lt;/strong&gt; with the objective of making it a &lt;strong&gt;full-fledged project&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;vulnera&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@nodesecure/vulnera&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;def&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;vulnera&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setStrategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;vulnera&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;strategies&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;NPM_AUDIT&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;vulnerabilities&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;def&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getVulnerabilities&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cwd&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;useStandardFormat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;vulnerabilities&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Standard vulnerability format 👯
&lt;/h3&gt;

&lt;p&gt;We have created a standard format to reconcile the different sources.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;StandardVulnerability&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="cm"&gt;/** Unique identifier for the vulnerability **/&lt;/span&gt;
  &lt;span class="nl"&gt;id&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="cm"&gt;/** Vulnerability origin, either Snyk, NPM or NodeSWG **/&lt;/span&gt;
  &lt;span class="nl"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Origin&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="cm"&gt;/** Package associated with the vulnerability **/&lt;/span&gt;
  &lt;span class="nl"&gt;package&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="cm"&gt;/** Vulnerability title **/&lt;/span&gt;
  &lt;span class="nl"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="cm"&gt;/** Vulnerability description **/&lt;/span&gt;
  &lt;span class="nl"&gt;description&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="cm"&gt;/** Vulnerability link references on origin's website **/&lt;/span&gt;
  &lt;span class="nl"&gt;url&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="cm"&gt;/** Vulnerability severity levels given the strategy **/&lt;/span&gt;
  &lt;span class="nl"&gt;severity&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;Severity&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="cm"&gt;/** Common Vulnerabilities and Exposures dictionary */&lt;/span&gt;
  &lt;span class="nl"&gt;cves&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="cm"&gt;/** Common Vulnerability Scoring System (CVSS) **/&lt;/span&gt;
  &lt;span class="nl"&gt;cvssVector&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="cm"&gt;/** CVSS Score **/&lt;/span&gt;
  &lt;span class="nl"&gt;cvssScore&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="cm"&gt;/** The range of vulnerable versions */&lt;/span&gt;
  &lt;span class="nl"&gt;vulnerableRanges&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="cm"&gt;/** The set of versions that are vulnerable **/&lt;/span&gt;
  &lt;span class="nl"&gt;vulnerableVersions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="cm"&gt;/** The set of versions that are patched **/&lt;/span&gt;
  &lt;span class="nl"&gt;patchedVersions&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="cm"&gt;/** Overview of available patches **/&lt;/span&gt;
  &lt;span class="nl"&gt;patches&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;Patch&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You can always use the original formats of each source of course 😊. We have implemented and exposed &lt;strong&gt;TypeScript interfaces&lt;/strong&gt; for each of them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0eqb67gqp772iawr10gp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0eqb67gqp772iawr10gp.png" alt="NodeSecure types" width="311" height="183"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Usage in Scanner 🔬
&lt;/h2&gt;

&lt;p&gt;On the scanner we have all the necessary information because we go through the dependency tree 🎄. At &lt;a href="https://github.com/NodeSecure/scanner/blob/master/src/depWalker.js#L297" rel="noopener noreferrer"&gt;the end of the process&lt;/a&gt;, we recover all vulnerabilities by iterating &lt;strong&gt;spec&lt;/strong&gt; by &lt;strong&gt;spec&lt;/strong&gt; within the &lt;strong&gt;hydratePayloadDependencies&lt;/strong&gt; strategy method.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;hydratePayloadDependencies&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;strategy&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;vulnera&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setStrategy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;userStrategyName&lt;/span&gt; &lt;span class="c1"&gt;// SNYK for example&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;hydratePayloadDependencies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dependencies&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;useStandardFormat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;location&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;vulnerabilityStrategy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;strategy&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The following diagram explains the overall behavior and interactions between the Scanner and Vulnera.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6x76ry38w7qcitdulayh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6x76ry38w7qcitdulayh.png" alt="NodeSecure" width="800" height="590"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to learn more about the Payload you can check the TypeScript interface &lt;a href="https://github.com/NodeSecure/scanner/blob/master/types/scanner.d.ts#L132" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  What's next ? 🚀
&lt;/h2&gt;

&lt;p&gt;Some sources are more difficult to exploit than others (for NPM we use &lt;a href="https://www.npmjs.com/package/@npmcli/arborist" rel="noopener noreferrer"&gt;Arborist&lt;/a&gt; which simplifies our lives).&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;vulnerabilities&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;arborist&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;audit&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nf"&gt;toJSON&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;However, we have to think and create mechanics to exploit sources like Sonatype 😨. This is required for API like &lt;code&gt;getVulnerabilities()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Among the major subjects and &lt;strong&gt;ideas&lt;/strong&gt; we are working on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a &lt;strong&gt;private&lt;/strong&gt; database to benchmark the sources between them (see &lt;a href="https://github.com/NodeSecure/vulnera/issues/29" rel="noopener noreferrer"&gt;#29&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Merging multiple sources in one (see &lt;a href="https://github.com/NodeSecure/vulnera/issues/25" rel="noopener noreferrer"&gt;#25&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Fetch vulnerabilities of a given remote package (with support for private registry like &lt;a href="https://verdaccio.org/" rel="noopener noreferrer"&gt;verdaccio&lt;/a&gt;). At the moment we only support the analysis of a local manifest or a payload of the scanner.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Credits 🙇
&lt;/h2&gt;

&lt;p&gt;This project owes much to our core collaborator &lt;a href="https://www.linkedin.com/in/antoine-coulon-b29934153/" rel="noopener noreferrer"&gt;Antoine COULON&lt;/a&gt; who invested a lot of energy to improve it 💪.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Fun fact:&lt;/strong&gt; &lt;a href="https://github.com/NodeSecure/cli/commit/236c7333720b14878b5f620f3a814c045a375a45" rel="noopener noreferrer"&gt;its first contribution&lt;/a&gt; 🐤 on NodeSecure was also on the old version of the code Scanner that managed vulnerabilities.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But I don't forget individual contributions 👏&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.linkedin.com/in/mathieu-kahlaoui-0887a1158/" rel="noopener noreferrer"&gt;Mathieu Kahlaoui&lt;/a&gt; for adding &lt;a href="https://github.com/NodeSecure/vuln/pull/33" rel="noopener noreferrer"&gt;the getVulnerabilities() API&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.linkedin.com/in/oleh-sych-41245116a/" rel="noopener noreferrer"&gt;Oleh Sych&lt;/a&gt; for adding &lt;a href="https://github.com/NodeSecure/vuln/pull/11" rel="noopener noreferrer"&gt;Snyk strategy&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Medhi for his work on the logo&lt;/li&gt;
&lt;/ul&gt;




&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/NodeSecure" rel="noopener noreferrer"&gt;
        NodeSecure
      &lt;/a&gt; / &lt;a href="https://github.com/NodeSecure/vulnera" rel="noopener noreferrer"&gt;
        vulnera
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Programmatically fetch security vulnerabilities with one or many strategies (NPM Audit, Sonatype, Snyk, Node.js DB).
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/43391199/180091156-9cf883b3-05bc-4c69-9943-3d1168818fab.png"&gt;&lt;img alt="vulnera" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F43391199%2F180091156-9cf883b3-05bc-4c69-9943-3d1168818fab.png" width="650"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
    &lt;a href="https://github.com/NodeSecure/vulnera" rel="noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/2e96c2010c3fa1ccaa8f1d3bf68e99b3a8b36cb5056fe9f60dd4a638fc2a89b2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7061636b6167652d6a736f6e2f762f4e6f64655365637572652f76756c6e6572613f7374796c653d666f722d7468652d6261646765" alt="npm version"&gt;
    &lt;/a&gt;
    &lt;a href="https://github.com/NodeSecure/vulnera" rel="noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/01eb01b5f1cd10012b69a2fc5ed293d7cc4d983de582c7635c73e68bfdf23679/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4e6f64655365637572652f76756c6e6572613f7374796c653d666f722d7468652d6261646765" alt="license"&gt;
    &lt;/a&gt;
    &lt;a href="https://api.securityscorecards.dev/projects/github.com/NodeSecure/vulnera" rel="nofollow noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/0ac3dc0152a1eeeaced5c88b503c080a77dc1e559f088d8f1b4be98983600536/68747470733a2f2f6170692e736563757269747973636f726563617264732e6465762f70726f6a656374732f6769746875622e636f6d2f4e6f64655365637572652f76756c6e6572612f62616467653f7374796c653d666f722d7468652d6261646765" alt="ossf scorecard"&gt;
    &lt;/a&gt;
    &lt;a href="https://github.com/NodeSecure/vulnera/actions?query=workflow%3A%22Node.js+CI%22" rel="noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/e3655b307d0b6e23682d00de3ec3e8175f13e4e04048229f0b0671661869744b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4e6f64655365637572652f76756c6e6572612f6d61696e2e796d6c3f7374796c653d666f722d7468652d6261646765" alt="github ci workflow"&gt;
    &lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;vuln-&lt;em&gt;era&lt;/em&gt;&lt;/strong&gt; has begun! Programmatically fetch security vulnerabilities with one or many strategies. Originally designed to run and analyze &lt;a href="https://github.com/NodeSecure/scanner" rel="noopener noreferrer"&gt;Scanner&lt;/a&gt; dependencies it now also runs independently from an npm Manifest.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Requirements&lt;/h2&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/" rel="nofollow noopener noreferrer"&gt;Node.js&lt;/a&gt; v22 or higher&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Getting Started&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;This package is available in the Node Package Repository and can be easily installed with &lt;a href="https://docs.npmjs.com/getting-started/what-is-npm" rel="nofollow noopener noreferrer"&gt;npm&lt;/a&gt; or &lt;a href="https://yarnpkg.com" rel="nofollow noopener noreferrer"&gt;yarn&lt;/a&gt;.&lt;/p&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ npm i @nodesecure/vulnera
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; or&lt;/span&gt;
$ yarn add @nodesecure/vulnera&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Usage example&lt;/h2&gt;
&lt;/div&gt;

&lt;div class="highlight highlight-source-js notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-c1"&gt;*&lt;/span&gt; &lt;span class="pl-k"&gt;as&lt;/span&gt; &lt;span class="pl-s1"&gt;vulnera&lt;/span&gt; &lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s"&gt;"@nodesecure/vulnera"&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;

&lt;span class="pl-k"&gt;await&lt;/span&gt; &lt;span class="pl-s1"&gt;vulnera&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;setStrategy&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;
  &lt;span class="pl-s1"&gt;vulnera&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-c1"&gt;strategies&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-c1"&gt;GITHUB_ADVISORY&lt;/span&gt;
&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;

&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;definition&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-k"&gt;await&lt;/span&gt; &lt;span class="pl-s1"&gt;vulnera&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;getStrategy&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
&lt;span class="pl-smi"&gt;console&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;log&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;definition&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-c1"&gt;strategy&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;

&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;vulnerabilities&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-k"&gt;await&lt;/span&gt; &lt;span class="pl-s1"&gt;definition&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;getVulnerabilities&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;process&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;cwd&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
  &lt;span class="pl-c1"&gt;useFormat&lt;/span&gt;: &lt;span class="pl-s"&gt;"Standard"&lt;/span&gt;
&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
&lt;span class="pl-smi"&gt;console&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;log&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;vulnerabilities&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Available strategy&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;The default strategy is &lt;strong&gt;NONE&lt;/strong&gt; which mean no strategy at all (we execute…&lt;/p&gt;
&lt;/div&gt;


&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/NodeSecure/vulnera" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;Thanks 🙏 for reading me and see you soon for another article!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>security</category>
      <category>opensource</category>
    </item>
    <item>
      <title>NodeSecure CLI v2.0.0</title>
      <dc:creator>Thomas.G</dc:creator>
      <pubDate>Wed, 29 Jun 2022 09:48:03 +0000</pubDate>
      <link>https://dev.to/nodesecure/nodesecure-cli-v200-2ai7</link>
      <guid>https://dev.to/nodesecure/nodesecure-cli-v200-2ai7</guid>
      <description>&lt;p&gt;Hello 👋,&lt;/p&gt;

&lt;p&gt;I am writing this article with excitement and after several months of work. With the &lt;a href="https://github.com/NodeSecure/Governance#team" rel="noopener noreferrer"&gt;core team&lt;/a&gt; we are thrilled to announce that we are publishing a &lt;strong&gt;new version&lt;/strong&gt; of the UI.🚀.&lt;/p&gt;

&lt;p&gt;As you are reading these lines I am probably under the sun ☀️ of Tel Aviv for the &lt;a href="https://www.nodetlv.com/" rel="noopener noreferrer"&gt;NodeTLV&lt;/a&gt; conference where I will give a talk about &lt;strong&gt;NodeSecure&lt;/strong&gt; and some other tools.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3wspz0krx3g44jicz6v6.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3wspz0krx3g44jicz6v6.JPG" alt="NodeSecure" width="800" height="450"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;What an incredible journey 😍. Four years ago I was working on my tool alone 😥... But now more than a dozen developers are contributing to the project and I can only thank all of you for your precious support 🙏.&lt;/p&gt;

&lt;p&gt;If you are new, then let me introduce you to the project&lt;/p&gt;

&lt;h2&gt;
  
  
  🐤 Getting started with NodeSecure
&lt;/h2&gt;

&lt;p&gt;NodeSecure is an organization gathering a lot of individual projects that will allow you to improve the &lt;strong&gt;security&lt;/strong&gt; and &lt;strong&gt;quality&lt;/strong&gt; of your projects 💪. With our tools you can &lt;strong&gt;visually&lt;/strong&gt; discover the dependencies you use on a daily basis and &lt;strong&gt;learn&lt;/strong&gt; more about them 📚.&lt;/p&gt;

&lt;p&gt;Our most notable project is:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/NodeSecure" rel="noopener noreferrer"&gt;
        NodeSecure
      &lt;/a&gt; / &lt;a href="https://github.com/NodeSecure/cli" rel="noopener noreferrer"&gt;
        cli
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      JavaScript security CLI that allow you to deeply analyze the dependency tree of a given package or local Node.js project.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;
  🐢 Node-Secure CLI 🚀
&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;
  a Node.js CLI to deeply analyze the dependency tree of a given NPM package or Node.js local app
&lt;/p&gt;

&lt;p&gt;
    &lt;a href="https://www.npmjs.com/package/@nodesecure/cli" rel="nofollow noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/a2426a4c17f17920d8d729dc7e98151a94f25c34f3536685646337c36f225f8b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7061636b6167652d6a736f6e2f762f4e6f64655365637572652f636c693f7374796c653d666f722d7468652d6261646765" alt="npm version"&gt;
    &lt;/a&gt;
    &lt;a href="https://github.com/NodeSecure/cli/blob/master/LICENSE" rel="noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/5da5c30577f938d3dce222a1cd9d4d257cf23be56461f4e22e943d5c7d1b4989/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4e6f64655365637572652f636c693f7374796c653d666f722d7468652d6261646765" alt="license"&gt;
    &lt;/a&gt;
    &lt;a href="https://api.securityscorecards.dev/projects/github.com/NodeSecure/cli" rel="nofollow noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/3e6ab8f0f8cc6b7d582fcfce4ed96a022e8b55d384a839376f82848d2dbde16d/68747470733a2f2f6170692e736563757269747973636f726563617264732e6465762f70726f6a656374732f6769746875622e636f6d2f4e6f64655365637572652f636c692f62616467653f7374796c653d666f722d7468652d6261646765" alt="ossf scorecard"&gt;
    &lt;/a&gt;
    &lt;a href="https://slsa.dev/spec/v1.0/levels#build-l3" rel="nofollow noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/6e438d6195129c64136dc231d2226d729f1a537223b8bc475907a28a17b31784/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f534c53412d6c6576656c253230332d677265656e3f7374796c653d666f722d7468652d6261646765266c6f676f3d646174613a696d6167652f706e673b6261736536342c6956424f5277304b47676f414141414e5355684555674141414134414141414f43414d414141416f6c74336a414141414247644254554541414c4750432f7868425141414143426a53464a4e414142364a6741416749514141506f41414143413641414164544141414f7067414141366d41414146334363756c4538414141424d6c424d564558764d5144764d4144774d5144774d4144774d4144764d4144764d4144774d4144774d5144764d5144764d5144774d4144774d4144764d4144774d4144774d4144774d5144764d5144764d5144774d5144764d5144774d5144774d4144774d4144774d5144774d4144774d4144764d4144764d5144764d5144774d4144774d5144774d4144764d5144774d4144774d5144774d4144774d4144774d4144774d4144774d4144774d4144764d5144764d5144774d4144774d5144774d4144764d5144764d5144774d4144764d5144764d5144774d4144774d5144774d5144774d5144764d5144774d4144764d4144774d4144774d5144764d5144774d4144774d5144774d5144774d5144774d5144764d5144764d5144764d4144774d4144764d4144764d4144764d4144774d5144774d5144764d4144764d5144764d5144764d4144764d4144764d5144774d5144764d5144764d4144764d4144764d4144764d5144774d5144764d5144764d5144764d4144764d4144774d4144764d5144764d5144764d5144764d4144774d4144774d5144774d4141414141412f486f53774141414159335253546c4d7073766e65516c5172552f4c5153577a764d35447a6d7a65463950692b4e367676726b39487550336173546150676b56466d4f337255724d6a71764c3664304c4c54566a492f50754d514e53474f57612f365955387a4e75444c69684a306536614d477a6c38733249543762366c49466b526a316d74765130654a5739357247302b5369643539782f4141414141574a4c5230526c746432496e77414141416c7753466c7a4141414f7777414144734d4278322b6f5a4141414141643053553146422b594847673074474c725461443441414143715355524256416a58593242675a45714741475957566a59476467346f6a354f4c6d346552675a63764263546846784155456b3457595241564530394f6c7043556b706152545536575930695756314255556c5a5256514d715564646753453757314e4c5331674670304e585442334b544451794e6a4532536b30334e7a4331413347523153797472473173376534646b426f67746a6b374f4c713575795443757534656e6c336379684f766a3636667648784149456d59494367344a4451755069415172456d4749696f364a6a5a4f464f6a536567534842424d704f546f78504167434a66445a432f6d324b4867414141435630525668305a4746305a54706a636d5668644755414d6a41794d6930774e7930794e6c51784d7a6f304e546f794e4373774d446f774d43384179776f414141416c6445565964475268644755366257396b61575a35414449774d6a49744d4463744d6a5a554d544d364e4455364d6a51724d4441364d44426558584f3241414141475852465748525462325a30643246795a514233643363756157357263324e686347557562334a6e6d2b3438476741414141424a52553545726b4a6767673d3d" alt="slsa level3"&gt;
    &lt;/a&gt;
    &lt;a href="https://github.com/NodeSecure/cli/actions?query=workflow%3A%22Node.js+CI%22" rel="noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/39d2523d233101413839edd6d704102daf3580b0031f122569b56533ef1a7f18/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4e6f64655365637572652f636c692f6e6f64656a732e796d6c3f7374796c653d666f722d7468652d6261646765" alt="github ci workflow"&gt;
    &lt;/a&gt;
    &lt;a href="https://codecov.io/github/NodeSecure/cli" rel="nofollow noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/a79cb943ea84e1a608d0609b6fb87de203ff3f148b45126cd3f7aa64f79984aa/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f4e6f64655365637572652f636c693f7374796c653d666f722d7468652d6261646765" alt="codecov"&gt;
    &lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/NodeSecure/cli/./docs/ui-preview.PNG"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FNodeSecure%2Fcli%2F.%2Fdocs%2Fui-preview.PNG"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;📜 Features&lt;/h2&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Run a static scan on every JavaScript files and sort out warnings (unsafe-regex, unsafe-import etc) and the complete list of required expr and statements (files, node.js module, etc.).&lt;/li&gt;
&lt;li&gt;Return complete composition for each packages (extensions, files, tarball size, etc).&lt;/li&gt;
&lt;li&gt;Packages metadata from the npm registry API (number of releases, last publish date, maintainers etc).&lt;/li&gt;
&lt;li&gt;Search for licenses files in the tarball and return the &lt;a href="https://spdx.org/licenses/" rel="nofollow noopener noreferrer"&gt;SPDX&lt;/a&gt; expression conformance of each detected licenses.&lt;/li&gt;
&lt;li&gt;Link vulnerabilities from the multiple sources like GitHub Advisory, Sonatype or Snyk using &lt;a href="https://github.com/NodeSecure/vulnera" rel="noopener noreferrer"&gt;Vulnera&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Add flags (emojis) to each packages versions to identify well known patterns and potential security threats easily.&lt;/li&gt;
&lt;li&gt;First-class support of open source security initiatives like &lt;a href="https://github.com/ossf/scorecard" rel="noopener noreferrer"&gt;OpenSSF Scorecard&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Generate security report (PDF).&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🚧 Requirements&lt;/h2&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/" rel="nofollow noopener noreferrer"&gt;Node.js&lt;/a&gt; v22 or higher&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;💃 Getting&lt;/h2&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/NodeSecure/cli" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;How can you use it? It's easy, you just have to install globally the CLI with npm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;npm i @nodesecure/cli &lt;span class="nt"&gt;-g&lt;/span&gt;

&lt;span class="c"&gt;# Analyze a remote package on the NPM Registry.&lt;/span&gt;
&lt;span class="c"&gt;# Note: also work with a private registry like gitlab or verdaccio&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;nsecure auto fastify

&lt;span class="c"&gt;# Analyze a local manifest (or local project).&lt;/span&gt;
&lt;span class="c"&gt;# -&amp;gt; omit the package name to run it at the cwd.&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /myproject
&lt;span class="nv"&gt;$ &lt;/span&gt;nsecure auto
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We have many other projects and &lt;a href="https://github.com/orgs/NodeSecure/projects/2/views/1?filterQuery=label%3A%22good+first+issue%22" rel="noopener noreferrer"&gt;many opportunities&lt;/a&gt; for you to contribute. &lt;a href="https://github.com/NodeSecure/Governance/blob/main/guides/contributor-en.md" rel="noopener noreferrer"&gt;Feel free to join us on Discord to discuss&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  👀 What's changed in v2.0.0 ?
&lt;/h2&gt;

&lt;p&gt;A lot to be honest 😆. Our initial idea was simply to improve and complete the interface (We went a bit overboard I guess 😅).&lt;/p&gt;

&lt;p&gt;One of the things that became problematic was the lack of space in the interface 😨. So we had to completely redesign the UX. I have to thank &lt;a href="https://www.linkedin.com/in/mehdi-bouchard/" rel="noopener noreferrer"&gt;Medhi Bouchard&lt;/a&gt;, who spent dozens of hours designing UI on figma (Without him all this would have been much more difficult to achieve 💪).&lt;/p&gt;

&lt;h3&gt;
  
  
  Multiple views
&lt;/h3&gt;

&lt;p&gt;This new interface offers several distinct views:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Home&lt;/strong&gt; (global informations about the project you asked to analyze).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network&lt;/strong&gt; (where we are drawing the dependency tree).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Settings&lt;/strong&gt; (which allows you to customize your experience with the tool)&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: It is also possible to switch between each view with a keyboard shortcut (which corresponds to the capitalized character).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Home view
&lt;/h3&gt;

&lt;p&gt;The home view is a replacement for the old &lt;code&gt;Global stats&lt;/code&gt; button. We have been working to bring more attention to the information.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftk892c9ocf8de9poqduf.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftk892c9ocf8de9poqduf.PNG" alt="NodeSecure UI" width="800" height="566"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To summarize the information we find in this view;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Global stats on the project (direct vs indirect, size, downloads)&lt;/li&gt;
&lt;li&gt;Licenses and Extensions&lt;/li&gt;
&lt;li&gt;Authors&lt;/li&gt;
&lt;li&gt;Global warnings (not visible in the screenshot since there is none).&lt;/li&gt;
&lt;li&gt;Links to Github and NPM.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk5m1fkg4f5zlf2xbgyum.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk5m1fkg4f5zlf2xbgyum.png" alt="NodeSecure UI" width="677" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We plan to expand this view with even more information and really cool gadgets. We also want to bring more attention and information around the creators and maintainers.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔧 Settings view
&lt;/h3&gt;

&lt;p&gt;This is the new kid in the town. There is not much to customize yet but that will come with time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftqarzdl92u1p6cf5268z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftqarzdl92u1p6cf5268z.png" alt="NodeSecure UI" width="778" height="677"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the key ideas of NodeSecure is that each developer and maintainer can customize their experience with the tool.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Some of our warnings have a lot of false positives that is real, so you will be able to ignore them if you don't find them relevant.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Eventually the options will allow to make more clear-cut decisions like tagging a maintainer's library (which will be useful during incidents like the one with &lt;code&gt;Faker.js&lt;/code&gt; or &lt;code&gt;node-ipc&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  🌎 Network view
&lt;/h3&gt;

&lt;p&gt;We have slightly improved the network view and updated the colors for something more pleasant.&lt;/p&gt;

&lt;p&gt;In version &lt;a href="https://github.com/NodeSecure/vis-network/releases/tag/v1.4.0" rel="noopener noreferrer"&gt;1.4.0 of our Vis-network&lt;/a&gt; implementation, we have also implemented different theme for parent and child nodes (What you can see in the screenshot below).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkbgwnevxd152hdz6rg8m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkbgwnevxd152hdz6rg8m.png" alt="NodeSecure UI" width="800" height="536"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: We have not abandoned the "Dark" theme. Eventually it will be possible to switch from a light to a dark theme in the settings.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  🚀 New left pannel
&lt;/h3&gt;

&lt;p&gt;We wanted to keep the spirit of the old interface where we could retrieve information about a package very quickly. However we want to avoid as much as possible the need to scroll to get the information.&lt;/p&gt;

&lt;p&gt;No more popup 💃. All information is now directly accessible in this new panel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjudw5hs384em1zcws0f5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjudw5hs384em1zcws0f5.png" alt="NodeSecure UI" width="500" height="933"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This new design is divided into the following sub-panels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Overview (Package informations, github stats, etc).&lt;/li&gt;
&lt;li&gt;Files and size (with bundlephobia).&lt;/li&gt;
&lt;li&gt;Scripts and Dependencies.&lt;/li&gt;
&lt;li&gt;Threats and issues in JavaScript source.&lt;/li&gt;
&lt;li&gt;Vulnerabilities.&lt;/li&gt;
&lt;li&gt;Licenses conformance (SPDX).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is also much more information than before. For example, I've been wanting to implement vulnerabilities in the interface for two years and it's now done:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa3t9ucd7s18r24i3vqxm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa3t9ucd7s18r24i3vqxm.png" alt="NodeSecure vulnerabilities" width="424" height="324"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: I remind you that we support multiple strategy for vulnerabilities like &lt;a href="https://www.sonatype.com/?smtNoRedir=1" rel="noopener noreferrer"&gt;Sonatype&lt;/a&gt; or &lt;a href="https://snyk.io/" rel="noopener noreferrer"&gt;Snyk&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Scripts
&lt;/h4&gt;

&lt;p&gt;This new version allows you to consult the scripts of a package. Really cool combined with the 📦 hasScript flag. Most supply chain attack uses a malicious script ... so it became important for us to be able to consult them in the UI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgoeixyvdq7jym4pbt4sp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgoeixyvdq7jym4pbt4sp.png" alt="NodeSecure scripts" width="426" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Threats in source code
&lt;/h4&gt;

&lt;p&gt;This version implements the latest release of JS-X-Ray which includes new features;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detecting weak crypto algorithm (md5, sha1 ...).&lt;/li&gt;
&lt;li&gt;Warnings now have a level of severity (like vulnerabilities).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fadl4ge6u60js1nrbkiel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fadl4ge6u60js1nrbkiel.png" alt="NodeSecure UI" width="426" height="591"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is still a lot of work to be done on the interface, especially to better visualize the faulty code. You will notice that the links to access NPM and Unpkg are now always present in the header.&lt;/p&gt;

&lt;h4&gt;
  
  
  Licenses conformance
&lt;/h4&gt;

&lt;p&gt;The information is still the same, but the design is a little more enjoyable. We have also added a small tooltip if you want to know more about SPDX.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1b3hyjff9ebiwj1uuenq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1b3hyjff9ebiwj1uuenq.png" alt="NodeSecure SPDX" width="426" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The title and file name are clickable. The first one will open the license page on the SPDX website and the second one the file itself on unpkg.&lt;/p&gt;

&lt;h4&gt;
  
  
  Others
&lt;/h4&gt;

&lt;p&gt;We have slightly improved the short descriptions of the flags and they are now clickable (this will open the wiki directly to the relevant flag).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fixmeu1439x3od874cl3b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fixmeu1439x3od874cl3b.png" alt="NodeSecure UI" width="533" height="120"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Also in the &lt;code&gt;scripts &amp;amp; dependencies&lt;/code&gt; section you will find a show/hide button on the third-party dependencies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcje8dlyb26ex0pkpy6ys.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcje8dlyb26ex0pkpy6ys.png" alt="NodeSecure UI" width="401" height="47"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Still the same behavior as in the old version, it will hide in the network all the children of the package.&lt;/p&gt;

&lt;h3&gt;
  
  
  New documentation/wiki
&lt;/h3&gt;

&lt;p&gt;We have developed a &lt;a href="https://github.com/NodeSecure/documentation-ui" rel="noopener noreferrer"&gt;brand new documentation-ui module&lt;/a&gt; that allows us to implement a wiki on any of our projects.&lt;/p&gt;

&lt;p&gt;In this new version you can open the wiki by clicking on the button with the book icon on the right side of the screen. We now also have documentation on the warnings of our static analyzer &lt;a href="https://github.com/NodeSecure/js-x-ray" rel="noopener noreferrer"&gt;JS-X-RAY&lt;/a&gt; accessible in the &lt;code&gt;SAST Warnings&lt;/code&gt; pannel of the wiki.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fib5updz7sfmgr64yuen6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fib5updz7sfmgr64yuen6.png" alt="NodeSecure wiki" width="800" height="604"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  👯 Credits
&lt;/h2&gt;

&lt;p&gt;All this work is possible thanks to the different contributors and contributions they made those last few months.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/tonygo_" rel="noopener noreferrer"&gt;Tony Gorez&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/vincentdhennin/" rel="noopener noreferrer"&gt;Vincent Dhennin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/vincentdhennin/" rel="noopener noreferrer"&gt;Antoine Coulon&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/im-codebreaker" rel="noopener noreferrer"&gt;Medhi Bouchard&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/mathieu-kahlaoui-0887a1158/" rel="noopener noreferrer"&gt;Mathieu Kahlaoui&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/blandine-r-733b34a9/" rel="noopener noreferrer"&gt;Blandine Rondel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/pierre-demailly/" rel="noopener noreferrer"&gt;Pierre demailly&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/nicolas-hallaert/" rel="noopener noreferrer"&gt;Nicolas Hallaert&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/mikael-w/" rel="noopener noreferrer"&gt;Mikael Wawrziczny&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/mbalabash" rel="noopener noreferrer"&gt;Maksim Balabash&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Their simple presence, good mood and spirit were a source of inspiration and motivation for me. Thanks you very much ❤️&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As always we move forward and evolve. We continue to work hard to improve security in the JavaScript ecosystem and we look forward to being joined by other developers with the same commitment.&lt;/p&gt;

&lt;p&gt;Thanks for reading me and see you soon for another great story!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>security</category>
      <category>opensource</category>
    </item>
    <item>
      <title>A technical tale of NodeSecure - Chapter 2</title>
      <dc:creator>Thomas.G</dc:creator>
      <pubDate>Mon, 06 Jun 2022 19:24:48 +0000</pubDate>
      <link>https://dev.to/nodesecure/a-technical-tale-of-nodesecure-chapter-2-2p17</link>
      <guid>https://dev.to/nodesecure/a-technical-tale-of-nodesecure-chapter-2-2p17</guid>
      <description>&lt;p&gt;Hello 👋,&lt;/p&gt;

&lt;p&gt;I'm back at writing for a new technical article on &lt;a href="https://github.com/NodeSecure" rel="noopener noreferrer"&gt;NodeSecure&lt;/a&gt;. This time I want to focus on the SAST &lt;a href="https://github.com/NodeSecure/js-x-ray" rel="noopener noreferrer"&gt;JS-X-Ray&lt;/a&gt; 🔬.&lt;/p&gt;

&lt;p&gt;I realized very recently that the project on Github was already more than two years old. It's amazing how time flies 😵.&lt;/p&gt;

&lt;p&gt;It's been a long time since I wanted to share my experience and feelings about AST analysis. So let's jump in 😉&lt;/p&gt;

&lt;h2&gt;
  
  
  💃 How it started
&lt;/h2&gt;

&lt;p&gt;When I started the NodeSecure project I had almost no experience 🐤 with AST (Abstract Syntax Tree). My first time was on the &lt;a href="https://github.com/SlimIO" rel="noopener noreferrer"&gt;SlimIO&lt;/a&gt; project to generate codes dynamically with the &lt;a href="https://www.npmjs.com/package/astring" rel="noopener noreferrer"&gt;astring&lt;/a&gt; package (and I had also looked at the &lt;a href="https://github.com/estree/estree" rel="noopener noreferrer"&gt;ESTree&lt;/a&gt; specification).&lt;/p&gt;

&lt;p&gt;One of my first goals for my tool was to be able to retrieve the dependencies in each JavaScript file contained within an NPM tarball (By this I mean able to retrieve any dependencies imported in CJS or ESM). &lt;/p&gt;

&lt;p&gt;I started the subject a bit naively 😏 and very quickly I set myself a challenge to achieve with my AST analyser:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;unhex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hex&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;return this&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cess&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;evil&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mainMod&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;ule&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="nf"&gt;unhex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;72657175697265&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)];&lt;/span&gt;
&lt;span class="nf"&gt;evil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;unhex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;68747470&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The goal is to be able to output accurate information for the above code. At the time I didn't really know what I was getting into 😂 (But I was passionate about it and I remain excited about it today).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I thank &lt;a href="https://twitter.com/targos89" rel="noopener noreferrer"&gt;Targos&lt;/a&gt; who at the time submitted a lot of code and ideas.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To date the SAST is able to follow this kind of code without any difficulties 😎... But it wasn't always that simple.&lt;/p&gt;
&lt;h2&gt;
  
  
  🐤 Baby steps
&lt;/h2&gt;

&lt;p&gt;One of the first things I learned was to browse the tree. Even for me today this seems rather obvious, but it wasn't necessarily so at the time 😅.&lt;/p&gt;

&lt;p&gt;I discovered the package &lt;a href="https://github.com/Rich-Harris/estree-walker#readme" rel="noopener noreferrer"&gt;estree-walker&lt;/a&gt; from Rich Harris which was compatible with the &lt;a href="https://github.com/estree/estree" rel="noopener noreferrer"&gt;EStree&lt;/a&gt; spec. Combined with the &lt;a href="https://github.com/meriyah/meriyah" rel="noopener noreferrer"&gt;meriyah&lt;/a&gt; package this allows me to convert a JavaScript source into an ESTree compliant AST.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;readFile&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;node:fs/promises&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;walk&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;estree-walker&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;meriyah&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;meriyah&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;scanFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;strToAnalyze&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;utf-8&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;meriyah&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parseScript&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;strToAnalyze&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;next&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;loc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;raw&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;module&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="nf"&gt;walk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;enter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// Skip the root of the AST.&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isArray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;

      &lt;span class="c1"&gt;// DO THE WORK HERE&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;I also quickly became familiar with the tool &lt;a href="https://astexplorer.net/" rel="noopener noreferrer"&gt;ASTExplorer&lt;/a&gt; which allows you to analyze the tree and properties for a specific code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjl41utklnepxf154tvlp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjl41utklnepxf154tvlp.png" alt="nodesecure" width="800" height="514"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a beginner, you can be quickly scared by the size and complexity of an AST. This tool is super important to better cut out and focus on what is important.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I also had fun &lt;a href="https://github.com/fraxken/Node-Estree" rel="noopener noreferrer"&gt;re-implementing&lt;/a&gt; the ESTree Specification in TypeScript. It helped me a lot to be more confident and comfortable with different concepts that were unknown to me until then.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;At the beginning of 2021 I also had the opportunity to do a talk for the French JS community (it's one more opportunity to study).&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/zSYrEbggqWA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;
&lt;h2&gt;
  
  
  😫 MemberExpression
&lt;/h2&gt;

&lt;p&gt;JavaScript member expression can be quite complicated to deal with at first. You must be comfortable with recursion and be ready to face a lot of possibilities.&lt;/p&gt;

&lt;p&gt;Here is an example of possible code:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;myVar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bar&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;lo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;myVar&lt;/span&gt;&lt;span class="p"&gt;]();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvp3f2ls3eshnlml3xdv0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvp3f2ls3eshnlml3xdv0.png" alt="nodesecure" width="786" height="513"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Computed property, Binary expression, Call expression etc. The order in which the tree is built seemed unintuitive to me at first (and I had a hard time figuring out how to use the &lt;code&gt;object&lt;/code&gt; and &lt;code&gt;property&lt;/code&gt; properties).&lt;/p&gt;

&lt;p&gt;Since i created my own set of AST utilities including &lt;a href="https://github.com/NodeSecure/estree-ast-utils/blob/main/src/getMemberExpressionIdentifier.js" rel="noopener noreferrer"&gt;getMemberExpressionIdentifier&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  🚀 A new package (with its own API)
&lt;/h2&gt;

&lt;p&gt;When NodeSecure was a single project the AST analysis was at most a &lt;a href="https://github.com/NodeSecure/cli/blob/60b52b1a60f9ac2ddc85f3cbad009adad590e56a/src/ast/index.js" rel="noopener noreferrer"&gt;few hundred lines in two or three JavaScript files&lt;/a&gt;. All the logic was coded with if and else conditions directly in the walker 🙈.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frn9hoqpzqvzjgzwe4m91.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frn9hoqpzqvzjgzwe4m91.png" alt="nodesecure" width="800" height="616"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To evolve and maintain the project, it became necessary to separate the code and make it a standalone package with its own API 👀.&lt;/p&gt;

&lt;p&gt;I wrote an article at the time that &lt;strong&gt;I invite you to read&lt;/strong&gt;. It contains some nice little explanations:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="/nodesecure" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F6062%2F43c0ffd0-bc13-4c49-8846-ce3efbdafd52.png" alt="NodeSecure" width="200" height="200"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F314815%2F128a0b56-a103-4bc8-92b6-ce3738e98770.jpg" alt="" width="400" height="400"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/nodesecure/node-secure-js-x-ray-4jk0" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;JS-X-Ray 1.0&lt;/h2&gt;
      &lt;h3&gt;Thomas.G for NodeSecure ・ Mar 30 '20&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#node&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#ast&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;p&gt;The thing to remember here is that you probably shouldn't be afraid to start small and grow into something bigger later. Stay pragmatic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Easy to write, hard to scale 😭
&lt;/h2&gt;

&lt;p&gt;It's easy to write a little prototype, but it's really hard to make it scale when you have to handle dozens or hundreds of possibilities. It requires a mastery and understanding of the language that is just crazy 😵. This is really what makes creating a SAST a complicated task.&lt;/p&gt;

&lt;p&gt;For example, do you know how many possibilities there are to require on Node.js? In CJS alone:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;require&lt;/li&gt;
&lt;li&gt;process.mainModule.require&lt;/li&gt;
&lt;li&gt;require.main.require&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;I probably forget some 😈 (as a precaution I also trace methods like require.resolve).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But as far as I'm concerned, it's really what I find exciting 😍. I've learned so much in three years. All this also allowed me to approach the language from an angle that I had never experienced or seen 👀.&lt;/p&gt;

&lt;h3&gt;
  
  
  Probes
&lt;/h3&gt;

&lt;p&gt;On JS-X-Ray I brought the notion of "probe" into the code which will collect information on one or more specific node. The goal is to separate the AST analysis into lots of smaller pieces that are easier to understand, document and test.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Very far from perfection 😞. However, it is much better than before and the team is now helping me to improve all this (by adding documentation and tests).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It was for JS-X-Ray 3.0.0 and at the time i have written the following article (which includes many more details if you are interested).&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__link"&gt;
  &lt;a href="/nodesecure" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F6062%2F43c0ffd0-bc13-4c49-8846-ce3efbdafd52.png" alt="NodeSecure" width="200" height="200"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F314815%2F128a0b56-a103-4bc8-92b6-ce3738e98770.jpg" alt="" width="400" height="400"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/nodesecure/js-x-ray-3-0-0-3ddn" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;JS-X-Ray 3.0&lt;/h2&gt;
      &lt;h3&gt;Thomas.G for NodeSecure ・ Feb 28 '21&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#node&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#opensource&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;h3&gt;
  
  
  VariableTracer
&lt;/h3&gt;

&lt;p&gt;This is one of the &lt;a href="https://github.com/NodeSecure/estree-ast-utils/blob/main/src/utils/VariableTracer.js" rel="noopener noreferrer"&gt;new killer feature&lt;/a&gt; coming to JS-X-Ray soon. A code able to follow the declarations, assignment, destructuration, importating of any identifiers or member expression.&lt;/p&gt;

&lt;p&gt;In my experience being able to keep track of assignments has been one of the most complex tasks (and I've struggled with it).&lt;/p&gt;

&lt;p&gt;This new implementation/API will offer a new spectrum of tools to develop really cool new features.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tracer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;VariableTracer&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;trace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;crypto.createHash&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;followConsecutiveAssignment&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Use this in the tree walker&lt;/span&gt;
&lt;span class="nx"&gt;tracer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;walk&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;node&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This simple code will allow us, for example, to know each time the method createHash is used. We can use this for information purposes, for example to warn on the usage of a deprecated hash algorithm like md5.&lt;/p&gt;

&lt;p&gt;Here an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;myModule&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;crypto&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;myMethodName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;createHash&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;callMe&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;myModule&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;myMethodName&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nf"&gt;callMe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;md5&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The goal is not necessarily to track or read malicious code. The idea is to handle enough cases because developers use JavaScript in many ways.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We can imagine and implement a lot of new scenarios without worries 😍.&lt;/p&gt;

&lt;p&gt;By default we are tracing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;eval and Function&lt;/li&gt;
&lt;li&gt;require, require.resolve, require.main, require.mainModule.require&lt;/li&gt;
&lt;li&gt;Global variables (global, globalThis, root, GLOBAL, window).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ✨ Conclusion
&lt;/h2&gt;

&lt;p&gt;Unfortunately, I could not cover everything as the subject is so vast. One piece of advice I would give to anyone starting out on a similar topic would be to be much more rigorous about documentation and testing. It can be very easy to get lost and not know why we made a choice X or Y.&lt;/p&gt;

&lt;p&gt;Thanks for reading this new technical article. See you soon for a new article (something tells me that it will arrive soon 😏).&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>security</category>
      <category>opensource</category>
    </item>
    <item>
      <title>NodeSecure - What's new in 2022 ?</title>
      <dc:creator>Thomas.G</dc:creator>
      <pubDate>Mon, 07 Feb 2022 18:10:40 +0000</pubDate>
      <link>https://dev.to/nodesecure/nodesecure-whats-new-in-2022--4da7</link>
      <guid>https://dev.to/nodesecure/nodesecure-whats-new-in-2022--4da7</guid>
      <description>&lt;p&gt;Hello 👋,&lt;/p&gt;

&lt;p&gt;Back for a different article than usual. This is the opportunity for me to talk about the NodeSecure project and to tell you about what's new since the beginning of the year 💃.&lt;/p&gt;

&lt;p&gt;The project has grown significantly and we are now several active contributors on the project 😍. This opens up great opportunities for the organization and our tools as a whole.&lt;/p&gt;

&lt;p&gt;Above all, many thanks to all those who participate in this adventure 😘. If you also follow the project and want to contribute and learn, do not hesitate 🙌.&lt;/p&gt;

&lt;h2&gt;
  
  
  Release 1.0.0 🚀
&lt;/h2&gt;

&lt;p&gt;We have moved and renamed the main project. It became necessary to bring the project into the org to allow everyone to discover our other tools.&lt;/p&gt;

&lt;p&gt;Now available on the NodeSecure github under the &lt;strong&gt;cli&lt;/strong&gt; name. The old package has been deprecated and the new release can be downloaded with the name &lt;code&gt;@nodesecure/cli&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Changing the name was necessary. It all started with one tool but now NodeSecure is a family of tools, contributors 👯 etc.&lt;/p&gt;

&lt;p&gt;This also marks the beginning of the first major release 🎉.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @nodesecure/cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/NodeSecure" rel="noopener noreferrer"&gt;
        NodeSecure
      &lt;/a&gt; / &lt;a href="https://github.com/NodeSecure/cli" rel="noopener noreferrer"&gt;
        cli
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      JavaScript security CLI that allow you to deeply analyze the dependency tree of a given package or local Node.js project.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;
  🐢 Node-Secure CLI 🚀
&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;
  a Node.js CLI to deeply analyze the dependency tree of a given NPM package or Node.js local app
&lt;/p&gt;

&lt;p&gt;
    &lt;a href="https://www.npmjs.com/package/@nodesecure/cli" rel="nofollow noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/a2426a4c17f17920d8d729dc7e98151a94f25c34f3536685646337c36f225f8b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7061636b6167652d6a736f6e2f762f4e6f64655365637572652f636c693f7374796c653d666f722d7468652d6261646765" alt="npm version"&gt;
    &lt;/a&gt;
    &lt;a href="https://github.com/NodeSecure/cli/blob/master/LICENSE" rel="noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/5da5c30577f938d3dce222a1cd9d4d257cf23be56461f4e22e943d5c7d1b4989/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4e6f64655365637572652f636c693f7374796c653d666f722d7468652d6261646765" alt="license"&gt;
    &lt;/a&gt;
    &lt;a href="https://api.securityscorecards.dev/projects/github.com/NodeSecure/cli" rel="nofollow noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/3e6ab8f0f8cc6b7d582fcfce4ed96a022e8b55d384a839376f82848d2dbde16d/68747470733a2f2f6170692e736563757269747973636f726563617264732e6465762f70726f6a656374732f6769746875622e636f6d2f4e6f64655365637572652f636c692f62616467653f7374796c653d666f722d7468652d6261646765" alt="ossf scorecard"&gt;
    &lt;/a&gt;
    &lt;a href="https://slsa.dev/spec/v1.0/levels#build-l3" rel="nofollow noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/6e438d6195129c64136dc231d2226d729f1a537223b8bc475907a28a17b31784/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f534c53412d6c6576656c253230332d677265656e3f7374796c653d666f722d7468652d6261646765266c6f676f3d646174613a696d6167652f706e673b6261736536342c6956424f5277304b47676f414141414e5355684555674141414134414141414f43414d414141416f6c74336a414141414247644254554541414c4750432f7868425141414143426a53464a4e414142364a6741416749514141506f41414143413641414164544141414f7067414141366d41414146334363756c4538414141424d6c424d564558764d5144764d4144774d5144774d4144774d4144764d4144764d4144774d4144774d5144764d5144764d5144774d4144774d4144764d4144774d4144774d4144774d5144764d5144764d5144774d5144764d5144774d5144774d4144774d4144774d5144774d4144774d4144764d4144764d5144764d5144774d4144774d5144774d4144764d5144774d4144774d5144774d4144774d4144774d4144774d4144774d4144774d4144764d5144764d5144774d4144774d5144774d4144764d5144764d5144774d4144764d5144764d5144774d4144774d5144774d5144774d5144764d5144774d4144764d4144774d4144774d5144764d5144774d4144774d5144774d5144774d5144774d5144764d5144764d5144764d4144774d4144764d4144764d4144764d4144774d5144774d5144764d4144764d5144764d5144764d4144764d4144764d5144774d5144764d5144764d4144764d4144764d4144764d5144774d5144764d5144764d5144764d4144764d4144774d4144764d5144764d5144764d5144764d4144774d4144774d5144774d4141414141412f486f53774141414159335253546c4d7073766e65516c5172552f4c5153577a764d35447a6d7a65463950692b4e367676726b39487550336173546150676b56466d4f337255724d6a71764c3664304c4c54566a492f50754d514e53474f57612f365955387a4e75444c69684a306536614d477a6c38733249543762366c49466b526a316d74765130654a5739357247302b5369643539782f4141414141574a4c5230526c746432496e77414141416c7753466c7a4141414f7777414144734d4278322b6f5a4141414141643053553146422b594847673074474c725461443441414143715355524256416a58593242675a45714741475957566a59476467346f6a354f4c6d346552675a63764263546846784155456b3457595241564530394f6c7043556b706152545536575930695756314255556c5a5256514d715564646753453757314e4c5331674670304e585442334b544451794e6a4532536b30334e7a4331413347523153797472473173376534646b426f67746a6b374f4c713575795443757534656e6c336379684f766a3636667648784149456d59494367344a4451755069415172456d4749696f364a6a5a4f464f6a536567534842424d704f546f78504167434a66445a432f6d324b4867414141435630525668305a4746305a54706a636d5668644755414d6a41794d6930774e7930794e6c51784d7a6f304e546f794e4373774d446f774d43384179776f414141416c6445565964475268644755366257396b61575a35414449774d6a49744d4463744d6a5a554d544d364e4455364d6a51724d4441364d44426558584f3241414141475852465748525462325a30643246795a514233643363756157357263324e686347557562334a6e6d2b3438476741414141424a52553545726b4a6767673d3d" alt="slsa level3"&gt;
    &lt;/a&gt;
    &lt;a href="https://github.com/NodeSecure/cli/actions?query=workflow%3A%22Node.js+CI%22" rel="noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/39d2523d233101413839edd6d704102daf3580b0031f122569b56533ef1a7f18/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4e6f64655365637572652f636c692f6e6f64656a732e796d6c3f7374796c653d666f722d7468652d6261646765" alt="github ci workflow"&gt;
    &lt;/a&gt;
    &lt;a href="https://codecov.io/github/NodeSecure/cli" rel="nofollow noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/a79cb943ea84e1a608d0609b6fb87de203ff3f148b45126cd3f7aa64f79984aa/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f4e6f64655365637572652f636c693f7374796c653d666f722d7468652d6261646765" alt="codecov"&gt;
    &lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;a rel="noopener noreferrer" href="https://github.com/NodeSecure/cli/./docs/ui-preview.PNG"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FNodeSecure%2Fcli%2F.%2Fdocs%2Fui-preview.PNG"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;📜 Features&lt;/h2&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Run a static scan on every JavaScript files and sort out warnings (unsafe-regex, unsafe-import etc) and the complete list of required expr and statements (files, node.js module, etc.).&lt;/li&gt;
&lt;li&gt;Return complete composition for each packages (extensions, files, tarball size, etc).&lt;/li&gt;
&lt;li&gt;Packages metadata from the npm registry API (number of releases, last publish date, maintainers etc).&lt;/li&gt;
&lt;li&gt;Search for licenses files in the tarball and return the &lt;a href="https://spdx.org/licenses/" rel="nofollow noopener noreferrer"&gt;SPDX&lt;/a&gt; expression conformance of each detected licenses.&lt;/li&gt;
&lt;li&gt;Link vulnerabilities from the multiple sources like GitHub Advisory, Sonatype or Snyk using &lt;a href="https://github.com/NodeSecure/vulnera" rel="noopener noreferrer"&gt;Vulnera&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Add flags (emojis) to each packages versions to identify well known patterns and potential security threats easily.&lt;/li&gt;
&lt;li&gt;First-class support of open source security initiatives like &lt;a href="https://github.com/ossf/scorecard" rel="noopener noreferrer"&gt;OpenSSF Scorecard&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Generate security report (PDF).&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;🚧 Requirements&lt;/h2&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/" rel="nofollow noopener noreferrer"&gt;Node.js&lt;/a&gt; v22 or higher&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;💃 Getting&lt;/h2&gt;…&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/NodeSecure/cli" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;And by the way: this new release include support for Workspaces with the &lt;code&gt;cwd&lt;/code&gt; command 😎.&lt;/p&gt;

&lt;h2&gt;
  
  
  NodeSecure ci 📟
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5xdmuy9dab5ggkyrkcnc.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5xdmuy9dab5ggkyrkcnc.gif" alt=" " width="600" height="410"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;A remarkable work from &lt;a href="https://github.com/antoine-coulon" rel="noopener noreferrer"&gt;Antoine&lt;/a&gt; who has been actively working on the project for a good month 💪. This will bring a whole new dimension to the NodeSecure project and meet to at least some needs long requested by developers.&lt;/p&gt;

&lt;p&gt;He wrote an article to present the tool and explain how to set it up 👀, I recommend you to read it:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/nodesecure" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F6062%2F43c0ffd0-bc13-4c49-8846-ce3efbdafd52.png" alt="NodeSecure" width="200" height="200"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F702314%2Fecb88ea8-6968-4326-82d1-8c9a97273a30.jpeg" alt="" width="800" height="1066"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/nodesecure/make-your-javascript-project-safer-by-using-this-workflow-403a" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;🔒 Make your JavaScript project safer by using this workflow&lt;/h2&gt;
      &lt;h3&gt;Antoine Coulon for NodeSecure ・ Feb 1 '22&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#node&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#cicd&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;There is still work to do, don't hesitate to come and contribute to this beautiful project which promises a lot for the future.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/NodeSecure" rel="noopener noreferrer"&gt;
        NodeSecure
      &lt;/a&gt; / &lt;a href="https://github.com/NodeSecure/ci" rel="noopener noreferrer"&gt;
        ci
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      NodeSecure tool enabling secured continuous integration
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Secure Continuous Integration&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/4438263/226020356-5790c025-bff1-40d5-b847-360863f53a9a.jpg"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F4438263%2F226020356-5790c025-bff1-40d5-b847-360863f53a9a.jpg" alt="ci-banner"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/8e02dd38b599304b8ba48434b9587e0e52299b82b3e38efd364d2329594ca4e4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64796e616d69632f6a736f6e2e7376673f7374796c653d666f722d7468652d62616467652675726c3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f4e6f64655365637572652f63692f6d61737465722f7061636b6167652e6a736f6e2671756572793d242e76657273696f6e266c6162656c3d56657273696f6e"&gt;&lt;img src="https://camo.githubusercontent.com/8e02dd38b599304b8ba48434b9587e0e52299b82b3e38efd364d2329594ca4e4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64796e616d69632f6a736f6e2e7376673f7374796c653d666f722d7468652d62616467652675726c3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f4e6f64655365637572652f63692f6d61737465722f7061636b6167652e6a736f6e2671756572793d242e76657273696f6e266c6162656c3d56657273696f6e" alt="version"&gt;&lt;/a&gt;
&lt;a href="https://github.com/NodeSecure/ci/graphs/commit-activity" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/8673e90d546a2c5ead6be528f7f7978f877d3f64205f10b19ad02e2d0d6726d0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61696e7461696e65642533462d7965732d677265656e2e7376673f7374796c653d666f722d7468652d6261646765" alt="Maintenance"&gt;&lt;/a&gt;
&lt;a href="https://api.securityscorecards.dev/projects/github.com/NodeSecure/ci" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/a3fba019f1507b648f169daf7924399d99ec1e31f1a1b064ba4d6d48202da7b7/68747470733a2f2f6170692e736563757269747973636f726563617264732e6465762f70726f6a656374732f6769746875622e636f6d2f4e6f64655365637572652f63692f62616467653f7374796c653d666f722d7468652d6261646765" alt="OpenSSF Scorecard"&gt;&lt;/a&gt;
&lt;a href="https://github.com/NodeSecure/ci/blob/master/LICENSE" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/e8a9e8cbbf06c5cb697f31eb426f1b15c60ff5016cd9dc6638daf1d518f4b68d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4e6f64655365637572652f63692e7376673f7374796c653d666f722d7468652d6261646765" alt="mit"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/e821fb28214529ebb016fdcf833eef0afd83d57ef36df35c801607003a1790c2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4e6f64655365637572652f63692f6e6f64652e6a732e796d6c3f7374796c653d666f722d7468652d6261646765"&gt;&lt;img src="https://camo.githubusercontent.com/e821fb28214529ebb016fdcf833eef0afd83d57ef36df35c801607003a1790c2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4e6f64655365637572652f63692f6e6f64652e6a732e796d6c3f7374796c653d666f722d7468652d6261646765" alt="build"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installation&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;This package is available in the Node Package Repository and can be easily installed with &lt;a href="https://docs.npmjs.com/getting-started/what-is-npm" rel="nofollow noopener noreferrer"&gt;npm&lt;/a&gt; or &lt;a href="https://yarnpkg.com" rel="nofollow noopener noreferrer"&gt;yarn&lt;/a&gt;.&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ npm i @nodesecure/ci
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; or&lt;/span&gt;
$ yarn add @nodesecure/ci&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Getting Started&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;@nodesecure/ci brings together a set of tools to identify dependencies vulnerabilities and track most common malicious code and patterns.&lt;/p&gt;
&lt;p&gt;Before going further, here is an overview of the available features depending on your project configuration:&lt;/p&gt;
&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Static Analysis&lt;/th&gt;
&lt;th&gt;Compatibility&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;JavaScript&lt;/td&gt;
&lt;td&gt;✅&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TypeScript&lt;/td&gt;
&lt;td&gt;❌&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;p&gt;Static Analysis is powered by &lt;a href="https://github.com/NodeSecure/js-x-ray" rel="noopener noreferrer"&gt;@nodesecure/js-x-ray&lt;/a&gt; and &lt;a href="https://github.com/NodeSecure/scanner" rel="noopener noreferrer"&gt;@nodesecure/scanner&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For now, TypeScript can't directly be analyzed on the fly. However as you might know, any transpiled TypeScript code is JavaScript code hence can be analyzed
Moreover, it is recommended to launch the Static Analysis with a source code state as
close as possible to the state of your production code (and before minification).
In fact, you want to make sure that you are…&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/NodeSecure/ci" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  NodeSecure preview
&lt;/h2&gt;

&lt;p&gt;Working on security accessibility for developers within the JavaScript ecosystem is important to us.&lt;/p&gt;

&lt;p&gt;This is why &lt;a href="https://tonygo.dev/" rel="noopener noreferrer"&gt;Tony Gorez&lt;/a&gt; has taken it upon himself to design the Preview project which will allow to scan online npm packages. We still have some difficulties to put it online but we are working on it.&lt;/p&gt;

&lt;p&gt;The goal of the project is to highlight some of the benefits and metrics reported by the NodeSecure tools and why not make more developers sensitive to security subjects.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/NodeSecure" rel="noopener noreferrer"&gt;
        NodeSecure
      &lt;/a&gt; / &lt;a href="https://github.com/NodeSecure/preview" rel="noopener noreferrer"&gt;
        preview
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Scan your node packages in your browser!
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-alert markdown-alert-caution"&gt;
&lt;p class="markdown-alert-title"&gt;Caution&lt;/p&gt;
&lt;p&gt;This project is not maintained anymore. We plan to implement a &lt;a href="https://github.com/NodeSecure/cli/issues/270" rel="noopener noreferrer"&gt;search mode&lt;/a&gt; in the NodeSecure CLI&lt;/p&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🕸 Preview&lt;/h1&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/7befb1aa87a764ce59a042f913d665a9e5040c8f910de2268ab764d6fda02ac2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64796e616d69632f6a736f6e2e7376673f7374796c653d666f722d7468652d62616467652675726c3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f4e6f64655365637572652f707265766965772f6d61737465722f7061636b6167652e6a736f6e2671756572793d242e76657273696f6e266c6162656c3d56657273696f6e"&gt;&lt;img src="https://camo.githubusercontent.com/7befb1aa87a764ce59a042f913d665a9e5040c8f910de2268ab764d6fda02ac2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64796e616d69632f6a736f6e2e7376673f7374796c653d666f722d7468652d62616467652675726c3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f4e6f64655365637572652f707265766965772f6d61737465722f7061636b6167652e6a736f6e2671756572793d242e76657273696f6e266c6162656c3d56657273696f6e" alt="version"&gt;&lt;/a&gt;
&lt;a href="https://github.com/NodeSecure/preview/graphs/commit-activity" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/a3953dd71fa5e1629feb55cbf95b4b6058e0055a5c32cbc228abe01fd4e30ff9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61696e7461696e65642533462d6e6f2d7265642e7376673f7374796c653d666f722d7468652d6261646765" alt="Maintenance"&gt;&lt;/a&gt;
&lt;a href="https://api.securityscorecards.dev/projects/github.com/NodeSecure/preview" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/7690a6477680c3cf35d0832d7500234819d8e88c2714e2ba24c7fb69709ac43e/68747470733a2f2f6170692e736563757269747973636f726563617264732e6465762f70726f6a656374732f6769746875622e636f6d2f4e6f64655365637572652f707265766965772f62616467653f7374796c653d666f722d7468652d6261646765" alt="OpenSSF Scorecard"&gt;&lt;/a&gt;
&lt;a href="https://github.com/NodeSecure/preview/blob/main/LICENSE" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/660c20f9e28d6da622c2f80d11830004b9310d9a8c316142f534a085a024552c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4e6f64655365637572652f707265766965772e7376673f7374796c653d666f722d7468652d6261646765" alt="mit"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/06ef62bcde5a08b993fa1cd64ab7d28683c8345747d2c79e7519893eae8c6e3b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4e6f64655365637572652f707265766965772f636865636b2e796d6c3f7374796c653d666f722d7468652d6261646765"&gt;&lt;img src="https://camo.githubusercontent.com/06ef62bcde5a08b993fa1cd64ab7d28683c8345747d2c79e7519893eae8c6e3b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4e6f64655365637572652f707265766965772f636865636b2e796d6c3f7374796c653d666f722d7468652d6261646765" alt="build"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Light NodeSecure in browser&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Find your package weaknesses!&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/NodeSecure/preview/./preview.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FNodeSecure%2Fpreview%2F.%2Fpreview.png" alt="preview"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;⚡️ Features&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;This project aims to help newcomers to understand the benefits of &lt;a href="http://github.com/NodeSecure" rel="noopener noreferrer"&gt;NodeSecure&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;👩‍🚀 On demand analysis&lt;/li&gt;
&lt;li&gt;🏋️‍♀️ Package size &amp;amp; dependency count&lt;/li&gt;
&lt;li&gt;⛳️ Vulnerability flags&lt;/li&gt;
&lt;li&gt;🕐 Browser caching&lt;/li&gt;
&lt;li&gt;👑 Powered by &lt;a href="http://github.com/NodeSecure/scanner" rel="noopener noreferrer"&gt;NodeSecure/scanner&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Contributing&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;First, install dependencies&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ npm i&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Run the development server:&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ npm run dev&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Open &lt;a href="http://localhost:3000" rel="nofollow noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt; with your browser to see the result.&lt;/p&gt;
&lt;p&gt;Run e2e test:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;First, install playwright.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ npx playwright install&lt;/pre&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Then, run the tests ^^&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ npm run test:e2e&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Contributors ✨&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://github.com/NodeSecure/preview#contributors-" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/f7e7ee5949a35d448797601f9193f3e6b8108dc258029dad8457e109c52b4a41/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f616c6c5f636f6e7472696275746f72732d342d6f72616e67652e7376673f7374796c653d666c61742d737175617265" alt="All Contributors"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks goes to these wonderful people (&lt;a href="https://allcontributors.org/docs/en/emoji-key" rel="nofollow noopener noreferrer"&gt;emoji key&lt;/a&gt;):&lt;/p&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tbody&gt;
&lt;tr&gt;
    &lt;td&gt;
&lt;a href="http://tonygo.dev" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F22824417%3Fv%3D4%3Fs%3D100" width="100px;" alt=""&gt;&lt;br&gt;&lt;b&gt;Tony Gorez&lt;/b&gt;&lt;/a&gt;&lt;br&gt;&lt;a href="https://github.com/NodeSecure/preview/commits?author=tony-go" title="Code" rel="noopener noreferrer"&gt;💻&lt;/a&gt; &lt;a href="https://github.com/NodeSecure/preview/commits?author=tony-go" title="Documentation" rel="noopener noreferrer"&gt;📖&lt;/a&gt; &lt;a href="https://github.com/NodeSecure/preview/pulls?q=is%3Apr+reviewed-by%3Atony-go" title="Reviewed Pull Requests" rel="noopener noreferrer"&gt;👀&lt;/a&gt; &lt;a href="https://github.com/NodeSecure/preview/issues?q=author%3Atony-go" title="Bug reports" rel="noopener noreferrer"&gt;🐛&lt;/a&gt;
&lt;/td&gt;
    &lt;td&gt;
&lt;a href="https://www.linkedin.com/in/thomas-gentilhomme/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F4438263%3Fv%3D4%3Fs%3D100" width="100px;" alt=""&gt;&lt;br&gt;&lt;b&gt;Gentilhomme&lt;/b&gt;&lt;/a&gt;&lt;br&gt;&lt;a href="https://github.com/NodeSecure/preview/pulls?q=is%3Apr+reviewed-by%3Afraxken" title="Reviewed Pull Requests" rel="noopener noreferrer"&gt;👀&lt;/a&gt; &lt;a href="https://github.com/NodeSecure/preview/issues?q=author%3Afraxken" title="Bug reports" rel="noopener noreferrer"&gt;🐛&lt;/a&gt;
&lt;/td&gt;
    &lt;td&gt;
&lt;a href="https://github.com/MehdiHan" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F53506859%3Fv%3D4%3Fs%3D100" width="100px;" alt=""&gt;&lt;br&gt;&lt;b&gt;im_codebreaker&lt;/b&gt;&lt;/a&gt;&lt;br&gt;&lt;a href="https://github.com/NodeSecure/preview/commits?author=MehdiHan" title="Code" rel="noopener noreferrer"&gt;💻&lt;/a&gt;
&lt;/td&gt;
    &lt;td&gt;
&lt;a href="https://github.com/viterb-c" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F11444888%3Fv%3D4%3Fs%3D100" width="100px;" alt=""&gt;&lt;br&gt;&lt;b&gt;Charles Viterbo&lt;/b&gt;&lt;/a&gt;&lt;br&gt;&lt;a href="https://github.com/NodeSecure/preview/commits?author=viterb-c" title="Code" rel="noopener noreferrer"&gt;💻&lt;/a&gt; &lt;a href="https://github.com/NodeSecure/preview/issues?q=author%3Aviterb-c" title="Bug reports" rel="noopener noreferrer"&gt;🐛&lt;/a&gt;
&lt;/td&gt;
  &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;License&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;MIT&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/NodeSecure/preview" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;h2&gt;
  
  
  NodeSecure authors
&lt;/h2&gt;

&lt;p&gt;In light of the recent events with Marak Squares it is I think quite important to have some insight on the maintainers of the packages we use.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/fraxken" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F314815%2F128a0b56-a103-4bc8-92b6-ce3738e98770.jpg" alt="fraxken"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/fraxken/detect-marak-squires-packages-with-nodesecure-3lpo" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Detect Marak Squires packages with NodeSecure&lt;/h2&gt;
      &lt;h3&gt;Thomas.G ・ Jan 10 '22&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#node&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;We must have better tools to warn developers in case of incident like Faker. But also to highlight these maintainers who also need funding.&lt;/p&gt;

&lt;p&gt;This could also allow some developers to realize the dependence they have on certain projects and why not encourage them to contribute to help.&lt;/p&gt;

&lt;p&gt;That's why we are working on a new package with &lt;a href="https://github.com/Kawacrepe" rel="noopener noreferrer"&gt;Vincent Dhennin&lt;/a&gt; to optimize and fetch additional metadata for package authors. &lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/NodeSecure" rel="noopener noreferrer"&gt;
        NodeSecure
      &lt;/a&gt; / &lt;a href="https://github.com/NodeSecure/authors" rel="noopener noreferrer"&gt;
        authors
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      DEPRECATED (replaced by @nodesecure/contact)
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;NodeSecure authors&lt;/h1&gt;
&lt;/div&gt;
&lt;div class="markdown-alert markdown-alert-caution"&gt;
&lt;p class="markdown-alert-title"&gt;Caution&lt;/p&gt;
&lt;p&gt;This project (package) has been re-implemented/replaced in &lt;a href="https://github.com/NodeSecure/scanner" rel="noopener noreferrer"&gt;Scanner&lt;/a&gt; monorepo, &lt;a href="https://github.com/NodeSecure/scanner/tree/master/workspaces/contact" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Requirements&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/" rel="nofollow noopener noreferrer"&gt;Node.js&lt;/a&gt; v18 or higher&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Getting Started&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;This package is available in the Node Package Repository and can be easily installed with &lt;a href="https://docs.npmjs.com/getting-started/what-is-npm" rel="nofollow noopener noreferrer"&gt;npm&lt;/a&gt; or &lt;a href="https://yarnpkg.com" rel="nofollow noopener noreferrer"&gt;yarn&lt;/a&gt;.&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ npm i @nodesecure/authors
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; or&lt;/span&gt;
$ yarn add @nodesecure/authors&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Usage example&lt;/h2&gt;

&lt;/div&gt;
&lt;div class="highlight highlight-source-js notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt; &lt;span class="pl-s1"&gt;extractAllAuthorsFromLibrary&lt;/span&gt; &lt;span class="pl-kos"&gt;}&lt;/span&gt; &lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s"&gt;"@nodesecure/authors"&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;

&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;flaggedAuthors&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-kos"&gt;[&lt;/span&gt;&lt;span class="pl-kos"&gt;{&lt;/span&gt; &lt;span class="pl-c1"&gt;name&lt;/span&gt;: &lt;span class="pl-s"&gt;"Blake Embrey"&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt; &lt;span class="pl-c1"&gt;email&lt;/span&gt;: &lt;span class="pl-s"&gt;"hello@blakeembrey.com"&lt;/span&gt; &lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;span class="pl-kos"&gt;]&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;

&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;authors&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-en"&gt;extractAllAuthorsFromLibrary&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;library&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt; &lt;span class="pl-s1"&gt;flaggedAuthors&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
&lt;span class="pl-c"&gt;// Expect authors to be following this schema&lt;/span&gt;
&lt;span class="pl-c"&gt;// [&lt;/span&gt;
&lt;span class="pl-c"&gt;//   {&lt;/span&gt;
&lt;span class="pl-c"&gt;//     name: "Blake Embrey",&lt;/span&gt;
&lt;span class="pl-c"&gt;//     email: "hello@blakeembrey.com",&lt;/span&gt;
&lt;span class="pl-c"&gt;//     flagged: true,&lt;/span&gt;
&lt;span class="pl-c"&gt;//     packages: [&lt;/span&gt;
&lt;span class="pl-c"&gt;//       {&lt;/span&gt;
&lt;span class="pl-c"&gt;//         homepage: "https://github.com/blakeembrey/array-flatten",&lt;/span&gt;
&lt;span class="pl-c"&gt;//         spec: "array-flatten",&lt;/span&gt;
&lt;span class="pl-c"&gt;//         versions: "3.0.0",&lt;/span&gt;
&lt;span class="pl-c"&gt;//         isPublishers: false&lt;/span&gt;
&lt;span class="pl-c"&gt;//       },&lt;/span&gt;
&lt;span class="pl-c"&gt;//       {&lt;/span&gt;
&lt;span class="pl-c"&gt;//         homepage: "https://github.com/pillarjs/path-to-regexp#readme",&lt;/span&gt;
&lt;span class="pl-c"&gt;//         spec: "path-to-regexp",&lt;/span&gt;
&lt;span class="pl-c"&gt;//         versions: "6.2.0",&lt;/span&gt;
&lt;span class="pl-c"&gt;//         isPublishers: true&lt;/span&gt;
&lt;span class="pl-c"&gt;//       }&lt;/span&gt;
&lt;span class="pl-c"&gt;//   }&lt;/span&gt;
&lt;span class="pl-c"&gt;// ]&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;API&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;TBC&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Contributors ✨&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://github.com/NodeSecure/authors#contributors-" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/d8d8b1dddb6c7bdd752cfb1d77530beeaff02399e39b8c9e4923ec62fd38aba6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f616c6c5f636f6e7472696275746f72732d332d6f72616e67652e7376673f7374796c653d666c61742d737175617265" alt="All Contributors"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/NodeSecure/authors" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Our goal is to implement these improvements in future releases of Scanner. I'm excited about this because personally I like to get to know the maintainers of the packages I use.&lt;/p&gt;

&lt;h2&gt;
  
  
  NodeSecure RC
&lt;/h2&gt;

&lt;p&gt;We are working on adding a &lt;a href="https://github.com/NodeSecure/rc" rel="noopener noreferrer"&gt;runtime configuration&lt;/a&gt; for our tools (especially the CI project).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;assert&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;node:assert/strict&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;RC&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@nodesecure/rc&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;writeOpts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;RC&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;writeOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;2.0.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;partialUpdate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;RC&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;writeOpts&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;unwrap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strictEqual&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;void&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should improve the experience for many of our tools where we had a CLI with complex settings and commands or pseudo configuration within the project (like report).&lt;/p&gt;




&lt;p&gt;That's it for this article. We continue to work and listen to your various feedbacks to improve our tools.&lt;/p&gt;

&lt;p&gt;See you soon for another article 😉. &lt;/p&gt;

&lt;p&gt;Best Regards,&lt;br&gt;
Thomas&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>security</category>
      <category>opensource</category>
    </item>
    <item>
      <title>🔒 Make your JavaScript project safer by using this workflow</title>
      <dc:creator>Antoine Coulon</dc:creator>
      <pubDate>Tue, 01 Feb 2022 18:41:03 +0000</pubDate>
      <link>https://dev.to/nodesecure/make-your-javascript-project-safer-by-using-this-workflow-403a</link>
      <guid>https://dev.to/nodesecure/make-your-javascript-project-safer-by-using-this-workflow-403a</guid>
      <description>&lt;h2&gt;
  
  
  The security issue
&lt;/h2&gt;

&lt;p&gt;Have you ever been thinking about security in your JavaScript projects? No? Well, you should, because with &lt;strong&gt;new &lt;em&gt;thousands of package&lt;/em&gt; published on &lt;code&gt;npm&lt;/code&gt; everyday&lt;/strong&gt;, vulnerabilities could come from your own code but also from your direct dependencies (node_modules).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Few months ago, &lt;strong&gt;coa&lt;/strong&gt; npm library was used to steal users' personal data by injecting malicious code.&lt;br&gt;
As a reminder &lt;strong&gt;coa&lt;/strong&gt; was:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Downloaded approximately 9 million times per week&lt;/li&gt;
&lt;li&gt;Used by about 5 million GitHub projects&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;And that's just one story among many others...&lt;/p&gt;

&lt;p&gt;If you're using &lt;code&gt;npm&lt;/code&gt; to download dependencies, you have probably already encountered this message:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jg2J2EXA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g6p39tsqv6avb0jm2fac.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jg2J2EXA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g6p39tsqv6avb0jm2fac.png" alt="npm audit" width="800" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After each &lt;code&gt;npm install&lt;/code&gt;, &lt;code&gt;npm&lt;/code&gt; runs an audit scan against your updated dependencies. Here, we have 79 vulnerabilities, coming from one or many dependencies. Each one represents a potential threat and should be fixed.&lt;/p&gt;

&lt;p&gt;Where do these vulnerabilities come from? Basically, &lt;code&gt;npm&lt;/code&gt; maintains a vulnerability Database which is updated on a daily basis. Many other databases exist, here is an exhaustive list about  most popular open-source databases for the JavaScript ecosystem:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/nodejs/security-wg"&gt;Node.js Security Working Group&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://security.snyk.io/vulns?type=npm"&gt;Snyk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/advisories?query=type%3Areviewed+ecosystem%3Anpm"&gt;GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These ressources are great, but we are lazy developers focused on productivity and we want to automate that, so we don't have to manually check all databases at 8 am every day before processing new features.&lt;/p&gt;

&lt;h2&gt;
  
  
  The security solution
&lt;/h2&gt;

&lt;p&gt;First things first, I want to warn you about the fact that there is no silver bullet for security concerns. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If security were all that mattered, computers would never be turned on, let alone hooked into a network with literally millions of potential intruders. &lt;em&gt;&lt;strong&gt;Dan Farmer&lt;/strong&gt;, pioneer in the development of vulnerability scanners for Unix operating systems and computer networks&lt;/em&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Nevertheless, you can drastically reduce the amount of vulnerabilities by using tools that can be easily integrated with your projects.&lt;br&gt;
However most of the time these tools are not open-source hence not for free use.&lt;/p&gt;
&lt;h3&gt;
  
  
  NodeSecure Continuous Integration
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;NodeSecure is an open source organization that aims to create free JavaScript security tools. Our biggest area of expertise is in npm package and code analysis.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To see more, read these &lt;a href="https://dev.to/fraxken/announcing-new-node-secure-back-end-1dp9"&gt;NodeSecure series&lt;/a&gt;, written by &lt;a href="https://github.com/fraxken"&gt;Thomas @fraxken&lt;/a&gt;, founder of the GitHub organization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is @nodesecure/ci&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/NodeSecure/ci"&gt;@nodesecure/ci&lt;/a&gt; brings together a set of tools to identify dependencies vulnerabilities and track most common malicious code and patterns using &lt;strong&gt;Static Code Analysis&lt;/strong&gt; and &lt;strong&gt;Vulnerabilities Analysis&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If your project (custom configuration is available) passes all security checks, the process exit with no error code otherwise, it fails.&lt;/p&gt;

&lt;p&gt;Here is a preview:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nsGl64Xr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a22zcc5arftcg51z0iwi.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nsGl64Xr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a22zcc5arftcg51z0iwi.gif" alt="NodeSecure Continuous Integration preview" width="600" height="410"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- GitHub Action&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you use &lt;a href="https://github.com/features/actions"&gt;GitHub Actions&lt;/a&gt;, you have a very straightforward way to add the official &lt;a href="https://github.com/NodeSecure/ci-action"&gt;NodeSecure ci-action&lt;/a&gt; action to your workflow: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;workflow.yaml&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v2&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;NodeSecure/ci-action@v1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now your source code and its dependencies will be automatically analyzed, &lt;strong&gt;&lt;em&gt;ironically without even adding new dependencies to your projects&lt;/em&gt;&lt;/strong&gt;. That's also a perfect fit if your tech lead doesn't want you to add new dependencies (node_modules already heavier than the universe).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Node.js Script&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Install the &lt;a href="https://www.npmjs.com/package/@nodesecure/ci"&gt;@nodesecure/ci&lt;/a&gt; package and start using the entry script &lt;code&gt;node_modules/.bin/nsci&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;As well as for the GitHub Action, you can provide a custom configuration through CLI arguments.&lt;/p&gt;

&lt;p&gt;First, reference the binary script in the &lt;em&gt;package.json&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
       &lt;/span&gt;&lt;span class="nl"&gt;"nsci"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"nsci"&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then start it providing different arguments (all can be used at once, by the way):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;npm run nsci &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nt"&gt;--directory&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/Users/user1/myproject
&lt;span class="nv"&gt;$ &lt;/span&gt;npm run nsci &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nt"&gt;--strategy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;npm
&lt;span class="nv"&gt;$ &lt;/span&gt;npm run nsci &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nt"&gt;--vulnerability&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;all
&lt;span class="nv"&gt;$ &lt;/span&gt;npm run nsci &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nt"&gt;--warnings&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;error
&lt;span class="nv"&gt;$ &lt;/span&gt;npm run nsci &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nt"&gt;--reporters&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;console
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;- Module API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;@nodesecure/ci exposes its pipeline runner as an API to allow use in any other combined workflow.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt;&lt;span class="nx"&gt;runPipeline&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@nodesecure/ci&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;optionsExample&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;directory&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cwd&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;node&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;vulnerabilities&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;all&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;warnings&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;reporters&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;console&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;runPipeline&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;optionsExample&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// =&amp;gt; the process can either exit with error code (1) &lt;/span&gt;
&lt;span class="c1"&gt;// or no error code (0), depending on the pipeline status.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it, now you have no more excuses not to practice &lt;a href="https://www.redhat.com/en/topics/devops/what-is-devsecops?sc_cid=7013a000002pz9ZAAQ&amp;amp;gclid=Cj0KCQiA0eOPBhCGARIsAFIwTs6FBfp7l54w_KoGuBSZ1pKqwugf9tPF-WMI-K71NtQT-l__HYtgN6saAlgWEALw_wcB&amp;amp;gclsrc=aw.ds"&gt;DevSecOps&lt;/a&gt; =) &lt;/p&gt;

&lt;p&gt;Any feedback on &lt;a href="https://github.com/NodeSecure/ci"&gt;@nodesecure/ci&lt;/a&gt; is welcome, the library is just getting started.&lt;/p&gt;

&lt;p&gt;Feel free to reach me on GitHub @antoine-coulon&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>security</category>
      <category>cicd</category>
    </item>
    <item>
      <title>NodeSecure v0.9.0</title>
      <dc:creator>Thomas.G</dc:creator>
      <pubDate>Tue, 07 Dec 2021 17:15:51 +0000</pubDate>
      <link>https://dev.to/nodesecure/node-secure-v090-59jn</link>
      <guid>https://dev.to/nodesecure/node-secure-v090-59jn</guid>
      <description>&lt;p&gt;Hello 👋,&lt;/p&gt;

&lt;p&gt;After more than ten long months of work we are finally there 😵! &lt;a href="https://github.com/ES-Community/nsecure/releases/tag/v0.9.0" rel="noopener noreferrer"&gt;Version 0.9.0&lt;/a&gt; has been released on npm 🚀.&lt;/p&gt;

&lt;p&gt;This is a version that required a lot of effort. Thank you to everyone who contributed and made this possible 🙏.&lt;/p&gt;

&lt;p&gt;So what are the features of this new release v0.9.0? This is what we will discover in this article 👀.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For newcomers you can learn more about NodeSecure &lt;a href="https://github.com/NodeSecure/.github/blob/master/profile/README.md" rel="noopener noreferrer"&gt;here&lt;/a&gt; or by reading the series.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  V0.9.0 💪
&lt;/h2&gt;

&lt;p&gt;This new version uses the new back-end and especially &lt;a href="https://github.com/NodeSecure/scanner/releases/tag/v3.0.0" rel="noopener noreferrer"&gt;version 3 of the scanner&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  ESM instead of CJS
&lt;/h3&gt;

&lt;p&gt;This is a choice we explained in &lt;a href="https://dev.to/fraxken/announcing-new-node-secure-back-end-1dp9"&gt;a previous article&lt;/a&gt;. This version has been completely rewritten in ESM.&lt;/p&gt;

&lt;p&gt;We also made the choice to abandon Jest which causes too many problems 😟. We now use &lt;a href="https://github.com/substack/tape" rel="noopener noreferrer"&gt;tape&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Better CLI
&lt;/h3&gt;

&lt;p&gt;All commands are now separated by file and the &lt;code&gt;bin/index.js&lt;/code&gt; file has been cleaned of all unnecessary code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frpbgg7n9vtzy6ix7hqri.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frpbgg7n9vtzy6ix7hqri.png" alt="CLI" width="386" height="234"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are also working on adding UT for each command (which should avoid regressions and allow better contributions).&lt;/p&gt;

&lt;h3&gt;
  
  
  New front-end network management
&lt;/h3&gt;

&lt;p&gt;This release heavily improves the front-end code with the addition of a package dedicated to vis-network management.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/NodeSecure" rel="noopener noreferrer"&gt;
        NodeSecure
      &lt;/a&gt; / &lt;a href="https://github.com/NodeSecure/vis-network" rel="noopener noreferrer"&gt;
        vis-network
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      NodeSecure vis.js network front-end module
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Vis-network&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/04a1e7cc117e2a55847c49ad1bbc6e764bbba41a45340bf730e610e2d2f32f3e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64796e616d69632f6a736f6e2e7376673f7374796c653d666f722d7468652d62616467652675726c3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f4e6f64655365637572652f7669732d6e6574776f726b2f6d61737465722f7061636b6167652e6a736f6e2671756572793d242e76657273696f6e266c6162656c3d56657273696f6e"&gt;&lt;img src="https://camo.githubusercontent.com/04a1e7cc117e2a55847c49ad1bbc6e764bbba41a45340bf730e610e2d2f32f3e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64796e616d69632f6a736f6e2e7376673f7374796c653d666f722d7468652d62616467652675726c3d68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f4e6f64655365637572652f7669732d6e6574776f726b2f6d61737465722f7061636b6167652e6a736f6e2671756572793d242e76657273696f6e266c6162656c3d56657273696f6e" alt="version"&gt;&lt;/a&gt;
&lt;a href="https://github.com/NodeSecure/vis-network/commit-activity" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/8673e90d546a2c5ead6be528f7f7978f877d3f64205f10b19ad02e2d0d6726d0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d61696e7461696e65642533462d7965732d677265656e2e7376673f7374796c653d666f722d7468652d6261646765" alt="Maintenance"&gt;&lt;/a&gt;
&lt;a href="https://api.securityscorecards.dev/projects/github.com/NodeSecure/vis-network" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/bf467ae7b425cb292ae9f01c808298fa8a0f951e8627f07fbda1f8adbe7cb770/68747470733a2f2f6170692e736563757269747973636f726563617264732e6465762f70726f6a656374732f6769746875622e636f6d2f4e6f64655365637572652f7669732d6e6574776f726b2f62616467653f7374796c653d666f722d7468652d6261646765" alt="OpenSSF Scorecard"&gt;&lt;/a&gt;
&lt;a href="https://github.com/NodeSecure/vis-network/blob/master/LICENSE" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/5a20dc6ffaa4a594548167097fec9a3371ad8aafc2fb6fb6c47c07dad04220b9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4e61657265656e2f5374726170446f776e2e6a732e7376673f7374796c653d666f722d7468652d6261646765" alt="mit"&gt;&lt;/a&gt;
&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/79cb9779b1d8464f361358a9e40539e1c41dc382515ac152fbd2a9ed4d10bf6d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4e6f64655365637572652f7669732d6e6574776f726b2f6e6f64652e6a732e796d6c3f7374796c653d666f722d7468652d6261646765"&gt;&lt;img src="https://camo.githubusercontent.com/79cb9779b1d8464f361358a9e40539e1c41dc382515ac152fbd2a9ed4d10bf6d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4e6f64655365637572652f7669732d6e6574776f726b2f6e6f64652e6a732e796d6c3f7374796c653d666f722d7468652d6261646765" alt="build"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;NodeSecure &lt;a href="https://visjs.org/" rel="nofollow noopener noreferrer"&gt;Vis.js&lt;/a&gt; network front-end module.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Getting Started&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;This package is available in the Node Package Repository and can be easily installed with &lt;a href="https://docs.npmjs.com/getting-started/what-is-npm" rel="nofollow noopener noreferrer"&gt;npm&lt;/a&gt; or &lt;a href="https://yarnpkg.com" rel="nofollow noopener noreferrer"&gt;yarn&lt;/a&gt;.&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ npm i @nodesecure/vis-network
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; or&lt;/span&gt;
$ yarn add @nodesecure/vis-network&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Usage example&lt;/h2&gt;
&lt;/div&gt;
&lt;div class="highlight highlight-source-js notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;// Import Third-party Dependencies&lt;/span&gt;
&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt; &lt;span class="pl-v"&gt;NodeSecureDataSet&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt; &lt;span class="pl-v"&gt;NodeSecureNetwork&lt;/span&gt; &lt;span class="pl-kos"&gt;}&lt;/span&gt; &lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s"&gt;"@nodesecure/vis-network"&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;

&lt;span class="pl-smi"&gt;document&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;addEventListener&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s"&gt;"DOMContentLoaded"&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt; &lt;span class="pl-k"&gt;async&lt;/span&gt; &lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt; &lt;span class="pl-c1"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
  &lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;secureDataSet&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-k"&gt;new&lt;/span&gt; &lt;span class="pl-v"&gt;NodeSecureDataSet&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
  &lt;span class="pl-k"&gt;await&lt;/span&gt; &lt;span class="pl-s1"&gt;secureDataSet&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;init&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;

  &lt;span class="pl-k"&gt;new&lt;/span&gt; &lt;span class="pl-v"&gt;NodeSecureNetwork&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;secureDataSet&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;API&lt;/h2&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/NodeSecure/vis-network/./docs/NodeSecureDataSet.md" rel="noopener noreferrer"&gt;NodeSecureDataSet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/NodeSecure/vis-network/./docs/NodeSecureNetwork.md" rel="noopener noreferrer"&gt;NodeSecureNetwork&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Scripts&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;The project scripts are used for those who want to test the code.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;npm start&lt;/strong&gt; to start an httpserver from &lt;code&gt;./dist&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;npm run build&lt;/strong&gt; to build the &lt;code&gt;./example&lt;/code&gt; with esbuild.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The start command run the build command before launching the http server.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Contributors ✨&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://github.com/NodeSecure/vis-network#contributors-" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/f7e7ee5949a35d448797601f9193f3e6b8108dc258029dad8457e109c52b4a41/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f616c6c5f636f6e7472696275746f72732d342d6f72616e67652e7376673f7374796c653d666c61742d737175617265" alt="All Contributors"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks goes to these wonderful people (&lt;a href="https://allcontributors.org/docs/en/emoji-key" rel="nofollow noopener noreferrer"&gt;emoji key&lt;/a&gt;):&lt;/p&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td width="14.28%"&gt;
&lt;a href="https://www.linkedin.com/in/thomas-gentilhomme/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F4438263%3Fv%3D4%3Fs%3D100" width="100px;" alt="Gentilhomme"&gt;&lt;br&gt;&lt;b&gt;Gentilhomme&lt;/b&gt;&lt;/a&gt;&lt;br&gt;&lt;a href="https://github.com/NodeSecure/vis-network/commits?author=fraxken" title="Code" rel="noopener noreferrer"&gt;💻&lt;/a&gt; &lt;a href="https://github.com/NodeSecure/vis-network/commits?author=fraxken" title="Documentation" rel="noopener noreferrer"&gt;📖&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;…&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/NodeSecure/vis-network" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;This should also allow us to migrate more easily to D3.js in 2022 🚀.&lt;/p&gt;

&lt;h3&gt;
  
  
  Better resolver support
&lt;/h3&gt;

&lt;p&gt;The new version of the scanner has support for &lt;code&gt;github:&lt;/code&gt; and &lt;code&gt;git:&lt;/code&gt; spec.&lt;/p&gt;

&lt;p&gt;The scanner is now able to analyze the following dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"zen-observable"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^0.8.15"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"nanoid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"github:ai/nanoid"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"js-x-ray"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"git://github.com/NodeSecure/js-x-ray.git"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"nanodelay"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"git+ssh://git@github.com:ai/nanodelay.git"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"nanoevents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"git+https://github.com/ai/nanoevents.git"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Better payload structure
&lt;/h3&gt;

&lt;p&gt;The structure of JSON has been improved to be more consistent (especially on the management of versions by dependency).&lt;/p&gt;

&lt;p&gt;The latest version of the scanner also corrects many inconsistencies in the management of authors and maintainers.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"author"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"GENTILHOMME Thomas"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"gentilhomme.thomas@gmail.com"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"publishers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"fraxken"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"gentilhomme.thomas@gmail.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2.2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2021-11-11T18:18:06.891Z"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"maintainers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"kawacrepe"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"vincent.dhennin@viacesi.fr"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"fraxken"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"gentilhomme.thomas@gmail.com"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"tonygo"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"email"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"gorez.tony@gmail.com"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Brand new vulnerabilities management
&lt;/h3&gt;

&lt;p&gt;We have already presented it, but now we use our own package that allows to recover vulnerabilities using several strategies (Security WG, NPM Audit etc..).&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/NodeSecure" rel="noopener noreferrer"&gt;
        NodeSecure
      &lt;/a&gt; / &lt;a href="https://github.com/NodeSecure/vulnera" rel="noopener noreferrer"&gt;
        vulnera
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Programmatically fetch security vulnerabilities with one or many strategies (NPM Audit, Sonatype, Snyk, Node.js DB).
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/43391199/180091156-9cf883b3-05bc-4c69-9943-3d1168818fab.png"&gt;&lt;img alt="vulnera" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F43391199%2F180091156-9cf883b3-05bc-4c69-9943-3d1168818fab.png" width="650"&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
    &lt;a href="https://github.com/NodeSecure/vulnera" rel="noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/2e96c2010c3fa1ccaa8f1d3bf68e99b3a8b36cb5056fe9f60dd4a638fc2a89b2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7061636b6167652d6a736f6e2f762f4e6f64655365637572652f76756c6e6572613f7374796c653d666f722d7468652d6261646765" alt="npm version"&gt;
    &lt;/a&gt;
    &lt;a href="https://github.com/NodeSecure/vulnera" rel="noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/01eb01b5f1cd10012b69a2fc5ed293d7cc4d983de582c7635c73e68bfdf23679/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4e6f64655365637572652f76756c6e6572613f7374796c653d666f722d7468652d6261646765" alt="license"&gt;
    &lt;/a&gt;
    &lt;a href="https://api.securityscorecards.dev/projects/github.com/NodeSecure/vulnera" rel="nofollow noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/0ac3dc0152a1eeeaced5c88b503c080a77dc1e559f088d8f1b4be98983600536/68747470733a2f2f6170692e736563757269747973636f726563617264732e6465762f70726f6a656374732f6769746875622e636f6d2f4e6f64655365637572652f76756c6e6572612f62616467653f7374796c653d666f722d7468652d6261646765" alt="ossf scorecard"&gt;
    &lt;/a&gt;
    &lt;a href="https://github.com/NodeSecure/vulnera/actions?query=workflow%3A%22Node.js+CI%22" rel="noopener noreferrer"&gt;
      &lt;img src="https://camo.githubusercontent.com/e3655b307d0b6e23682d00de3ec3e8175f13e4e04048229f0b0671661869744b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f4e6f64655365637572652f76756c6e6572612f6d61696e2e796d6c3f7374796c653d666f722d7468652d6261646765" alt="github ci workflow"&gt;
    &lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;vuln-&lt;em&gt;era&lt;/em&gt;&lt;/strong&gt; has begun! Programmatically fetch security vulnerabilities with one or many strategies. Originally designed to run and analyze &lt;a href="https://github.com/NodeSecure/scanner" rel="noopener noreferrer"&gt;Scanner&lt;/a&gt; dependencies it now also runs independently from an npm Manifest.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Requirements&lt;/h2&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/" rel="nofollow noopener noreferrer"&gt;Node.js&lt;/a&gt; v22 or higher&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Getting Started&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;This package is available in the Node Package Repository and can be easily installed with &lt;a href="https://docs.npmjs.com/getting-started/what-is-npm" rel="nofollow noopener noreferrer"&gt;npm&lt;/a&gt; or &lt;a href="https://yarnpkg.com" rel="nofollow noopener noreferrer"&gt;yarn&lt;/a&gt;.&lt;/p&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ npm i @nodesecure/vulnera
&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; or&lt;/span&gt;
$ yarn add @nodesecure/vulnera&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Usage example&lt;/h2&gt;
&lt;/div&gt;

&lt;div class="highlight highlight-source-js notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-c1"&gt;*&lt;/span&gt; &lt;span class="pl-k"&gt;as&lt;/span&gt; &lt;span class="pl-s1"&gt;vulnera&lt;/span&gt; &lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s"&gt;"@nodesecure/vulnera"&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;

&lt;span class="pl-k"&gt;await&lt;/span&gt; &lt;span class="pl-s1"&gt;vulnera&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;setStrategy&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;
  &lt;span class="pl-s1"&gt;vulnera&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-c1"&gt;strategies&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-c1"&gt;GITHUB_ADVISORY&lt;/span&gt;
&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;

&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;definition&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-k"&gt;await&lt;/span&gt; &lt;span class="pl-s1"&gt;vulnera&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;getStrategy&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
&lt;span class="pl-smi"&gt;console&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;log&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;definition&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-c1"&gt;strategy&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;

&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;vulnerabilities&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-k"&gt;await&lt;/span&gt; &lt;span class="pl-s1"&gt;definition&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;getVulnerabilities&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;process&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;cwd&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
  &lt;span class="pl-c1"&gt;useFormat&lt;/span&gt;: &lt;span class="pl-s"&gt;"Standard"&lt;/span&gt;
&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;
&lt;span class="pl-smi"&gt;console&lt;/span&gt;&lt;span class="pl-kos"&gt;.&lt;/span&gt;&lt;span class="pl-en"&gt;log&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-s1"&gt;vulnerabilities&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt;&lt;span class="pl-kos"&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Available strategy&lt;/h2&gt;

&lt;/div&gt;

&lt;p&gt;The default strategy is &lt;strong&gt;NONE&lt;/strong&gt; which mean no strategy at all (we execute…&lt;/p&gt;
&lt;/div&gt;


&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/NodeSecure/vulnera" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;p&gt;This is just the beginning and I think it will soon be a fully featured project. Among the new features there is a new standard format dedicated for NodeSecure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;interface&lt;/span&gt; &lt;span class="nx"&gt;StandardVulnerability&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;id&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;origin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Origin&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;package&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;description&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;url&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;severity&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;Severity&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;cves&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
    &lt;span class="nl"&gt;cvssVector&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;cvssScore&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;vulnerableRanges&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
    &lt;span class="nl"&gt;vulnerableVersions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
    &lt;span class="nl"&gt;patchedVersions&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;patches&lt;/span&gt;&lt;span class="p"&gt;?:&lt;/span&gt; &lt;span class="nx"&gt;Patch&lt;/span&gt;&lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Trojan source detection with JS-X-Ray 4.2.0
&lt;/h3&gt;

&lt;p&gt;The new backend implements the version 4 of JS-X-Ray. In this latest release we added a warning for &lt;a href="https://www.trojansource.codes/" rel="noopener noreferrer"&gt;Trojan source&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Documentation and tests
&lt;/h3&gt;

&lt;p&gt;A lot of effort has been put into adding documentation and unit testing to all of the projects.&lt;/p&gt;

&lt;p&gt;There is still a long way to go to make this even more accessible and you are welcome to help us.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next ?
&lt;/h2&gt;

&lt;p&gt;We are now working as a group on different topics. We have many ongoing projects/subjects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/NodeSecure/rc/issues/1" rel="noopener noreferrer"&gt;Specification of a configuration&lt;/a&gt; file for our projects.&lt;/li&gt;
&lt;li&gt;Better analysis and identification of authors and maintainers. See &lt;a href="https://github.com/NodeSecure/authors" rel="noopener noreferrer"&gt;NodeSecure/authors&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Creating new tools to be executed in CI.&lt;/li&gt;
&lt;li&gt;Working on the next Web UI (TypeScript + &lt;a href="https://github.github.io/catalyst/" rel="noopener noreferrer"&gt;Catalyst&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion 🙏
&lt;/h2&gt;

&lt;p&gt;We should be able to produce more frequent releases until the new UI comes.&lt;/p&gt;

&lt;p&gt;Thanks again to the core contributors of the project without whom we would not have arrived here today! &lt;/p&gt;

&lt;p&gt;See you soon for the release v0.10.0 💃.&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>security</category>
      <category>opensource</category>
    </item>
    <item>
      <title>A technical tale of NodeSecure - Chapter 1</title>
      <dc:creator>Thomas.G</dc:creator>
      <pubDate>Mon, 22 Nov 2021 13:20:10 +0000</pubDate>
      <link>https://dev.to/nodesecure/a-technical-tale-of-nodesecure-chapter-1-2mm8</link>
      <guid>https://dev.to/nodesecure/a-technical-tale-of-nodesecure-chapter-1-2mm8</guid>
      <description>&lt;p&gt;Hello 👋&lt;/p&gt;

&lt;p&gt;I have been working on the &lt;a href="https://github.com/NodeSecure" rel="noopener noreferrer"&gt;NodeSecure&lt;/a&gt; project for almost three years now 😵. I have personally come a long way... At the beginning I didn't know much about the field in which I started 🐤.&lt;/p&gt;

&lt;p&gt;That's why I thought that writing articles about &lt;em&gt;"some"&lt;/em&gt; of the technical difficulties and the tools I used could be valuable 🚀.&lt;/p&gt;

&lt;p&gt;I will try to make articles that focus on one aspect 🎯. Let's get started 💃.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔍 Fetching the dependency tree
&lt;/h2&gt;

&lt;p&gt;One of the first challenges I had to solve was how to get the dependency tree and all the information attached to the packages.&lt;/p&gt;

&lt;p&gt;My first instinct was to work with &lt;a href="https://github.com/npm/registry/blob/master/docs/REGISTRY-API.md" rel="noopener noreferrer"&gt;the public API of the npm registry&lt;/a&gt;.&lt;br&gt;
This sounds like a very good idea, but you will soon run into a set of problems (cache, private registry etc..).&lt;/p&gt;

&lt;p&gt;What I wanted to do has already been implemented in the package named &lt;a href="https://github.com/npm/pacote#readme" rel="noopener noreferrer"&gt;pacote&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;a href="https://github.com/npm/arborist#readme" rel="noopener noreferrer"&gt;Arborist&lt;/a&gt; did not exist yet. I will come back to this in a future article. The first versions of NodeSecure did not support the analysis of a local project anyway.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  Pacote
&lt;/h3&gt;

&lt;p&gt;As its README suggests, Pacote is a library that allows you to retrieve various data for a given package. To be more precise:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A package manifest&lt;/strong&gt; (&lt;em&gt;A manifest is similar to a package.json file. However, it has a few pieces of extra metadata, and sometimes lacks metadata that is inessential to package installation.&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A packument&lt;/strong&gt; (&lt;em&gt;A packument is the top-level package document that lists the set of manifests for available versions for a package.&lt;/em&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A tarball&lt;/strong&gt; (&lt;em&gt;The archive containing the package itself with the published files&lt;/em&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These terms are really important and are explained in the pacote README.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; There is a package with the type definitions &lt;a href="https://github.com/npm/types" rel="noopener noreferrer"&gt;@npm/types&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the &lt;a href="https://github.com/NodeSecure/scanner" rel="noopener noreferrer"&gt;NodeSecure/scanner&lt;/a&gt; these methods are used at different stages of the analysis. When we browse the dependency tree for example we use the &lt;code&gt;manifest()&lt;/code&gt; method with the range version (or &lt;strong&gt;specifier&lt;/strong&gt;) of the package.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;pacote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;manifest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gitURL&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="nx"&gt;packageName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;NPM_TOKEN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;registry&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;getLocalRegistryURL&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;homedir&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;&lt;span class="s2"&gt;/.npm`&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The library allows you to manage a whole set of things quite quickly without too much difficulty 💪.&lt;/p&gt;

&lt;p&gt;Note that in the above code &lt;strong&gt;there is a notion of Git URL&lt;/strong&gt; 👀.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔬 Dependency resolution
&lt;/h3&gt;

&lt;p&gt;You are probably used to see &lt;a href="https://semver.org/lang/fr/" rel="noopener noreferrer"&gt;SemVer&lt;/a&gt; versions or ranges within your package.json. Quite similar to this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"@nodesecure/flags"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^2.2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"@nodesecure/fs-walk"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^1.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"@nodesecure/i18n"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^1.2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"@nodesecure/js-x-ray"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^4.1.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"@nodesecure/npm-registry-sdk"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^1.3.0"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But there are many other ways to install/link a dependency within a package.json 😲:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.npmjs.com/cli/v8/configuring-npm/package-json#urls-as-dependencies" rel="noopener noreferrer"&gt;URL to a tarball archive&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.npmjs.com/cli/v8/configuring-npm/package-json#git-urls-as-dependencies" rel="noopener noreferrer"&gt;Git URLs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.npmjs.com/cli/v8/configuring-npm/package-json#github-urls" rel="noopener noreferrer"&gt;GitHub URLs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.npmjs.com/cli/v8/configuring-npm/package-json#local-paths" rel="noopener noreferrer"&gt;Local Paths&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of the advantages of pacote is that it handles most of these resolutions for you 😎. I discovered all this while working on the subject (because I had never dealt with those types of resolutions).&lt;/p&gt;

&lt;p&gt;If you want to be able to spot them here is a regular expression:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/^&lt;/span&gt;&lt;span class="se"&gt;([&lt;/span&gt;&lt;span class="sr"&gt;a-zA-Z&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;+:|git&lt;/span&gt;&lt;span class="se"&gt;\+&lt;/span&gt;&lt;span class="sr"&gt;|&lt;/span&gt;&lt;span class="se"&gt;\.\\)&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;version&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Version with custom resolution&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This also explains why in NodeSecure we have a "&lt;a href="https://github.com/NodeSecure/flags/blob/main/FLAGS.md" rel="noopener noreferrer"&gt;hasCustomResolver&lt;/a&gt;" flag allowing quick identification of packages using resolutions to dependencies that diverge from the usual.&lt;/p&gt;

&lt;p&gt;Pacote also exposes a &lt;code&gt;resolve()&lt;/code&gt; method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;pacote&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;pacote&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;tarURL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;pacote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@slimio/is@^1.0.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It resolve a specifier like &lt;code&gt;foo@latest&lt;/code&gt; or &lt;code&gt;github:user/project&lt;/code&gt; all the way to a tarball url, tarball file, or git repo with commit hash.&lt;/p&gt;

&lt;h3&gt;
  
  
  📦 Download and extract tarball
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/NodeSecure/scanner/blob/master/src/tarball.js#L49" rel="noopener noreferrer"&gt;One of the steps&lt;/a&gt; is to retrieve the package on the local system to be able to analyze it and retrieve a set of information.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;spec&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;flags&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;isGit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt;
  &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;gitUrl&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;@&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;version&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;pacote&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;extract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;spec&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;dest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;NPM_TOKEN&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;registry&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;getLocalRegistryURL&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
  &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;homedir&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;&lt;span class="s2"&gt;/.npm`&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The package will be extracted into a temporary directory generated when the scanner is launched.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; see &lt;a href="https://nodejs.org/api/fs.html#fspromisesmkdtempprefix-options" rel="noopener noreferrer"&gt;fs.mkdtemp&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once the extraction is finished, we will retrieve the information we need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Files, extensions, size on disk etc..&lt;/li&gt;
&lt;li&gt;Execute &lt;a href="https://github.com/NodeSecure/js-x-ray" rel="noopener noreferrer"&gt;NodeSecure/JS-X-Ray&lt;/a&gt; on each JavaScript files.&lt;/li&gt;
&lt;li&gt;Fetch licenses and retrieve their SPDX conformance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will dig deeper into the steps of static code analysis in a future article.&lt;/p&gt;

&lt;h3&gt;
  
  
  😈 It can't be that simple
&lt;/h3&gt;

&lt;p&gt;In all this there are things quite complex to manage:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Same packages but with different "range" of versions 🎭.&lt;/li&gt;
&lt;li&gt;Ensure the integrity of the links (relations) between packages.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;The first one&lt;/strong&gt; is hard because most of the time we are dealing with SemVer range and not with the EXACT version of the package. There is quite a bit of connection here with how npm handles conflict during installation (also &lt;a href="https://github.com/npm/npm-pick-manifest" rel="noopener noreferrer"&gt;how npm algorithms pick the right manifest&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;I think I probably still lack some vision and experience on the subject. The current code is probably quite heavy too.&lt;/p&gt;

&lt;p&gt;Today the &lt;code&gt;cwd&lt;/code&gt; API of the Scanner use Arborist. For the &lt;code&gt;from&lt;/code&gt; API i would like to avoid having to deal with a packument.&lt;/p&gt;




&lt;p&gt;For &lt;strong&gt;the second one&lt;/strong&gt; it is mainly a problem with the behaviour of the walker that will browse asynchronously the tree. We must therefore avoid that a package already analyzed is taken into account again. The problem with this is that we will be missing relationship links between some packages in the tree.&lt;/p&gt;

&lt;p&gt;The current scanner solves the problem by going through all the dependencies one last time to create the missing link.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;packageName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;descriptor&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dependencies&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;verStr&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;descriptor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;versions&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;verDescriptor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;descriptor&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;verStr&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fullName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;packageName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;@&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;verStr&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;usedDeps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;exclude&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fullName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;usedDeps&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;size&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;usedBy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;deps&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[...&lt;/span&gt;&lt;span class="nx"&gt;usedDeps&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;version&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;deps&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;usedBy&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;version&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;assign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;verDescriptor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;usedBy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;usedBy&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  ✨ Conclusion
&lt;/h2&gt;

&lt;p&gt;That's it for this article where we have explored a little bit the difficulties around going through the dependency tree.&lt;/p&gt;

&lt;p&gt;If you like the concept don't hesitate to like and share.&lt;/p&gt;

&lt;p&gt;🙏 Thanks for reading and see you soon for a new article.&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>security</category>
    </item>
    <item>
      <title>Announcing new NodeSecure back-end</title>
      <dc:creator>Thomas.G</dc:creator>
      <pubDate>Sat, 11 Sep 2021 17:40:34 +0000</pubDate>
      <link>https://dev.to/nodesecure/announcing-new-node-secure-back-end-1dp9</link>
      <guid>https://dev.to/nodesecure/announcing-new-node-secure-back-end-1dp9</guid>
      <description>&lt;p&gt;Hello 👋&lt;/p&gt;

&lt;p&gt;In the last article of the series I announced the future of NodeSecure. Well, we have just finished rebuilding our back-end 😲 (&lt;em&gt;or at least a first version of it&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;So what are the particularities of this new back-end? This is what we will discover in this article 👀.&lt;/p&gt;

&lt;p&gt;But first let me make an introduction for the newcomers.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is NodeSecure ❓
&lt;/h2&gt;

&lt;p&gt;NodeSecure is an open source organization that aims to create free JavaScript security tools. Our biggest area of expertise is in npm package and code analysis.&lt;/p&gt;

&lt;p&gt;Our most notable projects are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/ES-Community/nsecure" rel="noopener noreferrer"&gt;Nsecure&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/NodeSecure/js-x-ray" rel="noopener noreferrer"&gt;JS-X-Ray&lt;/a&gt; - SAST Scanner&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/NodeSecure/report" rel="noopener noreferrer"&gt;Report&lt;/a&gt; - HTML &amp;amp; PDF security report&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main project is a CLI that will fetch and deeply analyze the dependency tree of a given npm package (Or a local project with a package.json) and output a .json file that will contain all metadata and flags about each package.&lt;/p&gt;

&lt;p&gt;The CLI is able to open the JSON and draw a Network of all dependencies (UI and emojis flags will help you to identify potential issues and security threats).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://camo.githubusercontent.com/5d7138dab440b50d52f3889605d547b5d655988965b6b442dc28abb8d9c1481c/68747470733a2f2f692e696d6775722e636f6d2f33786e5447426c2e706e67" class="article-body-image-wrapper"&gt;&lt;img src="https://camo.githubusercontent.com/5d7138dab440b50d52f3889605d547b5d655988965b6b442dc28abb8d9c1481c/68747470733a2f2f692e696d6775722e636f6d2f33786e5447426c2e706e67" alt="image" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;More information on our &lt;a href="https://github.com/NodeSecure/Governance" rel="noopener noreferrer"&gt;Governance page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  New back-end 🚀
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Moving everything to the NodeSecure github org 🏠
&lt;/h3&gt;

&lt;p&gt;All packages have been moved to the &lt;a href="https://github.com/NodeSecure" rel="noopener noreferrer"&gt;github organization&lt;/a&gt;. You will notice that we have a nice new logo ✨ (created by Tony).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdgzcdom6a0irdkg0ekry.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdgzcdom6a0irdkg0ekry.png" alt="image" width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This should make it simple to implement a new set of tools and collaborate more effectively. The integration of new maintainers should also be greatly simplified.&lt;/p&gt;

&lt;h3&gt;
  
  
  Moving to Node.js 16 and ESM
&lt;/h3&gt;

&lt;p&gt;One of the major choices was to use ESM instead of CJS. Many maintainers like Sindresorhus made the choice to switch to ESM which prevented us from updating some of our packages 😭.&lt;/p&gt;

&lt;p&gt;There are still a lot of things that are not stable, but we are convinced that it is the right choice for the future of our tools 💪.&lt;/p&gt;

&lt;p&gt;Knowing that we still have time before completely finalizing the version 1 we also made the choice to have a limited support to the next LTS of Node.js.&lt;/p&gt;

&lt;h3&gt;
  
  
  New segmentation and packages 📦
&lt;/h3&gt;

&lt;p&gt;We have segmented the back-end into a multitude of packages. That makes them reusable in other tools.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F766w2om5jg9d8ekxvq4g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F766w2om5jg9d8ekxvq4g.png" alt="image" width="800" height="673"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It will also greatly improve the quality of documentation and testing 💎.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;name&lt;/th&gt;
&lt;th&gt;description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/NodeSecure/scanner" rel="noopener noreferrer"&gt;scanner&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;⚡️ A package API to run a static analysis of your module's dependencies.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/NodeSecure/vuln" rel="noopener noreferrer"&gt;vuln&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;NPM Audit, Snyk and Node.js Security WG vulnerability strategies built for NodeSecure.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/NodeSecure/flags" rel="noopener noreferrer"&gt;flags&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;NodeSecure security flags 🚩 (configuration and documentation)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/NodeSecure/i18n" rel="noopener noreferrer"&gt;i18n&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;NodeSecure Internationalization&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="https://github.com/NodeSecure/npm-registry-sdk" rel="noopener noreferrer"&gt;npm-registry-sdk&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Node.js SDK to fetch data from the npm API.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;And there is still a lot more to discover (fs-walk, sec-literal , npm-tarball-license-parser etc).&lt;/p&gt;

&lt;h3&gt;
  
  
  Scanner API 🔬
&lt;/h3&gt;

&lt;p&gt;Even though we now have a dedicated package the API has not changed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;scanner&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@nodesecure/scanner&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;fs/promises&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// CONSTANTS&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;kPackagesToAnalyze&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mocha&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cacache&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;is-wsl&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;payloads&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;kPackagesToAnalyze&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;scanner&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;promises&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;kPackagesToAnalyze&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;payloads&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nx"&gt;promises&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;kPackagesToAnalyze&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]}&lt;/span&gt;&lt;span class="s2"&gt;.json`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;allSettled&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;promises&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;a href="https://github.com/NodeSecure/report" rel="noopener noreferrer"&gt;PDF &amp;amp; HTML report&lt;/a&gt; project has been updated to use this new back-end.&lt;/p&gt;

&lt;h2&gt;
  
  
  Team and contributors 👯
&lt;/h2&gt;

&lt;p&gt;We are integrating &lt;a href="https://www.linkedin.com/in/vincentdhennin/" rel="noopener noreferrer"&gt;Vincent Dhennin&lt;/a&gt; as a new maintainer. His help and contributions have been important and I can only thank him for this investment.&lt;/p&gt;

&lt;p&gt;We are now three (including &lt;a href="https://tonygo.dev/" rel="noopener noreferrer"&gt;Tony Gorez&lt;/a&gt; and me).&lt;/p&gt;

&lt;p&gt;I would like to thank the other contributors who participated a lot:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/nicolas-hallaert/" rel="noopener noreferrer"&gt;Nicolas HALLAERT&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/quentin-lepateley/" rel="noopener noreferrer"&gt;Quentin LEPATELEY&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/oleh-sych-41245116a/" rel="noopener noreferrer"&gt;Oleh SYCH&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/antoine-coulon-b29934153/" rel="noopener noreferrer"&gt;Antoine COULON&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.linkedin.com/in/ange-tekeu-a155811b4/" rel="noopener noreferrer"&gt;Ange TEKEU&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's next ?
&lt;/h2&gt;

&lt;p&gt;To be clear, the objective is to prepare a version 0.9.0 of NodeSecure implementing the new back-end (&lt;a href="https://github.com/ES-Community/nsecure/tree/v0.9.0" rel="noopener noreferrer"&gt;already in progress&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;This will allow us to continually improve and update the back-end features. It will also now be easier to work on the evolution of the CLI.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We still don't have a roadmap or vision for the new interface. We will start working on it by October or November I think.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;🙏 Thanks for reading and see you soon for an article on the next version of the CLI 😍.&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>security</category>
    </item>
  </channel>
</rss>
