-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: Filter vuln host list cves and show assessment by severity #375
feat: Filter vuln host list cves and show assessment by severity #375
Conversation
Signed-off-by: Darren Murray <[email protected]>
Co-authored-by: Salim Afiune <[email protected]>
Signed-off-by: Darren Murray <[email protected]>
Signed-off-by: Darren Murray <[email protected]>
Signed-off-by: Darren Murray <[email protected]>
Signed-off-by: Darren Murray <[email protected]>
5dd3545
to
b90ac84
Compare
Signed-off-by: Darren Murray <[email protected]>
Signed-off-by: Darren Murray <[email protected]>
Signed-off-by: Darren Murray <[email protected]>
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.
When developing these new flags we need to make sure we give proper messages to our users if not, they will be confused.
For example, if I run this command with the severity flag set to critical:
$ lacework vuln host list-cves --severity critical
There are no vulnerabilities in your environment.
That message is misleading 👆🏽 because there are indeed vulnerabilities, but there are NO vulnerabilities with a critical severity, the message should be instead:
There are no critical vulnerabilities in your environment.
This is the pattern we followed for the other flags --active
and --fixable
,
here an example:
$ lacework vuln host list-cves --active --fixable
There are no fixable vulnerabilities of packages actively running in your environment.
This makes me think that the other |
cli/cmd/vuln_host.go
Outdated
} | ||
|
||
// order by severity | ||
sort.Slice(out, func(i, j int) bool { | ||
return severityOrder(out[i][1]) < severityOrder(out[j][1]) | ||
}) | ||
|
||
return out | ||
if len(filteredPackages) > 0 { | ||
filteredOutput := fmt.Sprintf("%v of %v package(s) showing \n", len(out), len(aggregatedPackages)+len(filteredPackages)) |
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.
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 quite like this way, with the most important details first. But open to be persuaded otherwise.
showing 1 of 100 package(s)
vs
1 of 100 package(s) showing
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.
@afiune Slightly different behaviour in vuln ctr code path as we check the result of the vuln assessment when displaying the 0 vulns output instead checking the length of the output rows. I've putting in a fix for the current vuln host scenario. I will address the inconsistency in the 2 code paths in our refactor ticket. |
Signed-off-by: Darren Murray <[email protected]>
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.
Co-authored-by: Salim Afiune <[email protected]>
Co-authored-by: Salim Afiune <[email protected]>
Co-authored-by: Salim Afiune <[email protected]>
Signed-off-by: Darren Murray <[email protected]>
Signed-off-by: Darren Murray <[email protected]>
Filter vuln host commands by severity:
Usage :
lacework vuln host list-cves --severity high
lacework vuln host list-cves --active --severity high --fixable
lacework vuln host show-assessment 101 --severity high
lacework vuln host show-assessment 101 --packages --severity high
Output:
Signed-off-by: Darren Murray [email protected]