-
Notifications
You must be signed in to change notification settings - Fork 64
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
cli: allow ignoring specific vulnerability IDs #275
Conversation
87033a0
to
43d3821
Compare
@@ -442,7 +455,8 @@ def audit() -> None: | |||
if vuln_count > 0: | |||
summary_msg = ( | |||
f"Found {vuln_count} known " | |||
f"{'vulnerability' if vuln_count == 1 else 'vulnerabilities'} " | |||
f"{'vulnerability' if vuln_count == 1 else 'vulnerabilities'}" | |||
f"{(vuln_ignore_count and ', ignored %d ' % vuln_ignore_count) or ' '}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty hard to read. IMO it's okay if we render , ignored 0
by default, but cc @di for opinions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, if , ignored 0
is ok then I'm all up for it
|
43d3821
to
05680f8
Compare
05680f8
to
27c2574
Compare
4690869
to
d1e1782
Compare
This API allows developers to query whether a VulnerabilityResult contains at least one of the vulnerability IDs passed in as argument either as its ID or as one of the aliases. This method will return True if the vulnerability IDs passed in as argument intersect with the VulnerabilityResult's aliases + ID, False otherwise.
This commit introduces a new flag to pip-audit's CLI (--ignore-vuln) that takes a string representing a vulnerability id, if any of the packages scanned detect said vulnerability, it will be ignored in the final report. This allows users of pip-audit to ignore certain vulnerabilities that they may deem not exploitable for whatever reason. The flag can be used multiple times to ignore multiple vulnerabilities. Closes pypa#245
d1e1782
to
38ef697
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I'll give @di another chance to review but otherwise I can merge tonight 🙂
Thanks a ton @Elkasitu! |
## [2.3.0] - 2022-05-18 ### Added * CLI: The `--ignore-vuln` option has been added, allowing users to specify vulnerability IDs to ignore during the final report ([#275](pypa/pip-audit#275)) * CLI: The `--no-deps` flag has been added, allowing users to skip dependency resolution entirely when `pip-audit` is used in requirements mode ([#255](pypa/pip-audit#255))
This commit introduces a new flag to pip-audit's CLI (--ignore-vuln)
that takes a string representing a vulnerability id, if any of the
packages scanned detect said vulnerability, it will be ignored in the
final report.
This allows users of pip-audit to ignore certain vulnerabilities that
they may deem not exploitable for whatever reason.
The flag can be used multiple times to ignore multiple vulnerabilities.
Closes #245