-
Notifications
You must be signed in to change notification settings - Fork 1.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
[PM-13455] Risk insights aggregation in a new service. #12071
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #12071 +/- ##
==========================================
+ Coverage 33.42% 33.45% +0.03%
==========================================
Files 2901 2902 +1
Lines 90564 90692 +128
Branches 17212 17238 +26
==========================================
+ Hits 30271 30341 +70
- Misses 57899 57953 +54
- Partials 2394 2398 +4 ☔ View full report in Codecov by Sentry. |
…s/pm-13455/risk-aggregations
This comment was marked as off-topic.
This comment was marked as off-topic.
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 resolving all of my feedback!
📝 There's new feedback based on the strict null checking ADR. 😖
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.
undefined
to null
per ADR-14. In this case, you could implement it by marking the provided properties as optional (?
).
♻️ The other option is to rework your PR so that it never partially defines an object. This solution should be preferred, all else being equal.
📝 I imagine time will be an issue so if you go with the ?
option, then it should have a FIXME
attached noting the above debt.
…/bitwarden/clients into tools/pm-13455/risk-aggregations
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-13455
📔 Objective
Data aggregation service for the all applications health report for risk insights.
The service contains three generate methods.
generateRawDataReport
Members, password health, and uris are associated at the cipher level. Returns the raw data containing the weak password, reused password, and exposed password. The trimmed uris and assigned members. Used for the first diagnostic tab for raw data just not displaying the members info/uris. Also used for the raw data + members diagnostic tab by displaying the member information and excluding the uris.generateRawDataUriReport
Calls thegenerateRawDataReport
for the base data. Flattens out the base data. A record for each uri is created with it's parent cipher health information.generateApplicationsReport
Calls thegenerateRawDataUriReport
for the flattened base data. The uris need to be grouped together and the report data aggregated. Returns the uri, member information, total password count, at risk member information, and at risk member counts.Important methods to note:
getTrimmedCipherUris
UsesUtils.getHostname
to trim to the hostname. For each cipher we want to return only distinct trimmed uris. A cipher can have two uris: 'https://google.com' and 'google.com/login' assigned to the cipher. Both trimmed uris are 'google.com' when flattened this would duplicate the uri detail causing incorrect totals in the final report. Only return distinct trimmed uris for each cipher.getApplicationHealthReport
Where the final health report object is aggregated. The record is at risk if their is a weak password, exposed, or reused password. If there is an existing record in the array with the current items uri. The password count value is incremented. The members are updated to include any members not already in the existing item. If the new record is at risk. At risk members are updated with any new entries and the at risk password count is incremented. If there is not an existing record. The new application health report record is created instead of updated. This method uses thegetApplicationReportDetail
private method to create the object for update/create.ℹ️ This is a work in progress meant to start the review process. Future development will include test cases and implementation.
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes