Skip to content

Commit

Permalink
feat: style check status in CISKubeBenchReport (#75)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>
  • Loading branch information
danielpacak committed Feb 25, 2022
1 parent 481dcc6 commit 4a3974c
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 29 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,15 @@ You must have a working [Node.js] environment.
- VulnerabilityReports

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

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

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

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

[lens]: https://github.com/lensapp/lens
[starboard]: https://github.com/aquasecurity/starboard
[starboard-crds]: https://aquasecurity.github.io/starboard/latest/crds/
Expand Down
Binary file added docs/images/lens_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/lens_workload_vulnerabilities.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/ciskubebenchreports/cisresults-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,28 @@
&.status {
flex-grow: 0.2;
}

.Badge {
&.status-FAIL {
color: white;
background-color: #cc1814;
}

&.status-WARN {
color: white;
background-color: #ffa500;
}

&.status-INFO {
color: white;
background-color: #515456;
}

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

}
Expand Down
10 changes: 3 additions & 7 deletions src/ciskubebenchreports/cisresults-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {CISResult} from "./types";
const {
Component: {
Table,
TableHead,
TableRow,
TableCell,
DrawerTitle,
Expand All @@ -33,7 +32,9 @@ export class CISResultsList extends React.Component<Props> {
<TableRow key={"" + index} nowrap>
<TableCell className="number">{results[index].test_number}</TableCell>
<TableCell className="description">{this.renderDescription(results[index])}</TableCell>
<TableCell className="status">{results[index].status}</TableCell>
<TableCell className="status">
<Badge className={"Badge status-" + results[index].status} small label={results[index].status}/>
</TableCell>
</TableRow>
)
}
Expand All @@ -45,11 +46,6 @@ export class CISResultsList extends React.Component<Props> {
<div className="CISResultsList flex column">
<DrawerTitle title={title}/>
<Table selectable scrollable={false} className="CISResultsTable box grow">
<TableHead sticky={false}>
<TableCell className="number">Number</TableCell>
<TableCell className="description">Description</TableCell>
<TableCell className="status">Status</TableCell>
</TableHead>
{
results.map((result, index) => this.getTableRow(index))
}
Expand Down
24 changes: 2 additions & 22 deletions src/ciskubebenchreports/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {Renderer} from "@k8slens/extensions";
import {Scanner} from "../starboard/types";

export class CISSection {
id: string;
Expand Down Expand Up @@ -27,29 +28,8 @@ export class CISKubeBenchReport extends Renderer.K8sApi.KubeObject {
static namespaced = false
static apiBase = "/apis/aquasecurity.github.io/v1alpha1/ciskubebenchreports"

kind: string
apiVersion: string
metadata: {
name: string;
namespace: string;
selfLink: string;
uid: string;
resourceVersion: string;
creationTimestamp: string;
labels: {
[key: string]: string;
};
annotations: {
[key: string]: string;
};
}

report: {
scanner: {
name: string;
vendor: string;
version: string;
}
scanner: Scanner
summary: {
failCount: number;
infoCount: number;
Expand Down

0 comments on commit 4a3974c

Please sign in to comment.