mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 21:33:27 +00:00
[PM-1699] Updated low kdf iterations warning (#5170)
* updated low ksf iterations warning * Removed test implementation * Removed unused translation and updated key * Enabled low kdf on this branch for testing * Removed duplicate showKdf initialiazation * [PM-1700] Put KDF warning behind a LaunchDarkly Feature Flag (#5308) * Added feature flag for low kdf iteration * Added feature flag implementation to component * Renamed feature flag to align with what is setup on LaunchDarkly
This commit is contained in:
@@ -4,14 +4,14 @@
|
|||||||
{{ "lowKdfIterations" | i18n }}
|
{{ "lowKdfIterations" | i18n }}
|
||||||
</div>
|
</div>
|
||||||
<div class="tw-p-5">
|
<div class="tw-p-5">
|
||||||
<p>{{ "lowKdfIterationsDesc" | i18n }}</p>
|
<p>{{ "updateLowKdfIterationsDesc" | i18n }}</p>
|
||||||
<a
|
<a
|
||||||
bitButton
|
bitButton
|
||||||
buttonType="secondary"
|
buttonType="secondary"
|
||||||
[block]="true"
|
[block]="true"
|
||||||
routerLink="/settings/security/security-keys"
|
routerLink="/settings/security/security-keys"
|
||||||
>
|
>
|
||||||
{{ "changeKdfSettings" | i18n }}
|
{{ "updateKdfSettings" | i18n }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import { SearchPipe } from "@bitwarden/angular/pipes/search.pipe";
|
|||||||
import { DialogServiceAbstraction, SimpleDialogType } from "@bitwarden/angular/services/dialog";
|
import { DialogServiceAbstraction, SimpleDialogType } from "@bitwarden/angular/services/dialog";
|
||||||
import { ModalService } from "@bitwarden/angular/services/modal.service";
|
import { ModalService } from "@bitwarden/angular/services/modal.service";
|
||||||
import { BroadcasterService } from "@bitwarden/common/abstractions/broadcaster.service";
|
import { BroadcasterService } from "@bitwarden/common/abstractions/broadcaster.service";
|
||||||
|
import { ConfigServiceAbstraction } from "@bitwarden/common/abstractions/config/config.service.abstraction";
|
||||||
import { CryptoService } from "@bitwarden/common/abstractions/crypto.service";
|
import { CryptoService } from "@bitwarden/common/abstractions/crypto.service";
|
||||||
import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service";
|
import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service";
|
||||||
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
||||||
@@ -47,6 +48,7 @@ import { Organization } from "@bitwarden/common/admin-console/models/domain/orga
|
|||||||
import { CollectionView } from "@bitwarden/common/admin-console/models/view/collection.view";
|
import { CollectionView } from "@bitwarden/common/admin-console/models/view/collection.view";
|
||||||
import { TokenService } from "@bitwarden/common/auth/abstractions/token.service";
|
import { TokenService } from "@bitwarden/common/auth/abstractions/token.service";
|
||||||
import { DEFAULT_PBKDF2_ITERATIONS, EventType, KdfType } from "@bitwarden/common/enums";
|
import { DEFAULT_PBKDF2_ITERATIONS, EventType, KdfType } from "@bitwarden/common/enums";
|
||||||
|
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
||||||
import { ServiceUtils } from "@bitwarden/common/misc/serviceUtils";
|
import { ServiceUtils } from "@bitwarden/common/misc/serviceUtils";
|
||||||
import { Utils } from "@bitwarden/common/misc/utils";
|
import { Utils } from "@bitwarden/common/misc/utils";
|
||||||
import { TreeNode } from "@bitwarden/common/models/domain/tree-node";
|
import { TreeNode } from "@bitwarden/common/models/domain/tree-node";
|
||||||
@@ -171,7 +173,8 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
private totpService: TotpService,
|
private totpService: TotpService,
|
||||||
private eventCollectionService: EventCollectionService,
|
private eventCollectionService: EventCollectionService,
|
||||||
private searchService: SearchService,
|
private searchService: SearchService,
|
||||||
private searchPipe: SearchPipe
|
private searchPipe: SearchPipe,
|
||||||
|
private configService: ConfigServiceAbstraction
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
@@ -186,8 +189,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
first(),
|
first(),
|
||||||
switchMap(async (params: Params) => {
|
switchMap(async (params: Params) => {
|
||||||
this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
|
this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
|
||||||
// disable warning for March release -> add await this.isLowKdfIteration(); when ready
|
this.showLowKdf = await this.isLowKdfIteration();
|
||||||
this.showLowKdf = false;
|
|
||||||
await this.syncService.fullSync(false);
|
await this.syncService.fullSync(false);
|
||||||
|
|
||||||
const canAccessPremium = await this.stateService.getCanAccessPremium();
|
const canAccessPremium = await this.stateService.getCanAccessPremium();
|
||||||
@@ -855,9 +857,17 @@ export class VaultComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async isLowKdfIteration() {
|
async isLowKdfIteration() {
|
||||||
const kdfType = await this.stateService.getKdfType();
|
const showLowKdfEnabled = await this.configService.getFeatureFlagBool(
|
||||||
const kdfOptions = await this.stateService.getKdfConfig();
|
FeatureFlag.DisplayLowKdfIterationWarningFlag
|
||||||
return kdfType === KdfType.PBKDF2_SHA256 && kdfOptions.iterations < DEFAULT_PBKDF2_ITERATIONS;
|
);
|
||||||
|
|
||||||
|
if (showLowKdfEnabled) {
|
||||||
|
const kdfType = await this.stateService.getKdfType();
|
||||||
|
const kdfOptions = await this.stateService.getKdfConfig();
|
||||||
|
return kdfType === KdfType.PBKDF2_SHA256 && kdfOptions.iterations < DEFAULT_PBKDF2_ITERATIONS;
|
||||||
|
}
|
||||||
|
|
||||||
|
return showLowKdfEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async repromptCipher(ciphers: CipherView[]) {
|
protected async repromptCipher(ciphers: CipherView[]) {
|
||||||
|
|||||||
@@ -6564,11 +6564,8 @@
|
|||||||
"lowKdfIterations": {
|
"lowKdfIterations": {
|
||||||
"message": "Low KDF Iterations"
|
"message": "Low KDF Iterations"
|
||||||
},
|
},
|
||||||
"lowKdfIterationsDesc": {
|
"updateLowKdfIterationsDesc": {
|
||||||
"message": "Increase your KDF encryption settings to improve the security of your account."
|
"message": "Update your encryption settings to meet new security recommendations and improve account protection."
|
||||||
},
|
|
||||||
"changeKdfSettings": {
|
|
||||||
"message": "Change KDF settings"
|
|
||||||
},
|
},
|
||||||
"changeKdfLoggedOutWarning": {
|
"changeKdfLoggedOutWarning": {
|
||||||
"message": "Proceeding will log you out of all active sessions. You will need to log back in and complete two-step login setup. We recommend exporting your vault before changing your encryption settings to prevent data loss."
|
"message": "Proceeding will log you out of all active sessions. You will need to log back in and complete two-step login setup. We recommend exporting your vault before changing your encryption settings to prevent data loss."
|
||||||
@@ -6759,5 +6756,8 @@
|
|||||||
"smProjectsDeleteBulkConfirmation": {
|
"smProjectsDeleteBulkConfirmation": {
|
||||||
"message": "The following projects can not be deleted. Would you like to continue?",
|
"message": "The following projects can not be deleted. Would you like to continue?",
|
||||||
"description": "The message shown to the user when bulk deleting projects and the user doesn't have access to some projects."
|
"description": "The message shown to the user when bulk deleting projects and the user doesn't have access to some projects."
|
||||||
|
},
|
||||||
|
"updateKdfSettings": {
|
||||||
|
"message": "Update KDF settings"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
export enum FeatureFlag {
|
export enum FeatureFlag {
|
||||||
DisplayEuEnvironmentFlag = "display-eu-environment",
|
DisplayEuEnvironmentFlag = "display-eu-environment",
|
||||||
|
DisplayLowKdfIterationWarningFlag = "display-kdf-iteration-warning",
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user