-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix(license): add FilePath to results to allow for license path filtering via trivyignore file #6215
fix(license): add FilePath to results to allow for license path filtering via trivyignore file #6215
Conversation
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.
Hello @dus7eh
Thanks for your work!
I left comments. Take a look,
After your PR i thought about this case again.
I see 2 moments related to packages without locense info (case when we use another file to find license)
- It would be correctly to use path to license file instead of lock file. But in this case user may get confused. Because user is scanning the lock file and may not have the information that we are scanning another file to detect license.
- But if we use path to lock file as license filepath - there may be case where user wants to find this license -> user opens lockfile -> but lockfile doesn't contain license.
But in this case, the user can check the documentation and read how we define licenses for his package/language.
So i think that we can start from this solution.
dc07806
to
c2e35c2
Compare
c2e35c2
to
88a6154
Compare
Co-authored-by: DmitriyLewen <91113035+DmitriyLewen@users.noreply.github.com>
dc07329
to
61dcb50
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.
Thanks for your work and
LGTM!
@knqyf263 take a look, when you have time, please.
Description
Refers to discussion #6117 about trivyignore license definition not working properly for python packages
Before state is visible in the referred discussion.
After the change an entry is visible in logs:
DEBUG Ignored {"id": "GPL-2.0", "path": "usr/lib/python3.11/site-packages/scapy-2.5.0.dist-info/METADATA"}
with
trivyignore.yaml
defined as:Related issues
Related PRs
Remove this section if you don't have related PRs.
Checklist