-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 31: Support trivy scan2html k8s --report summary cluster intera…
…ctive_result.html (#34) * Support trivy scan2html k8s --report summary cluster interactive_result.html * Support trivy scan2html k8s --report summary cluster interactive_result.html
- Loading branch information
1 parent
d0c7d23
commit 049c8ed
Showing
15 changed files
with
35,307 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
name: "scan2html" | ||
repository: github.com/fatihtokus/scan2html | ||
version: "0.2.5" | ||
version: "0.2.6" | ||
usage: scan targets into a smart html file | ||
description: |- | ||
A Trivy plugin that scans and outputs the results to a html file. | ||
trivy scan2html [-h,--help] command target filename | ||
platforms: | ||
- selector: | ||
os: windows | ||
uri: https://github.com/fatihtokus/scan2html/releases/download/v0.2.5/scan2html.tar.gz | ||
uri: https://github.com/fatihtokus/scan2html/releases/download/v0.2.6/scan2html.tar.gz | ||
bin: ./scan2html.sh | ||
- | ||
uri: https://github.com/fatihtokus/scan2html/releases/download/v0.2.5/scan2html.tar.gz | ||
uri: https://github.com/fatihtokus/scan2html/releases/download/v0.2.6/scan2html.tar.gz | ||
bin: ./scan2html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
src/frontend-app/src/components/trivy-report/K8sClusterSummary.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import { Table } from "antd"; | ||
const { Column, ColumnGroup } = Table; | ||
import { NormalizedResultForDataTable } from "../../types"; | ||
|
||
interface K8sClusterSummaryProps { | ||
k8sClusterSummaryInfraAssessment: NormalizedResultForDataTable[]; | ||
k8sClusterSummaryRBACAssessment: NormalizedResultForDataTable[]; | ||
} | ||
|
||
const K8sClusterSummary: React.FC<K8sClusterSummaryProps> = ({ k8sClusterSummaryInfraAssessment, k8sClusterSummaryRBACAssessment }) => { | ||
console.log("K8sClusterSummary-k8sSummaryInfraAssessment:", k8sClusterSummaryInfraAssessment); | ||
console.log("K8sClusterSummary-k8sSummaryRBACAssessment:", k8sClusterSummaryRBACAssessment); | ||
|
||
return ( | ||
<> | ||
<Table dataSource={k8sClusterSummaryInfraAssessment} size="small" bordered title={() => 'Infra Assessment'} footer={() => 'CRITICAL=C HIGH= H, MEDIUM=M LOW=L UNDEFINED=U'}> | ||
<Column title="Namespace" dataIndex="Namespace" key="Namespace" | ||
/> | ||
<Column title="Resource" dataIndex="Target" key="Resource" defaultSortOrder="descend" | ||
sorter={(a: NormalizedResultForDataTable, b: NormalizedResultForDataTable) => a.Target.localeCompare(b.Target)}/> | ||
<ColumnGroup title="Vulnerabilities"> | ||
<Column title="C" key="c" render={(record: NormalizedResultForDataTable) => | ||
record.VulnerabilitiesSummary?.Critical === 0 ? "" : record.VulnerabilitiesSummary?.Critical } | ||
sorter={(a: NormalizedResultForDataTable, b: NormalizedResultForDataTable) => | ||
a.VulnerabilitiesSummary && b.VulnerabilitiesSummary ? a.VulnerabilitiesSummary.Critical - b.VulnerabilitiesSummary.Critical : 0 | ||
}/> | ||
<Column title="H" key="h" render={(record: NormalizedResultForDataTable) => ( | ||
record.VulnerabilitiesSummary?.High === 0 ? "" : record.VulnerabilitiesSummary?.High | ||
)}/> | ||
<Column title="M" key="m" render={(record: NormalizedResultForDataTable) => ( | ||
record.VulnerabilitiesSummary?.Medium === 0 ? "" : record.VulnerabilitiesSummary?.Medium | ||
)}/> | ||
<Column title="L" key="l" render={(record: NormalizedResultForDataTable) => ( | ||
record.VulnerabilitiesSummary?.Low === 0 ? "" : record.VulnerabilitiesSummary?.Low | ||
)}/> | ||
<Column title="U" key="u" render={(record: NormalizedResultForDataTable) => ( | ||
record.VulnerabilitiesSummary?.Undefined === 0 ? "" : record.VulnerabilitiesSummary?.Undefined | ||
)}/> | ||
</ColumnGroup> | ||
<ColumnGroup title="Misconfigurations"> | ||
<Column title="C" key="c" render={(record: NormalizedResultForDataTable) => | ||
record.MisconfigurationsSummary?.Critical === 0 ? "" : record.MisconfigurationsSummary?.Critical | ||
}/> | ||
<Column title="H" key="h" render={(record: NormalizedResultForDataTable) => ( | ||
record.MisconfigurationsSummary?.High === 0 ? "" : record.MisconfigurationsSummary?.High | ||
)}/> | ||
<Column title="M" key="m" render={(record: NormalizedResultForDataTable) => ( | ||
record.MisconfigurationsSummary?.Medium === 0 ? "" : record.MisconfigurationsSummary?.Medium | ||
)}/> | ||
<Column title="L" key="l" render={(record: NormalizedResultForDataTable) => ( | ||
record.MisconfigurationsSummary?.Low === 0 ? "" : record.MisconfigurationsSummary?.Low | ||
)}/> | ||
<Column title="U" key="u" render={(record: NormalizedResultForDataTable) => ( | ||
record.MisconfigurationsSummary?.Undefined === 0 ? "" : record.MisconfigurationsSummary?.Undefined | ||
)}/> | ||
</ColumnGroup> | ||
<ColumnGroup title="Secrets"> | ||
<Column title="C" key="c" render={(record: NormalizedResultForDataTable) => | ||
record.SecretsSummary?.Critical === 0 ? "" : record.SecretsSummary?.Critical | ||
}/> | ||
<Column title="H" key="h" render={(record: NormalizedResultForDataTable) => ( | ||
record.SecretsSummary?.High === 0 ? "" : record.SecretsSummary?.High | ||
)}/> | ||
<Column title="M" key="m" render={(record: NormalizedResultForDataTable) => ( | ||
record.SecretsSummary?.Medium === 0 ? "" : record.SecretsSummary?.Medium | ||
)}/> | ||
<Column title="L" key="l" render={(record: NormalizedResultForDataTable) => ( | ||
record.SecretsSummary?.Low === 0 ? "" : record.SecretsSummary?.Low | ||
)}/> | ||
<Column title="U" key="u" render={(record: NormalizedResultForDataTable) => ( | ||
record.SecretsSummary?.Undefined === 0 ? "" : record.SecretsSummary?.Undefined | ||
)}/> | ||
</ColumnGroup> | ||
</Table> | ||
|
||
<Table dataSource={k8sClusterSummaryRBACAssessment} size="small" title={() => 'RBAC Assessment'} bordered> | ||
<Column title="Namespace" dataIndex="Namespace" key="Namespace" /> | ||
<Column title="Resource" dataIndex="Target" key="Resource" defaultSortOrder="descend" | ||
sorter={(a: NormalizedResultForDataTable, b: NormalizedResultForDataTable) => a.Target.localeCompare(b.Target) | ||
}/> | ||
<ColumnGroup title="RBAC Assessment"> | ||
<Column title="C" key="c" render={(record: NormalizedResultForDataTable) => | ||
record.MisconfigurationsSummary?.Critical === 0 ? "" : record.MisconfigurationsSummary?.Critical} | ||
sorter={(a: NormalizedResultForDataTable, b: NormalizedResultForDataTable) => | ||
a.MisconfigurationsSummary && b.MisconfigurationsSummary ? a.MisconfigurationsSummary.Critical - b.MisconfigurationsSummary.Critical : 0 | ||
}/> | ||
<Column title="H" key="h" render={(record: NormalizedResultForDataTable) => ( | ||
record.MisconfigurationsSummary?.High === 0 ? "" : record.MisconfigurationsSummary?.High | ||
)}/> | ||
<Column title="M" key="m" render={(record: NormalizedResultForDataTable) => ( | ||
record.MisconfigurationsSummary?.Medium === 0 ? "" : record.MisconfigurationsSummary?.Medium | ||
)}/> | ||
<Column title="L" key="l" render={(record: NormalizedResultForDataTable) => ( | ||
record.MisconfigurationsSummary?.Low === 0 ? "" : record.MisconfigurationsSummary?.Low | ||
)}/> | ||
<Column title="U" key="u" render={(record: NormalizedResultForDataTable) => ( | ||
record.MisconfigurationsSummary?.Undefined === 0 ? "" : record.MisconfigurationsSummary?.Undefined | ||
)}/> | ||
</ColumnGroup> | ||
</Table> | ||
</> | ||
); | ||
}; | ||
|
||
export default K8sClusterSummary; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.