-
Notifications
You must be signed in to change notification settings - Fork 29
feat: enhance correlation for SBOMs without CPE #1958
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1958 +/- ##
==========================================
+ Coverage 67.75% 68.01% +0.26%
==========================================
Files 355 355
Lines 19816 19816
Branches 19816 19816
==========================================
+ Hits 13426 13478 +52
+ Misses 5613 5557 -56
- Partials 777 781 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
/scale-test |
🛠️ Scale test has started! Follow the progress here: Workflow Run |
Goose ReportGoose Attack ReportPlan Overview
Request Metrics
Response Time Metrics
Status Code Metrics
Transaction Metrics
Scenario Metrics
📄 Full Report (Go to "Artifacts" and download report) |
I tried it today against load test and large sbom to see how performances are affected by this change. The subquery in this case causes
I think something like this
is what we want. It still needs to be properly tested for performances. |
This looks good, no more errors on duplicate cpes. I also manually tested sbom/advisory endpoint and there are no regressions (we should really automate this, even if it's very slow). |
Reviewer's GuideEnhance SBOM-to-advisory correlation by extending the CPE filter logic to include SBOMs without any CPE entries, and validate this behavior through new integration tests and fixtures. Entity Relationship diagram for enhanced SBOM-to-CPE correlationerDiagram
SBOM {
int id
}
SBOM_PACKAGE_CPE_REF {
int sbom_id
int node_id
int cpe_id
}
PACKAGE_RELATES_TO_PACKAGE {
int sbom_id
int right_node_id
int relationship
}
SBOM ||--o{ SBOM_PACKAGE_CPE_REF : contains
SBOM ||--o{ PACKAGE_RELATES_TO_PACKAGE : relates
SBOM_PACKAGE_CPE_REF }o--|| SBOM : references
PACKAGE_RELATES_TO_PACKAGE }o--|| SBOM : references
SBOM_PACKAGE_CPE_REF }o--|| PACKAGE_RELATES_TO_PACKAGE : node_id
Class diagram for raw SQL filter logic updateclassDiagram
class RawSql {
+CONTEXT_CPE_FILTER_SQL: &str
}
RawSql : +CONTEXT_CPE_FILTER_SQL includes logic for SBOMs without CPE
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
@dejanb how do we want to proceed with this PR? do you feel like this is ready for approval? Just let me know 😃 |
Signed-off-by: mrizzi <mrizzi@redhat.com>
Signed-off-by: mrizzi <mrizzi@redhat.com>
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.
Looks good. I did manual scale test for the endpoint. No regressions. The issue to improve this for the future is guacsec/trustify-scale-test-runs#17
Successfully created backport PR for |
https://issues.redhat.com/browse/TC-2805
Summary by Sourcery
Enhance SBOM advisory correlation to support cases where SBOMs have no CPE references or contain multiple CPE entries, by updating the raw SQL filter and adding corresponding tests with new SBOM fixtures.
Enhancements:
Tests:
Chores: