Improved UI by creating distinct functions related to immediate threats report component

This commit is contained in:
VakarisZ 2021-03-31 11:55:22 +03:00
parent 05fda70cd6
commit a284467a1a
1 changed files with 33 additions and 0 deletions

View File

@ -435,6 +435,13 @@ class ReportPageComponent extends AuthComponent {
return overviews;
}
isIssuePotentialSecurityIssue(issueName) {
let issueDescriptor = this.IssueDescriptorEnum[issueName];
return issueDescriptor.hasOwnProperty(this.issueContentTypes.TYPE) &&
issueDescriptor[this.issueContentTypes.TYPE] === this.issueTypes.WARNING &&
issueDescriptor.hasOwnProperty(this.issueContentTypes.OVERVIEW);
}
getImmediateThreats() {
let threatCount = this.getImmediateThreatCount()
return (
@ -467,6 +474,32 @@ class ReportPageComponent extends AuthComponent {
return threatCount;
}
isIssueImmediateThreat(issueName) {
let issueDescriptor = this.IssueDescriptorEnum[issueName];
return issueDescriptor.hasOwnProperty(this.issueContentTypes.TYPE) &&
issueDescriptor[this.issueContentTypes.TYPE] === this.issueTypes.DANGER &&
issueDescriptor.hasOwnProperty(this.issueContentTypes.OVERVIEW);
}
getImmediateThreatsOverviews() {
let overviews = [];
let issues = this.state.report.overview.issues;
for(let i=0; i < issues.length; i++) {
if (this.isIssueImmediateThreat(issues[i])) {
if (issues[i] === 'ZerologonExploiter' && issues.includes('zerologon_pass_restore_failed')){
overviews.push(this.getIssueOverview(this.IssueDescriptorEnum['zerologon_pass_restore_failed']));
} else {
overviews.push(this.getIssueOverview(this.IssueDescriptorEnum[issues[i]]));
}
}
}
return overviews;
}
getIssueOverview(issueDescriptor) {
return issueDescriptor[this.issueContentTypes.OVERVIEW]();
}
generateReportRecommendationsSection() {
return (