-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Metrics performance improvements #10446
Conversation
… line with previous offering
…her than reimplementing
Hi there 👋, @DryRunSecurity here, below is a summary of our analysis and findings.
Note 🟢 Risk threshold not exceeded. Change Summary (click to expand)The following is a summary of changes in this pull request made by me, your security buddy 🤖. Note that this summary is auto-generated and not meant to be a definitive list of security issues but rather a helpful summary from a security perspective. Summary: The code changes in this pull request are primarily focused on improving the data representation and visualization of the security metrics in the Defect Dojo application. The changes include updates to the Django templates, utility functions, and database queries used to fetch and process the metrics data. The key changes include:
From an application security perspective, the changes do not introduce any obvious security vulnerabilities. The code focuses on improving the data presentation and processing, without any significant changes to the underlying security-sensitive functionality. However, it's important to review the entire codebase and ensure that proper security practices are followed throughout the application, such as input validation, secure coding, and adherence to best practices. Files Changed:
Powered by DryRun Security |
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.
Approved
…d null values, use correct reverse lookup on urls in accepted/closed/open tables
[sc-6399] |
Description
This patch updates some of the metrics views (those handled by the dojo.metrics.views.metrics() view function -- the dashboard, findings, endpoints, and product type views) to use database aggregation instead of Python data wrangling to speed up page loads. Much of the support functionality was moved to a new module, dojo.metrics.utils.
Locally, page loads generally decreased from around mid-20s seconds to under a couple.
Aggregates are the same, though some display is changed -- the metrics charts include a bit more data, including the current month now, e.g. for Findings product type metrics on the same dataset:
Old (data up through 4/30):
New (data includes June statistics):
Data tables have been changed to include Info severity information (discrepancies in total counts between current/closed metrics and this patch can be attributed to this).
To support faster load times, The 'Detail Breakdown' table has been changed to only list the first 50 Finding details along with a count of total (if more than 50); pagination across the entire dataset can be added in a future patch.
Blake gave fantastic direction on this and deserves credit.
Test results
The following metrics pages were tested:
https://localhost/metrics?date=5&view=dashboard
https://localhost/metrics/product/type?type=Finding
https://localhost/metrics/product/type?type=Endpoint
https://localhost/metrics/product/type/$id (varied over $date)
They load faster and appear to be comparable, with the above noted changes, to the existing versions.