From 623deea4fcf6543e34b95950ee2b5d6eb0893e56 Mon Sep 17 00:00:00 2001 From: Tom <144813356+ttalty@users.noreply.github.com> Date: Thu, 15 May 2025 10:36:57 -0400 Subject: [PATCH] Adding at risk cipher ids for accurate notifications (#14784) --- .../src/dirt/reports/risk-insights/models/password-health.ts | 1 + .../risk-insights/services/risk-insights-report.service.ts | 3 +++ 2 files changed, 4 insertions(+) diff --git a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/models/password-health.ts b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/models/password-health.ts index 27e135667b4..d24d8386ecd 100644 --- a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/models/password-health.ts +++ b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/models/password-health.ts @@ -27,6 +27,7 @@ export type ApplicationHealthReportDetail = { applicationName: string; passwordCount: number; atRiskPasswordCount: number; + atRiskCipherIds: string[]; memberCount: number; atRiskMemberCount: number; memberDetails: MemberDetailsFlat[]; diff --git a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/risk-insights-report.service.ts b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/risk-insights-report.service.ts index a503d24cad7..e4fece801b6 100644 --- a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/risk-insights-report.service.ts +++ b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/risk-insights-report.service.ts @@ -354,12 +354,15 @@ export class RiskInsightsReportService { : newUriDetail.cipherMembers, atRiskMemberDetails: existingUriDetail ? existingUriDetail.atRiskMemberDetails : [], atRiskPasswordCount: existingUriDetail ? existingUriDetail.atRiskPasswordCount : 0, + atRiskCipherIds: existingUriDetail ? existingUriDetail.atRiskCipherIds : [], atRiskMemberCount: existingUriDetail ? existingUriDetail.atRiskMemberDetails.length : 0, cipher: newUriDetail.cipher, } as ApplicationHealthReportDetail; if (isAtRisk) { reportDetail.atRiskPasswordCount = reportDetail.atRiskPasswordCount + 1; + reportDetail.atRiskCipherIds.push(newUriDetail.cipherId); + reportDetail.atRiskMemberDetails = this.getUniqueMembers( reportDetail.atRiskMemberDetails.concat(newUriDetail.cipherMembers), );