-
Notifications
You must be signed in to change notification settings - Fork 2
fix an issue where vulnerabilities were missed due to case sensitivity #814
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 an issue where vulnerabilities were missed due to case sensitivity #814
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.
Pull Request Overview
This PR fixes case sensitivity issues in SBOM parsing by normalizing key package fields to lowercase and adds a corresponding integration test.
- Lowercase
pkg_name
,source_name
,ecosystem
, andpkg_mgr
in Trivy CDX parser for case-insensitive matching - Refactor
DependencyParamsToCheck
dataclass into class scope and update references - Add integration test
test_package_name_and_ecosystem_are_lowercased_and_matched
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
api/app/sbom/parser/trivy_cdx_parser.py | Lowercase package_info fields before building artifact key |
api/app/tests/integrations/test_pteams.py | Refactor dataclass placement and add integration test for lowercase package/ecosystem names |
Comments suppressed due to low confidence (1)
api/app/tests/integrations/test_pteams.py:1309
- [nitpick] Add a case where
package_source_name
is non-null and contains uppercase letters to verify thatsource_name
is also being lowercased in the parser.
def test_package_name_and_ecosystem_are_lowercased_and_matched(self, testdb):
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.
確認お願いします
…_lowercased_and_matched
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.
APIのテストについてコメントしました
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.
LGTM
PR の目的
※SBOM投入時のpurl解釈にて、エスケープ文字がどうなっているかの調査は別PRにて対応
経緯・意図・意思決定
補足