• Stars
    star
    121
  • Rank 293,924 (Top 6 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Audit Resolver

A tool for building a responsible but practical supply chain security practice.

npm audit is great. npm audit fix is also there if you didn't know. But not everything can be fixed right away and you need to manage your security and make decisions about the dependencies you use.

I built audit-resolver after a few weeks of trying to run audit as a step in CI and failing each time there's a vulnerability. There were just too many irrelevant or unfixed ones and my team needed a way to manage the situation.

Audit resolver creates a audit-resolve.json file in your app and interactively helps you manage security of your dependencies.
You can decide what to ignore and for how long, or track what's been fixed before.
The audit-resolve.json file sits in the repository and you can see who decided to ignore what and when.

I'm participating in Package Vulnerability Management & Reporting Collaboration Space where I intend to donate parts of the audit-resolver's core.

Changes in version 3

Due to changes introduced by npm7+ the option to fix an individual package is no longer available from npm and wasn't always working correctly anyway. By virtue of "doing one thing and one thing well" this package will no longer provide that option. You can run npm audit fix before resolving unfixable issues. resolve-audit will offer you that option first before asking any questions about specific issues.

Requires npm v7.24.2+ or yarn installed alongside
Works with node 14+ (could run on 12 and npm6 but no guarantees going forward)
You can use audit resolver v2.x with npm6.
Yarn support was not heavily tested across versions, but works well with current yarn 1 and 3 at the time of writing

Install

npm install -g npm-audit-resolver

Usage

Go into the project folder and run

resolve-audit

It goes through the results of npm audit and lets you decide what to do with the issues. The decisions you make are stored in audit-resolve.json to keep track of it in version control and have a log of who decided to do what and when.

Arguments

--yarn switches to yarn instead of npm.
--yarn-berry switches to yarn2 or yarn3 instead of npm.
--migrate forces migration to the new audit-resolve.json file and format even if no modifications are made to decisions
--mock used in tests

All other arguments are passed down to the npm/yarn audit call

Running in CI

One of the problems npm-audit-resolver solves is running audit as part of your build pipeline. You don't want to break your CI for a few days waiting to get a fix on a dependency, but at the same time ignoring the whole class of issues or the audit result entirely means you'll rarely notice it at all.

Run

check-audit

This command will only exit with an error if a human needs to make new decisions about vulnerabilities and commit the audit-resolve.json file. If all issues are addressed, your build can pass.

For JSON output (similar to npm audit --json), run

check-audit --json

All other arguments are passed down to the npm/yarn audit call

Features

If npm audit fix can help, you'll be prompted to run it first.

For all vulnerabilities found, you get to choose between the following options:

  • remind in 24h - Lets you ignore an issue temporarily to make the build pass until a fix is known
  • ignore - Adds the particular dependency paths and advisories to be ignored in the future. If the same issue in the same package comes up, but it's a dependency of another package, it won't get ignored. If a new issue is found in the package, it doesn't get ignored. You can decide if the decision expires or not.
  • delete - Removes your dependency that brought the vulnerability in its dependencies.
  • skip and quit, obviously

audit-resolve.json is formatted, so git history has a trace of who addressed which vulnerability, when and how.

Why would I ignore security vulnerabilities?

Because otherwise running npm audit as part of your CI is not practical.

  • dev dependencies! a DOS vulnerability in your test runner's dependency is not a showstopper
  • build tooling vulnerability
  • dependencies of a tool you use very narrowly and can prove it's safe
  • new vulnerability without a fix and you want to wait for a fix while running your builds (there's a remind me in 24h option available)
  • Further in the future - because a maintainer you trust has checked and the vulnerability in their dependency tree that you pulled is not affecting the package you're using

More Repositories

1

xhr

A small xhr wrapper
JavaScript
804
star
2

blocked-at

Detects node eventloop block and reports where it started
JavaScript
319
star
3

insertionQuery

Non-dom-event way to catch nodes showing up. And it uses selectors.
JavaScript
190
star
4

node-example-flamegraph

Shell
66
star
5

can-i-ignore-scripts

JavaScript
56
star
6

debugging-aid

Experimental tools for debugging Node.js apps without pausing
JavaScript
54
star
7

builder4impress

A tool to build slides in impress.js in a WYSIWYG manner
JavaScript
36
star
8

node-diagnostics-howtos

23
star
9

handsfreeyoutube

no hands and no eyes youtube experience
JavaScript
23
star
10

backbone-redux-migrator

Lets Backbone and Redux apps coexist, so you don't have to rewrite everything at once
JavaScript
23
star
11

https-proxy-cli

One command to run a local https server proxying to local http
JavaScript
20
star
12

naughty-images

SVG Images with XSS in them
C
17
star
13

safe-memory-cache

Secure and size-limited in-memory cache for node.js
JavaScript
14
star
14

node-example-heapdump

JavaScript
14
star
15

js-training-examples

Examples for JS trainings
JavaScript
13
star
16

CSP-exercise

JavaScript
12
star
17

strongly-typed

Strongly typed javascript objects, self-validating, detailed error reports
JavaScript
11
star
18

aframe-point-component

implements a-point based on THREE.js point object
JavaScript
11
star
19

naugtur.github.com

HTML
9
star
20

overlord.js

Mediator pattern taken to the limits. Can do more than just PubSub
JavaScript
9
star
21

secure-dependencies

Creates a tarball of your app dependencies checked with node security platform
JavaScript
8
star
22

lavalab

JavaScript
8
star
23

google-pubsub-mock

Transparently overrides @googlecloud/pub-sub for local testing
JavaScript
8
star
24

ripper

Ripper.js - copy fragments of DOM and insert to another document preserving the CSS styles of elements
JavaScript
8
star
25

jQuery-Mobile-dictionary

Community jquerymobile documentation in a handy form
JavaScript
8
star
26

meetjs.pl

Official meet.js website
TypeScript
5
star
27

node-examples

examples for node trainings
HTML
4
star
28

axons.js

A communication channel you always wanted instead of pub-sub
JavaScript
4
star
29

extendable-module

Extendable Revealing Module - lets you extend the private parts [ seriously ;) ]
JavaScript
4
star
30

research

Rabbit-holes and wild-goose chases.
JavaScript
3
star
31

git-livecoding

a tool to show commits from history as if they were about to be made
Shell
3
star
32

promise-blocked

Detect which function blocks your eventloop
JavaScript
3
star
33

human-redux-reactor

JavaScript
3
star
34

transitionrunner

tiny bit of javascript enabling CSS-defined animations with fallback for older browsers
JavaScript
3
star
35

csp-report-lite

JavaScript
3
star
36

selfexplanatory.js

Make your functions and methods self-explanatory with this simple wrapper
JavaScript
3
star
37

request-dependency

Requesting dependencies instead of DI
JavaScript
2
star
38

selfaware

A bind function for all the methods at once
JavaScript
2
star
39

package-firewall

An experimental package network access control tool
JavaScript
2
star
40

audit-resolve-core

Core modules for audit-resolve.json file and logic of its processing
JavaScript
1
star
41

js-memory-demo

Simple tests demonstrating memory impact of certain bits of code
JavaScript
1
star
42

alphabet-game

HTML
1
star
43

training-notes

HTML
1
star
44

podcastmaker-cli

a pile of bash tricks for unattended audio editing
Shell
1
star
45

node-example-websec

Example app for learning websecurity fundamentals
HTML
1
star
46

redux-request-generator

no-boilerplate http requests from redux apps
JavaScript
1
star
47

i-run-code-from-the-internet

1
star
48

debugging-tools-livecoding

1
star
49

bootstrap-prototyping

tiny introduction to prototyping with bootstrap - for UX designers
CSS
1
star
50

aframe-livereload-image

JavaScript
1
star