-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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(misconf): show the resource name in the report #4806
Conversation
any update on this @nikpivkin? |
@simar7 The changes made to defsec have not yet been merged into trivy |
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.
We can add a small test for this change as described. In addition lets also document this behavior as it a user facing change.
for i, occ := range misconf.CauseMetadata.Occurrences { | ||
lineInfo := fmt.Sprintf("%d-%d", occ.Location.StartLine, occ.Location.EndLine) | ||
if occ.Location.StartLine >= occ.Location.EndLine { | ||
lineInfo = fmt.Sprintf("%d", occ.Location.StartLine) | ||
} | ||
|
||
r.printf( | ||
" %s<dim>via </dim><italic>%s<dim>:%s (%s)\n", | ||
strings.Repeat(" ", i+2), | ||
occ.Filename, | ||
lineInfo, | ||
occ.Resource, | ||
) | ||
} | ||
|
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.
Can we add a test case for this? You can add it here https://github.com/aquasecurity/trivy/blob/6cc3c4c9e59d6dcfd4d00ef88c6a25e834bf292d/pkg/report/table/misconfig_test.go
hi @knqyf263 this is a new feature and should go into v0.45.0, is there way to have a merge queue by milestone? Otherwise we will have to wait to merge until the end of the month is here. |
As far as I know, there is no way to do that.
But v0.44.1 will be out next week, and we can merge this PR just after that. |
v0.44.1 is out. I'll see if everything is fine in v0.44.1 (if there is a problem, we need to cut v0.44.2) and merge this PR. |
Description
Before
After
Related issues
Related PRs
Checklist