Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow filtering by severity #13

Closed
evilpacket opened this issue May 10, 2018 · 7 comments
Closed

Allow filtering by severity #13

evilpacket opened this issue May 10, 2018 · 7 comments

Comments

@evilpacket
Copy link
Contributor

It would be nice if reporters took in an optional severity level and only produced output for vulnerabilities at or above that severity level.

@high-stakes
Copy link

high-stakes commented May 16, 2018

For us this would also help a lot as we are using audit (relying on the error code) to break our continuous delivery pipelines. For most projects we would not like to break on low severity issues but on high security projects this is a requirement.

@mdix
Copy link
Contributor

mdix commented May 17, 2018

I'd like to take this one. I implemented some things in preparation for this one, so as soon as we merged the PRs I could work on it.

welwood08 added a commit to welwood08/npm-audit-report that referenced this issue Jul 11, 2018
The passed config object can now specify the string `severityThreshold` to hide less severe vulnerabilities. The (already-present) default 'info' threshold preserves the previous behaviour.
Implements npm#13.
welwood08 added a commit to welwood08/npm-audit-report that referenced this issue Jul 11, 2018
The passed config object can now specify the string `severityThreshold` to hide less severe vulnerabilities. The (already-present) default 'info' threshold preserves the previous behaviour.
Implements npm#13.
@llaenowyd
Copy link

this appears dead - the changes linked above by @welwood08 are not on a PR and are against a read-only, abandoned version of npm

@nazreen
Copy link

nazreen commented Aug 23, 2019

let's get this back on track!

@WilliamDASILVA
Copy link

For future Googlers, you can filter by severity using the --audit-level attribute.

npm audit --audit-level=moderate

Make sure you have a recent npm version.

@k3n
Copy link

k3n commented Oct 10, 2019

@WilliamDASILVA According to the NPM docs, and my testing, that's not how it works -- it doesn't filter anything, it merely determines what is considered a failure:

Fail an audit only if the results include a vulnerability with a level of moderate or higher:

$ npm audit --audit-level=moderate

@isaacs
Copy link
Contributor

isaacs commented May 8, 2020

Closing out all issues and PRs from 2018 and 2019, since this module has been fundamentally refactored for version 2 (npm version 7). Happy to reopen if this is still a thing worth exploring (and it'll probably be easier now if so).

@isaacs isaacs closed this as completed May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants