mirror of
https://github.com/bitwarden/web
synced 2025-12-13 06:43:31 +00:00
add more org reports
This commit is contained in:
@@ -40,7 +40,16 @@ import { ImportComponent as OrgImportComponent } from './organizations/tools/imp
|
|||||||
import {
|
import {
|
||||||
InactiveTwoFactorReportComponent as OrgInactiveTwoFactorReportComponent,
|
InactiveTwoFactorReportComponent as OrgInactiveTwoFactorReportComponent,
|
||||||
} from './organizations/tools/inactive-two-factor-report.component';
|
} from './organizations/tools/inactive-two-factor-report.component';
|
||||||
|
import {
|
||||||
|
ReusedPasswordsReportComponent as OrgReusedPasswordsReportComponent,
|
||||||
|
} from './organizations/tools/reused-passwords-report.component';
|
||||||
import { ToolsComponent as OrgToolsComponent } from './organizations/tools/tools.component';
|
import { ToolsComponent as OrgToolsComponent } from './organizations/tools/tools.component';
|
||||||
|
import {
|
||||||
|
UnsecuredWebsitesReportComponent as OrgUnsecuredWebsitesReportComponent,
|
||||||
|
} from './organizations/tools/unsecured-websites-report.component';
|
||||||
|
import {
|
||||||
|
WeakPasswordsReportComponent as OrgWeakPasswordsReportComponent,
|
||||||
|
} from './organizations/tools/weak-passwords-report.component';
|
||||||
|
|
||||||
import { VaultComponent as OrgVaultComponent } from './organizations/vault/vault.component';
|
import { VaultComponent as OrgVaultComponent } from './organizations/vault/vault.component';
|
||||||
|
|
||||||
@@ -214,6 +223,21 @@ const routes: Routes = [
|
|||||||
component: OrgInactiveTwoFactorReportComponent,
|
component: OrgInactiveTwoFactorReportComponent,
|
||||||
data: { titleId: 'inactive2faReport' },
|
data: { titleId: 'inactive2faReport' },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'reused-passwords-report',
|
||||||
|
component: OrgReusedPasswordsReportComponent,
|
||||||
|
data: { titleId: 'reusedPasswordsReport' },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'unsecured-websites-report',
|
||||||
|
component: OrgUnsecuredWebsitesReportComponent,
|
||||||
|
data: { titleId: 'unsecuredWebsitesReport' },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'weak-passwords-report',
|
||||||
|
component: OrgWeakPasswordsReportComponent,
|
||||||
|
data: { titleId: 'weakPasswordsReport' },
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -70,7 +70,16 @@ import { ImportComponent as OrgImportComponent } from './organizations/tools/imp
|
|||||||
import {
|
import {
|
||||||
InactiveTwoFactorReportComponent as OrgInactiveTwoFactorReportComponent,
|
InactiveTwoFactorReportComponent as OrgInactiveTwoFactorReportComponent,
|
||||||
} from './organizations/tools/inactive-two-factor-report.component';
|
} from './organizations/tools/inactive-two-factor-report.component';
|
||||||
|
import {
|
||||||
|
ReusedPasswordsReportComponent as OrgReusedPasswordsReportComponent,
|
||||||
|
} from './organizations/tools/reused-passwords-report.component';
|
||||||
import { ToolsComponent as OrgToolsComponent } from './organizations/tools/tools.component';
|
import { ToolsComponent as OrgToolsComponent } from './organizations/tools/tools.component';
|
||||||
|
import {
|
||||||
|
UnsecuredWebsitesReportComponent as OrgUnsecuredWebsitesReportComponent,
|
||||||
|
} from './organizations/tools/unsecured-websites-report.component';
|
||||||
|
import {
|
||||||
|
WeakPasswordsReportComponent as OrgWeakPasswordsReportComponent,
|
||||||
|
} from './organizations/tools/weak-passwords-report.component';
|
||||||
|
|
||||||
import { AddEditComponent as OrgAddEditComponent } from './organizations/vault/add-edit.component';
|
import { AddEditComponent as OrgAddEditComponent } from './organizations/vault/add-edit.component';
|
||||||
import { AttachmentsComponent as OrgAttachmentsComponent } from './organizations/vault/attachments.component';
|
import { AttachmentsComponent as OrgAttachmentsComponent } from './organizations/vault/attachments.component';
|
||||||
@@ -267,6 +276,7 @@ registerLocaleData(localeZhCn, 'zh-CN');
|
|||||||
OrgManageCollectionsComponent,
|
OrgManageCollectionsComponent,
|
||||||
OrgManageComponent,
|
OrgManageComponent,
|
||||||
OrgPeopleComponent,
|
OrgPeopleComponent,
|
||||||
|
OrgReusedPasswordsReportComponent,
|
||||||
OrgSettingComponent,
|
OrgSettingComponent,
|
||||||
OrgToolsComponent,
|
OrgToolsComponent,
|
||||||
OrgTwoFactorSetupComponent,
|
OrgTwoFactorSetupComponent,
|
||||||
@@ -275,7 +285,9 @@ registerLocaleData(localeZhCn, 'zh-CN');
|
|||||||
OrgUserGroupsComponent,
|
OrgUserGroupsComponent,
|
||||||
OrganizationsComponent,
|
OrganizationsComponent,
|
||||||
OrganizationLayoutComponent,
|
OrganizationLayoutComponent,
|
||||||
|
OrgUnsecuredWebsitesReportComponent,
|
||||||
OrgVaultComponent,
|
OrgVaultComponent,
|
||||||
|
OrgWeakPasswordsReportComponent,
|
||||||
PasswordGeneratorComponent,
|
PasswordGeneratorComponent,
|
||||||
PasswordGeneratorHistoryComponent,
|
PasswordGeneratorHistoryComponent,
|
||||||
PasswordStrengthComponent,
|
PasswordStrengthComponent,
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ import { CipherView } from 'jslib/models/view/cipherView';
|
|||||||
templateUrl: '../../tools/exposed-passwords-report.component.html',
|
templateUrl: '../../tools/exposed-passwords-report.component.html',
|
||||||
})
|
})
|
||||||
export class ExposedPasswordsReportComponent extends BaseExposedPasswordsReportComponent {
|
export class ExposedPasswordsReportComponent extends BaseExposedPasswordsReportComponent {
|
||||||
constructor(ciphersService: CipherService, auditService: AuditService,
|
constructor(cipherService: CipherService, auditService: AuditService,
|
||||||
componentFactoryResolver: ComponentFactoryResolver, messagingService: MessagingService,
|
componentFactoryResolver: ComponentFactoryResolver, messagingService: MessagingService,
|
||||||
userService: UserService, private route: ActivatedRoute) {
|
userService: UserService, private route: ActivatedRoute) {
|
||||||
super(ciphersService, auditService, componentFactoryResolver, messagingService, userService);
|
super(cipherService, auditService, componentFactoryResolver, messagingService, userService);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ import { CipherView } from 'jslib/models/view/cipherView';
|
|||||||
templateUrl: '../../tools/inactive-two-factor-report.component.html',
|
templateUrl: '../../tools/inactive-two-factor-report.component.html',
|
||||||
})
|
})
|
||||||
export class InactiveTwoFactorReportComponent extends BaseInactiveTwoFactorReportComponent {
|
export class InactiveTwoFactorReportComponent extends BaseInactiveTwoFactorReportComponent {
|
||||||
constructor(ciphersService: CipherService, componentFactoryResolver: ComponentFactoryResolver,
|
constructor(cipherService: CipherService, componentFactoryResolver: ComponentFactoryResolver,
|
||||||
messagingService: MessagingService, userService: UserService,
|
messagingService: MessagingService, userService: UserService,
|
||||||
private route: ActivatedRoute) {
|
private route: ActivatedRoute) {
|
||||||
super(ciphersService, componentFactoryResolver, messagingService, userService);
|
super(cipherService, componentFactoryResolver, messagingService, userService);
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnInit() {
|
async ngOnInit() {
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
ComponentFactoryResolver,
|
||||||
|
} from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||||
|
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||||
|
import { UserService } from 'jslib/abstractions/user.service';
|
||||||
|
|
||||||
|
import { CipherView } from 'jslib/models/view/cipherView';
|
||||||
|
|
||||||
|
import {
|
||||||
|
ReusedPasswordsReportComponent as BaseReusedPasswordsReportComponent,
|
||||||
|
} from '../../tools/reused-passwords-report.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-reused-passwords-report',
|
||||||
|
templateUrl: '../../tools/reused-passwords-report.component.html',
|
||||||
|
})
|
||||||
|
export class ReusedPasswordsReportComponent extends BaseReusedPasswordsReportComponent {
|
||||||
|
constructor(cipherService: CipherService, componentFactoryResolver: ComponentFactoryResolver,
|
||||||
|
messagingService: MessagingService, userService: UserService,
|
||||||
|
private route: ActivatedRoute) {
|
||||||
|
super(cipherService, componentFactoryResolver, messagingService, userService);
|
||||||
|
}
|
||||||
|
|
||||||
|
async ngOnInit() {
|
||||||
|
this.route.parent.parent.params.subscribe(async (params) => {
|
||||||
|
this.organization = await this.userService.getOrganization(params.organizationId);
|
||||||
|
await super.ngOnInit();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllCiphers(): Promise<CipherView[]> {
|
||||||
|
return this.cipherService.getAllFromApiForOrganization(this.organization.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
ComponentFactoryResolver,
|
||||||
|
} from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||||
|
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||||
|
import { UserService } from 'jslib/abstractions/user.service';
|
||||||
|
|
||||||
|
import {
|
||||||
|
UnsecuredWebsitesReportComponent as BaseUnsecuredWebsitesReportComponent,
|
||||||
|
} from '../../tools/unsecured-websites-report.component';
|
||||||
|
|
||||||
|
import { CipherView } from 'jslib/models/view/cipherView';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-unsecured-websites-report',
|
||||||
|
templateUrl: '../../tools/unsecured-websites-report.component.html',
|
||||||
|
})
|
||||||
|
export class UnsecuredWebsitesReportComponent extends BaseUnsecuredWebsitesReportComponent {
|
||||||
|
constructor(cipherService: CipherService, componentFactoryResolver: ComponentFactoryResolver,
|
||||||
|
messagingService: MessagingService, userService: UserService,
|
||||||
|
private route: ActivatedRoute) {
|
||||||
|
super(cipherService, componentFactoryResolver, messagingService, userService);
|
||||||
|
}
|
||||||
|
|
||||||
|
async ngOnInit() {
|
||||||
|
this.route.parent.parent.params.subscribe(async (params) => {
|
||||||
|
this.organization = await this.userService.getOrganization(params.organizationId);
|
||||||
|
await super.ngOnInit();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllCiphers(): Promise<CipherView[]> {
|
||||||
|
return this.cipherService.getAllFromApiForOrganization(this.organization.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import {
|
||||||
|
Component,
|
||||||
|
ComponentFactoryResolver,
|
||||||
|
} from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
|
import { CipherService } from 'jslib/abstractions/cipher.service';
|
||||||
|
import { MessagingService } from 'jslib/abstractions/messaging.service';
|
||||||
|
import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';
|
||||||
|
import { UserService } from 'jslib/abstractions/user.service';
|
||||||
|
|
||||||
|
import { CipherView } from 'jslib/models/view/cipherView';
|
||||||
|
|
||||||
|
import {
|
||||||
|
WeakPasswordsReportComponent as BaseWeakPasswordsReportComponent,
|
||||||
|
} from '../../tools/weak-passwords-report.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-weak-passwords-report',
|
||||||
|
templateUrl: '../../tools/weak-passwords-report.component.html',
|
||||||
|
})
|
||||||
|
export class WeakPasswordsReportComponent extends BaseWeakPasswordsReportComponent {
|
||||||
|
constructor(cipherService: CipherService, passwordGenerationService: PasswordGenerationService,
|
||||||
|
componentFactoryResolver: ComponentFactoryResolver, messagingService: MessagingService,
|
||||||
|
userService: UserService, private route: ActivatedRoute) {
|
||||||
|
super(cipherService, passwordGenerationService, componentFactoryResolver, messagingService, userService);
|
||||||
|
}
|
||||||
|
|
||||||
|
async ngOnInit() {
|
||||||
|
this.route.parent.parent.params.subscribe(async (params) => {
|
||||||
|
this.organization = await this.userService.getOrganization(params.organizationId);
|
||||||
|
await super.ngOnInit();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllCiphers(): Promise<CipherView[]> {
|
||||||
|
return this.cipherService.getAllFromApiForOrganization(this.organization.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ import { CipherReportComponent } from './cipher-report.component';
|
|||||||
export class ReusedPasswordsReportComponent extends CipherReportComponent implements OnInit {
|
export class ReusedPasswordsReportComponent extends CipherReportComponent implements OnInit {
|
||||||
passwordUseMap: Map<string, number>;
|
passwordUseMap: Map<string, number>;
|
||||||
|
|
||||||
constructor(private ciphersService: CipherService, componentFactoryResolver: ComponentFactoryResolver,
|
constructor(protected cipherService: CipherService, componentFactoryResolver: ComponentFactoryResolver,
|
||||||
messagingService: MessagingService, userService: UserService) {
|
messagingService: MessagingService, userService: UserService) {
|
||||||
super(componentFactoryResolver, userService, messagingService, true);
|
super(componentFactoryResolver, userService, messagingService, true);
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ export class ReusedPasswordsReportComponent extends CipherReportComponent implem
|
|||||||
}
|
}
|
||||||
|
|
||||||
async setCiphers() {
|
async setCiphers() {
|
||||||
const allCiphers = await this.ciphersService.getAllDecrypted();
|
const allCiphers = await this.getAllCiphers();
|
||||||
const ciphersWithPasswords: CipherView[] = [];
|
const ciphersWithPasswords: CipherView[] = [];
|
||||||
this.passwordUseMap = new Map<string, number>();
|
this.passwordUseMap = new Map<string, number>();
|
||||||
allCiphers.forEach((c) => {
|
allCiphers.forEach((c) => {
|
||||||
@@ -51,4 +51,8 @@ export class ReusedPasswordsReportComponent extends CipherReportComponent implem
|
|||||||
this.passwordUseMap.has(c.login.password) && this.passwordUseMap.get(c.login.password) > 1);
|
this.passwordUseMap.has(c.login.password) && this.passwordUseMap.get(c.login.password) > 1);
|
||||||
this.ciphers = reusedPasswordCiphers;
|
this.ciphers = reusedPasswordCiphers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected getAllCiphers(): Promise<CipherView[]> {
|
||||||
|
return this.cipherService.getAllDecrypted();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import { UserService } from 'jslib/abstractions/user.service';
|
|||||||
|
|
||||||
import { CipherType } from 'jslib/enums/cipherType';
|
import { CipherType } from 'jslib/enums/cipherType';
|
||||||
|
|
||||||
|
import { CipherView } from 'jslib/models/view/cipherView';
|
||||||
|
|
||||||
import { CipherReportComponent } from './cipher-report.component';
|
import { CipherReportComponent } from './cipher-report.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -17,7 +19,7 @@ import { CipherReportComponent } from './cipher-report.component';
|
|||||||
templateUrl: 'unsecured-websites-report.component.html',
|
templateUrl: 'unsecured-websites-report.component.html',
|
||||||
})
|
})
|
||||||
export class UnsecuredWebsitesReportComponent extends CipherReportComponent implements OnInit {
|
export class UnsecuredWebsitesReportComponent extends CipherReportComponent implements OnInit {
|
||||||
constructor(private ciphersService: CipherService, componentFactoryResolver: ComponentFactoryResolver,
|
constructor(protected cipherService: CipherService, componentFactoryResolver: ComponentFactoryResolver,
|
||||||
messagingService: MessagingService, userService: UserService) {
|
messagingService: MessagingService, userService: UserService) {
|
||||||
super(componentFactoryResolver, userService, messagingService, true);
|
super(componentFactoryResolver, userService, messagingService, true);
|
||||||
}
|
}
|
||||||
@@ -29,7 +31,7 @@ export class UnsecuredWebsitesReportComponent extends CipherReportComponent impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
async setCiphers() {
|
async setCiphers() {
|
||||||
const allCiphers = await this.ciphersService.getAllDecrypted();
|
const allCiphers = await this.getAllCiphers();
|
||||||
const unsecuredCiphers = allCiphers.filter((c) => {
|
const unsecuredCiphers = allCiphers.filter((c) => {
|
||||||
if (c.type !== CipherType.Login || !c.login.hasUris) {
|
if (c.type !== CipherType.Login || !c.login.hasUris) {
|
||||||
return false;
|
return false;
|
||||||
@@ -38,4 +40,8 @@ export class UnsecuredWebsitesReportComponent extends CipherReportComponent impl
|
|||||||
});
|
});
|
||||||
this.ciphers = unsecuredCiphers;
|
this.ciphers = unsecuredCiphers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected getAllCiphers(): Promise<CipherView[]> {
|
||||||
|
return this.cipherService.getAllDecrypted();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen
|
|||||||
|
|
||||||
private passwordStrengthCache = new Map<string, number>();
|
private passwordStrengthCache = new Map<string, number>();
|
||||||
|
|
||||||
constructor(private ciphersService: CipherService, private passwordGenerationService: PasswordGenerationService,
|
constructor(protected cipherService: CipherService, protected passwordGenerationService: PasswordGenerationService,
|
||||||
componentFactoryResolver: ComponentFactoryResolver, messagingService: MessagingService,
|
componentFactoryResolver: ComponentFactoryResolver, messagingService: MessagingService,
|
||||||
userService: UserService) {
|
userService: UserService) {
|
||||||
super(componentFactoryResolver, userService, messagingService, true);
|
super(componentFactoryResolver, userService, messagingService, true);
|
||||||
@@ -37,7 +37,7 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen
|
|||||||
}
|
}
|
||||||
|
|
||||||
async setCiphers() {
|
async setCiphers() {
|
||||||
const allCiphers = await this.ciphersService.getAllDecrypted();
|
const allCiphers = await this.getAllCiphers();
|
||||||
const weakPasswordCiphers: CipherView[] = [];
|
const weakPasswordCiphers: CipherView[] = [];
|
||||||
allCiphers.forEach((c) => {
|
allCiphers.forEach((c) => {
|
||||||
if (c.type !== CipherType.Login || c.login.password == null || c.login.password === '') {
|
if (c.type !== CipherType.Login || c.login.password == null || c.login.password === '') {
|
||||||
@@ -71,6 +71,10 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen
|
|||||||
this.ciphers = weakPasswordCiphers;
|
this.ciphers = weakPasswordCiphers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected getAllCiphers(): Promise<CipherView[]> {
|
||||||
|
return this.cipherService.getAllDecrypted();
|
||||||
|
}
|
||||||
|
|
||||||
private scoreKey(score: number): [string, string] {
|
private scoreKey(score: number): [string, string] {
|
||||||
switch (score) {
|
switch (score) {
|
||||||
case 4:
|
case 4:
|
||||||
|
|||||||
Reference in New Issue
Block a user