Divided recommendations into pillars

This commit is contained in:
Shay Nehmad 2019-08-08 16:50:32 +03:00
parent e4738d026c
commit a074d8e4a1
4 changed files with 89 additions and 22 deletions

View File

@ -69,7 +69,7 @@ def get_all_findings():
def get_recommendations_status():
return [
network_recomms = [
{
"Recommendation": "Do network segmentation.",
"Status": "Positive",
@ -84,16 +84,6 @@ def get_recommendations_status():
},
]
},
{
"Recommendation": "Install AV software.",
"Status": "Unexecuted",
"Tests": [
{
"Test": "Search for active AV software processes",
"Status": "Unexecuted"
}
]
},
{
"Recommendation": "Analyze malicious network traffic.",
"Status": "Inconclusive",
@ -124,6 +114,51 @@ def get_recommendations_status():
},
]
device_recomms = [
{
"Recommendation": "Install AV software.",
"Status": "Unexecuted",
"Tests": [
{
"Test": "Search for active AV software processes",
"Status": "Unexecuted"
}
]
},
]
data_recommns = [
{
"Recommendation": "Data at trasnit should be...",
"Status": "Conclusive",
"Tests": [
{
"Test": "Scan HTTP.",
"Status": "Conclusive"
},
{
"Test": "Scan elastic.",
"Status": "Unexecuted"
}
]
},
]
return [
{
"pillar": "Networks",
"recommendationStatus": network_recomms
},
{
"pillar": "Data",
"recommendationStatus": data_recommns
},
{
"pillar": "Devices",
"recommendationStatus": device_recomms
},
]
def get_pillars_grades():
return [

View File

@ -4,7 +4,7 @@ import AuthComponent from '../AuthComponent';
import ReportHeader, {ReportTypes} from "../report-components/common/ReportHeader";
import PillarGrades from "../report-components/zerotrust/PillarGrades";
import FindingsTable from "../report-components/zerotrust/FindingsTable";
import RecommendationsStatusTable from "../report-components/zerotrust/RecommendationsStatus";
import {SinglePillarRecommendationsStatus} from "../report-components/zerotrust/SinglePillarRecommendationsStatus";
class ZeroTrustReportPageComponent extends AuthComponent {
@ -40,13 +40,29 @@ class ZeroTrustReportPageComponent extends AuthComponent {
if (this.stillLoadingDataFromServer()) {
content = "Still empty";
} else {
content = <div>
const pillarsSection = <div>
<h2>Pillars Overview</h2>
<PillarGrades pillars={this.state.pillars}/>
<h2>Recommendations Status</h2>
<RecommendationsStatusTable recommendationsStatus={this.state.recommendations} />
<h2>Findings</h2>
<FindingsTable findings={this.state.findings} />
</div>;
const recommendationsSection = <div><h2>Recommendations Status</h2>
{
this.state.recommendations.map((recommendation) =>
<SinglePillarRecommendationsStatus
key={recommendation.pillar}
pillar={recommendation.pillar}
recommendationStatus={recommendation.recommendationStatus}/>
)
}
</div>;
const findingSection = <div><h2>Findings</h2>
<FindingsTable findings={this.state.findings}/></div>;
content = <div>
{pillarsSection}
{recommendationsSection}
{findingSection}
</div>;
}

View File

@ -1,5 +1,6 @@
import React, {Component} from "react";
import PagenatedTable from "../common/PagenatedTable";
import AuthComponent from "../../AuthComponent";
const columns = [
{
@ -29,7 +30,7 @@ const columns = [
}
];
class TestsStatus extends Component {
class TestsStatus extends AuthComponent {
render() {
return (
<pre>{JSON.stringify(this.props.tests,null,2)}</pre>
@ -37,9 +38,9 @@ class TestsStatus extends Component {
}
}
export class RecommendationsStatusTable extends Component {
export class RecommendationsStatusTable extends AuthComponent {
render() {
return <PagenatedTable data={this.props.recommendationsStatus} columns={columns} pageSize={5}/>;
return <PagenatedTable data={this.props.recommendationStatus} columns={columns} pageSize={5}/>;
}
}

View File

@ -0,0 +1,15 @@
import AuthComponent from "../../AuthComponent";
import {PillarLabel} from "./PillarLabel";
import RecommendationsStatusTable from "./RecommendationsStatusTable";
import React from "react";
export class SinglePillarRecommendationsStatus extends AuthComponent {
render() {
return (
<div>
<h3><PillarLabel pillar={this.props.pillar}/></h3>
<RecommendationsStatusTable recommendationStatus={this.props.recommendationStatus}/>
</div>
);
}
}