mirror of
https://github.com/bitwarden/browser.git
synced 2025-03-12 13:39:14 +01:00
unsecured websites report
This commit is contained in:
parent
0ede65e9ca
commit
4a0b4de322
@ -54,6 +54,7 @@ import { ImportComponent } from './tools/import.component';
|
||||
import { PasswordGeneratorComponent } from './tools/password-generator.component';
|
||||
import { ReusedPasswordsReportComponent } from './tools/reused-passwords-report.component';
|
||||
import { ToolsComponent } from './tools/tools.component';
|
||||
import { UnsecuredWebsitesReportComponent } from './tools/unsecured-websites-report.component';
|
||||
|
||||
import { VaultComponent } from './vault/vault.component';
|
||||
|
||||
@ -154,6 +155,11 @@ const routes: Routes = [
|
||||
component: ReusedPasswordsReportComponent,
|
||||
data: { titleId: 'reusedPasswordsReport' },
|
||||
},
|
||||
{
|
||||
path: 'unsecured-websites-report',
|
||||
component: UnsecuredWebsitesReportComponent,
|
||||
data: { titleId: 'unsecuredWebsitesReport' },
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
@ -110,6 +110,7 @@ import { PasswordGeneratorHistoryComponent } from './tools/password-generator-hi
|
||||
import { PasswordGeneratorComponent } from './tools/password-generator.component';
|
||||
import { ReusedPasswordsReportComponent } from './tools/reused-passwords-report.component';
|
||||
import { ToolsComponent } from './tools/tools.component';
|
||||
import { UnsecuredWebsitesReportComponent } from './tools/unsecured-websites-report.component';
|
||||
|
||||
import { AddEditComponent } from './vault/add-edit.component';
|
||||
import { AttachmentsComponent } from './vault/attachments.component';
|
||||
@ -264,6 +265,7 @@ registerLocaleData(localeZhCn, 'zh-CN');
|
||||
OrgVaultComponent,
|
||||
PasswordGeneratorComponent,
|
||||
PasswordGeneratorHistoryComponent,
|
||||
PasswordStrengthComponent,
|
||||
PaymentComponent,
|
||||
PremiumComponent,
|
||||
ProfileComponent,
|
||||
@ -290,6 +292,7 @@ registerLocaleData(localeZhCn, 'zh-CN');
|
||||
TwoFactorU2fComponent,
|
||||
TwoFactorVerifyComponent,
|
||||
TwoFactorYubiKeyComponent,
|
||||
UnsecuredWebsitesReportComponent,
|
||||
UpdateKeyComponent,
|
||||
UpdateLicenseComponent,
|
||||
UserBillingComponent,
|
||||
@ -298,7 +301,6 @@ registerLocaleData(localeZhCn, 'zh-CN');
|
||||
VerifyEmailComponent,
|
||||
VerifyEmailTokenComponent,
|
||||
VerifyRecoverDeleteComponent,
|
||||
PasswordStrengthComponent,
|
||||
],
|
||||
entryComponents: [
|
||||
AddEditComponent,
|
||||
|
@ -24,6 +24,9 @@
|
||||
<a routerLink="reused-passwords-report" class="list-group-item" routerLinkActive="active">
|
||||
{{'reusedPasswordsReport' | i18n}}
|
||||
</a>
|
||||
<a routerLink="unsecured-websites-report" class="list-group-item" routerLinkActive="active">
|
||||
{{'unsecuredWebsitesReport' | i18n}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
34
src/app/tools/unsecured-websites-report.component.html
Normal file
34
src/app/tools/unsecured-websites-report.component.html
Normal file
@ -0,0 +1,34 @@
|
||||
<div class="page-header">
|
||||
<h1>{{'unsecuredWebsitesReport' | i18n}}</h1>
|
||||
</div>
|
||||
<p>{{'unsecuredWebsitesReportDesc' | i18n}}</p>
|
||||
<div *ngIf="loading">
|
||||
<i class="fa fa-spinner fa-spin text-muted" title="{{'loading' | i18n}}"></i>
|
||||
</div>
|
||||
<div class="mt-4" *ngIf="!loading">
|
||||
<app-callout type="success" title="{{'goodNews' | i18n}}" *ngIf="!ciphers.length">
|
||||
{{'noUnsecuredWebsites'}}
|
||||
</app-callout>
|
||||
<ng-container *ngIf="ciphers.length">
|
||||
<app-callout type="danger" title="{{'unsecuredWebsitesFound' | i18n}}">
|
||||
{{'unsecuredWebsitesFoundDesc' | i18n : ciphers.length}}
|
||||
</app-callout>
|
||||
<table class="table table-hover table-list table-ciphers">
|
||||
<tbody>
|
||||
<tr *ngFor="let c of ciphers">
|
||||
<td class="table-list-icon">
|
||||
<app-vault-icon [cipher]="c"></app-vault-icon>
|
||||
</td>
|
||||
<td class="reduced-lh wrap">
|
||||
<a href="#" appStopClick (click)="selectCipher(c)" title="{{'editItem' | i18n}}">{{c.name}}</a>
|
||||
<i class="fa fa-share-alt" *ngIf="!organization && c.organizationId" title="{{'shared' | i18n}}"></i>
|
||||
<i class="fa fa-paperclip" title="{{'attachments' | i18n}}" *ngIf="c.hasAttachments"></i>
|
||||
<br>
|
||||
<small>{{c.subTitle}}</small>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</ng-container>
|
||||
</div>
|
||||
<ng-template #cipherAddEdit></ng-template>
|
76
src/app/tools/unsecured-websites-report.component.ts
Normal file
76
src/app/tools/unsecured-websites-report.component.ts
Normal file
@ -0,0 +1,76 @@
|
||||
import {
|
||||
Component,
|
||||
ComponentFactoryResolver,
|
||||
OnInit,
|
||||
ViewChild,
|
||||
ViewContainerRef,
|
||||
} from '@angular/core';
|
||||
|
||||
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||
|
||||
import { CipherView } from 'jslib/models/view/cipherView';
|
||||
|
||||
import { CipherType } from 'jslib/enums/cipherType';
|
||||
|
||||
import { ModalComponent } from '../modal.component';
|
||||
import { AddEditComponent } from '../vault/add-edit.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-unsecured-websites-report',
|
||||
templateUrl: 'unsecured-websites-report.component.html',
|
||||
})
|
||||
export class UnsecuredWebsitesReportComponent implements OnInit {
|
||||
@ViewChild('cipherAddEdit', { read: ViewContainerRef }) cipherAddEditModalRef: ViewContainerRef;
|
||||
|
||||
loading = true;
|
||||
hasLoaded = false;
|
||||
ciphers: CipherView[] = [];
|
||||
|
||||
private modal: ModalComponent = null;
|
||||
|
||||
constructor(private ciphersService: CipherService, private componentFactoryResolver: ComponentFactoryResolver) { }
|
||||
|
||||
async ngOnInit() {
|
||||
this.load();
|
||||
this.hasLoaded = true;
|
||||
}
|
||||
|
||||
async load() {
|
||||
this.loading = true;
|
||||
const allCiphers = await this.ciphersService.getAllDecrypted();
|
||||
this.ciphers = allCiphers.filter((c) => {
|
||||
if (c.type !== CipherType.Login || !c.login.hasUris) {
|
||||
return false;
|
||||
}
|
||||
return c.login.uris.find((u) => u.uri.indexOf('http://') === 0) != null;
|
||||
});
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
selectCipher(cipher: CipherView) {
|
||||
if (this.modal != null) {
|
||||
this.modal.close();
|
||||
}
|
||||
|
||||
const factory = this.componentFactoryResolver.resolveComponentFactory(ModalComponent);
|
||||
this.modal = this.cipherAddEditModalRef.createComponent(factory).instance;
|
||||
const childComponent = this.modal.show<AddEditComponent>(
|
||||
AddEditComponent, this.cipherAddEditModalRef);
|
||||
|
||||
childComponent.cipherId = cipher == null ? null : cipher.id;
|
||||
childComponent.onSavedCipher.subscribe(async (c: CipherView) => {
|
||||
this.modal.close();
|
||||
await this.load();
|
||||
});
|
||||
childComponent.onDeletedCipher.subscribe(async (c: CipherView) => {
|
||||
this.modal.close();
|
||||
await this.load();
|
||||
});
|
||||
|
||||
this.modal.onClosed.subscribe(() => {
|
||||
this.modal = null;
|
||||
});
|
||||
|
||||
return childComponent;
|
||||
}
|
||||
}
|
@ -1287,6 +1287,27 @@
|
||||
"reports": {
|
||||
"message": "Reports"
|
||||
},
|
||||
"unsecuredWebsitesReport": {
|
||||
"message": "Unsecured Websites Report"
|
||||
},
|
||||
"unsecuredWebsitesReportDesc": {
|
||||
"message": "Using unsecured websites with the http:// scheme can be dangerous. If the website allows, you should always access it using the https:// scheme."
|
||||
},
|
||||
"unsecuredWebsitesFound": {
|
||||
"message": "Unsecured Websites Found"
|
||||
},
|
||||
"unsecuredWebsitesFoundDesc": {
|
||||
"message": "We found $COUNT$ items in your vault with unsecured URIs. You should change their URI scheme to https:// if they allow it.",
|
||||
"placeholders": {
|
||||
"count": {
|
||||
"content": "$1",
|
||||
"example": "8"
|
||||
}
|
||||
}
|
||||
},
|
||||
"noUnsecuredWebsites": {
|
||||
"message": "No items in your vault have unsecured URIs."
|
||||
},
|
||||
"reusedPasswordsReport": {
|
||||
"message": "Reused Passwords Report"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user