Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: style check status in CISKubeBenchReport #75

Merged
merged 1 commit into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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