-
Notifications
You must be signed in to change notification settings - Fork 75
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
Support additional exclude vulnerability files #269
Support additional exclude vulnerability files #269
Conversation
Thanks for the contribution! Before we can merge this, we need @uvegla to sign the Sonatype Contributor License Agreement. |
@bhamail @DarthHater Can I please get your feedback / review on this change? Thanks in advance! 🙇🏻 |
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.
+1 Nice test coverage! Thanks!!! I plan to merge this puppy pronto. Please holler if you object to either of my changes - happy to revert them if needed.
@@ -262,13 +263,22 @@ We support exclusion of vulnerability either by CVE-ID (ex: `CVE-2018-20303`) or | |||
|
|||
##### Via file | |||
|
|||
By default if a file named `.nancy-ignore` exists in the same directory that nancy is run it will use it, will no other options need to be passed. | |||
By default, if a file named `.nancy-ignore` exists in the same directory that nancy is run it will use it - no other options need to be passed. |
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 hope you don't object to the doc change I made here. I think it is clearer, but happy to revert if you disagree.
This change adds the possibility to split
.nancy-ignore
files into multiple ones in a non-breaking way. The "root" file is still kept as.nancy-ignore
or can be overwritten with the-x
/--exclude-vulnerability-file
flag but on top of that a list of additional files can be set via the-a
/--additional-exclude-vulnerability-files
flag.The most common use case for using multiple files is when an organisation wants centrally control some of the common known vulnerabilities across hundreds of repositories by generating a file. It makes sense when there are common 3rd party libraries used in upstream dependencies that are either not updated anymore and the organisation cannot change the usage of them in a short period of time, but it takes a short migration for example. By generating am ignore file via automated means controlled by a central force it can save the headache for the rest of the organisation to handle these one-by-one.
However there can still be known vulnerabilities a team wants to ignore for their own repository that is specific to only that one, so the build pipeline for an organisation could look something like:
go list -json -deps | nancy sleuth -a .nancy-ignore.local
I chose to add an additional flag to keep backwards compatibility when someone uses the
-x
/--exclude-vulnerability-file
. An other approach could be to change that flag to a list instead and rename it to-x
/--exclude-vulnerability-files
. Because of this it is still possible to control the root ignore file via that flag and do something like the below example.go list -json -deps | nancy sleuth -x .nancy-ignore.generated -a .nancy-ignore.local
cc @bhamail / @DarthHater