1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-21 11:35:34 +01: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:
SmithThe4th 2023-05-04 09:46:12 -04:00 committed by GitHub
parent c2278c082c
commit 50eea96ec5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 13 deletions

View File

@ -4,14 +4,14 @@
{{ "lowKdfIterations" | i18n }}
</div>
<div class="tw-p-5">
<p>{{ "lowKdfIterationsDesc" | i18n }}</p>
<p>{{ "updateLowKdfIterationsDesc" | i18n }}</p>
<a
bitButton
buttonType="secondary"
[block]="true"
routerLink="/settings/security/security-keys"
>
{{ "changeKdfSettings" | i18n }}
{{ "updateKdfSettings" | i18n }}
</a>
</div>
</div>

View File

@ -32,6 +32,7 @@ import { SearchPipe } from "@bitwarden/angular/pipes/search.pipe";
import { DialogServiceAbstraction, SimpleDialogType } from "@bitwarden/angular/services/dialog";
import { ModalService } from "@bitwarden/angular/services/modal.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 { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.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 { TokenService } from "@bitwarden/common/auth/abstractions/token.service";
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 { Utils } from "@bitwarden/common/misc/utils";
import { TreeNode } from "@bitwarden/common/models/domain/tree-node";
@ -171,7 +173,8 @@ export class VaultComponent implements OnInit, OnDestroy {
private totpService: TotpService,
private eventCollectionService: EventCollectionService,
private searchService: SearchService,
private searchPipe: SearchPipe
private searchPipe: SearchPipe,
private configService: ConfigServiceAbstraction
) {}
async ngOnInit() {
@ -186,8 +189,7 @@ export class VaultComponent implements OnInit, OnDestroy {
first(),
switchMap(async (params: Params) => {
this.showVerifyEmail = !(await this.tokenService.getEmailVerified());
// disable warning for March release -> add await this.isLowKdfIteration(); when ready
this.showLowKdf = false;
this.showLowKdf = await this.isLowKdfIteration();
await this.syncService.fullSync(false);
const canAccessPremium = await this.stateService.getCanAccessPremium();
@ -855,9 +857,17 @@ export class VaultComponent implements OnInit, OnDestroy {
}
async isLowKdfIteration() {
const kdfType = await this.stateService.getKdfType();
const kdfOptions = await this.stateService.getKdfConfig();
return kdfType === KdfType.PBKDF2_SHA256 && kdfOptions.iterations < DEFAULT_PBKDF2_ITERATIONS;
const showLowKdfEnabled = await this.configService.getFeatureFlagBool(
FeatureFlag.DisplayLowKdfIterationWarningFlag
);
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[]) {

View File

@ -6564,11 +6564,8 @@
"lowKdfIterations": {
"message": "Low KDF Iterations"
},
"lowKdfIterationsDesc": {
"message": "Increase your KDF encryption settings to improve the security of your account."
},
"changeKdfSettings": {
"message": "Change KDF settings"
"updateLowKdfIterationsDesc": {
"message": "Update your encryption settings to meet new security recommendations and improve account protection."
},
"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."
@ -6759,5 +6756,8 @@
"smProjectsDeleteBulkConfirmation": {
"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."
},
"updateKdfSettings": {
"message": "Update KDF settings"
}
}

View File

@ -1,3 +1,4 @@
export enum FeatureFlag {
DisplayEuEnvironmentFlag = "display-eu-environment",
DisplayLowKdfIterationWarningFlag = "display-kdf-iteration-warning",
}