From f63efb5f6f98ef67f70ff009b07bfa4149a93609 Mon Sep 17 00:00:00 2001 From: Billy Tat Date: Wed, 13 Nov 2024 15:06:15 -0800 Subject: [PATCH] Add command to get verbose CIS scan results --- .../advanced-user-guides/cis-scan-guides/view-reports.md | 9 ++++++++- .../advanced-user-guides/cis-scan-guides/view-reports.md | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/how-to-guides/advanced-user-guides/cis-scan-guides/view-reports.md b/docs/how-to-guides/advanced-user-guides/cis-scan-guides/view-reports.md index 57dc1183dee..bb9045033bc 100644 --- a/docs/how-to-guides/advanced-user-guides/cis-scan-guides/view-reports.md +++ b/docs/how-to-guides/advanced-user-guides/cis-scan-guides/view-reports.md @@ -13,4 +13,11 @@ To view the generated CIS scan reports, 1. Click **CIS Benchmark > Scan**. 1. The **Scans** page will show the generated reports. To see a detailed report, go to a scan report and click the name. -One can download the report from the Scans list or from the scan detail page. \ No newline at end of file +One can download the report from the Scans list or from the scan detail page. + +To get the verbose version of the CIS scan results, run the following command on the cluster that was scanned. Note that the scan must be completed before this can be done. + +```console +export REPORT="scan-report-name" +kubectl get clusterscanreport $REPORT -o json |jq ".spec.reportJSON | fromjson" | jq -r ".actual_value_map_data" | base64 -d | gunzip | jq . +``` diff --git a/versioned_docs/version-2.10/how-to-guides/advanced-user-guides/cis-scan-guides/view-reports.md b/versioned_docs/version-2.10/how-to-guides/advanced-user-guides/cis-scan-guides/view-reports.md index 57dc1183dee..bb9045033bc 100644 --- a/versioned_docs/version-2.10/how-to-guides/advanced-user-guides/cis-scan-guides/view-reports.md +++ b/versioned_docs/version-2.10/how-to-guides/advanced-user-guides/cis-scan-guides/view-reports.md @@ -13,4 +13,11 @@ To view the generated CIS scan reports, 1. Click **CIS Benchmark > Scan**. 1. The **Scans** page will show the generated reports. To see a detailed report, go to a scan report and click the name. -One can download the report from the Scans list or from the scan detail page. \ No newline at end of file +One can download the report from the Scans list or from the scan detail page. + +To get the verbose version of the CIS scan results, run the following command on the cluster that was scanned. Note that the scan must be completed before this can be done. + +```console +export REPORT="scan-report-name" +kubectl get clusterscanreport $REPORT -o json |jq ".spec.reportJSON | fromjson" | jq -r ".actual_value_map_data" | base64 -d | gunzip | jq . +```