Skip to content

Commit

Permalink
feat: style ConfigAuditReports (#78)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>
  • Loading branch information
danielpacak authored Feb 28, 2022
1 parent be0edef commit 0f082a9
Show file tree
Hide file tree
Showing 13 changed files with 72 additions and 51 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,14 @@ You must have a working [Node.js] environment.
- VulnerabilityReports

![](./docs/images/lens_vulnerability_report.png)
![](./docs/images/vulnerability_report.png)

![](./docs/images/lens_workload_vulnerabilities.png)
- ConfigAuditReports
- ConfigAuditReports and ClusterConfigAuditReports

![](./docs/images/lens_configaudit_report.png)
![](./docs/images/configaudit_report.png)
- CISKubeBenchReports

![](./docs/images/lens_ciskubebench_report.png)
![](./docs/images/ciskubebench_report.png)

[lens]: https://github.com/lensapp/lens
[starboard]: https://github.com/aquasecurity/starboard
Expand Down
Binary file added docs/images/ciskubebench_report.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/configaudit_report.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/lens_ciskubebench_report.png
Binary file not shown.
Binary file removed docs/images/lens_configaudit_report.png
Binary file not shown.
Binary file removed docs/images/lens_vulnerability_report.png
Binary file not shown.
Binary file removed docs/images/lens_workload_vulnerabilities.png
Binary file not shown.
Binary file added docs/images/vulnerability_report.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aquasecurity/starboard-lens-extension",
"publisher": "aquasecurity.github.io",
"version": "0.7.0",
"version": "0.8.0",
"description": "Lens extension for viewing Starboard security information",
"homepage": "https://github.com/aquasecurity/starboard-lens-extension",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/ciskubebenchreports/cisresults-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export class CISResultsList extends React.Component<Props> {
return (
<TableRow key={"" + index} nowrap>
<TableCell className="number">{results[index].test_number}</TableCell>
<TableCell className="description">{this.renderDescription(results[index])}</TableCell>
<TableCell className="status">
<Badge className={"Badge status-" + results[index].status} small label={results[index].status}/>
</TableCell>
<TableCell className="description">{this.renderDescription(results[index])}</TableCell>
</TableRow>
)
}
Expand Down
80 changes: 50 additions & 30 deletions src/configauditreports/checks-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,45 +15,65 @@
}

.Table {
.Badge {
&.severity-CRITICAL {
color: white;
background-color: #cc1814;
.TableCell {
&.checkID {
text-align: left;
flex-grow: 0.15;
}

&.severity-danger {
color: white;
background-color: #cc1814;
&.severity {
text-align: center;
flex-grow: 0.1;
}

&.severity-HIGH {
color: white;
background-color: #ffa500;
&.message {
text-align: left;
flex-grow: 0.65;
}

&.severity-warning {
color: white;
background-color: #ffa500;
&.status {
text-align: center;
flex-grow: 0.1;
}

&.severity-MEDIUM {
color: white;
background-color: #f0c20c;
}
.Badge {
&.severity-CRITICAL {
color: white;
background-color: #cc1814;
}

&.severity-LOW {
color: white;
background-color: #096ab0;
}
&.severity-danger {
color: white;
background-color: #cc1814;
}

&.status-PASS {
color: white;
background-color: #00b09b;
}
&.severity-HIGH {
color: white;
background-color: #ffa500;
}

&.severity-warning {
color: white;
background-color: #ffa500;
}

&.severity-MEDIUM {
color: white;
background-color: #f0c20c;
}

&.severity-LOW {
color: white;
background-color: #096ab0;
}

&.status-PASS {
color: white;
background-color: #00b09b;
}

&.status-FAIL {
color: white;
background-color: #cc1814;
&.status-FAIL {
color: white;
background-color: #cc1814;
}
}
}
}
Expand Down
26 changes: 14 additions & 12 deletions src/configauditreports/checks-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,21 @@ export class ChecksList extends React.Component<Props> {
const {checks} = this.props;
const check = checks.find(item => item.checkID == uid);
let status = 'PASS'
if (check.success) {
if (!check.success) {
status = 'FAIL'
}
return (
<TableRow key={check.checkID} nowrap>
<TableCell className="checkID">{check.checkID}</TableCell>
<TableCell className="checkSeverity">
<TableCell className="checkID">
<Badge flat expandable={false} label={check.checkID} tooltip={check.checkID}/>
</TableCell>
<TableCell className="severity">
<Badge className={"Badge severity-" + check.severity} small label={check.severity}/>
</TableCell>
<TableCell className="checkCategory">
<Badge flat expandable={false} key="imageRef" label={check.message}
tooltip={check.message}/>
<TableCell className="message">
<Badge flat expandable={false} label={check.message} tooltip={check.message}/>
</TableCell>
<TableCell>
<TableCell className="status">
<Badge className={"Badge status-" + status} small label={status}/>
</TableCell>
</TableRow>
Expand All @@ -67,18 +68,19 @@ export class ChecksList extends React.Component<Props> {
const sorted = checks.sort(BySeverity)

return (
<div className="ChecksList">
<Table tableId="configurationChecksTable"
<div className="ChecksList flex column">
<Table className="box grow"
tableId="configurationChecksTable"
selectable
virtual={virtual}
items={sorted}
getTableRow={this.getTableRow}
>
<TableHead>
<TableCell className="checkID">ID</TableCell>
<TableCell className="checkSeverity">Severity</TableCell>
<TableCell className="checkCategory">Message</TableCell>
<TableCell className="checkSuccess">Status</TableCell>
<TableCell className="severity">Severity</TableCell>
<TableCell className="message">Message</TableCell>
<TableCell className="status">Status</TableCell>
</TableHead>
{
!virtual && sorted.map((check: Check) => this.getTableRow(check.getId()))
Expand Down

0 comments on commit 0f082a9

Please sign in to comment.