From 2a37d27b228e16df180a54b4564c98138ac09275 Mon Sep 17 00:00:00 2001 From: Ramanan Ravikumar <38394463+ramanan-ravi@users.noreply.github.com> Date: Wed, 11 Dec 2024 20:09:00 +0530 Subject: [PATCH] Add more fields in cloud posture xlsx reports (#2392) Add more fields in posture xlsx reports --- deepfence_worker/tasks/reports/pdf.go | 4 ++++ deepfence_worker/tasks/reports/xlsx.go | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/deepfence_worker/tasks/reports/pdf.go b/deepfence_worker/tasks/reports/pdf.go index 3689e01d2e..6f2fc10544 100644 --- a/deepfence_worker/tasks/reports/pdf.go +++ b/deepfence_worker/tasks/reports/pdf.go @@ -78,6 +78,10 @@ func getMarato() core.Maroto { func getFiltersPage(title string, scanType string, nodeType []string, timeRange string, severity string, advFilters string) core.Page { + if timeRange == "" { + timeRange = "0001-01-01T00:00:00Z - 0001-01-01T00:00:00Z" + } + cellStyle := &props.Cell{ BackgroundColor: &props.Color{Red: 255, Green: 255, Blue: 255}, BorderType: border.Full, diff --git a/deepfence_worker/tasks/reports/xlsx.go b/deepfence_worker/tasks/reports/xlsx.go index 7e9ad0af6c..618a1e1356 100644 --- a/deepfence_worker/tasks/reports/xlsx.go +++ b/deepfence_worker/tasks/reports/xlsx.go @@ -62,17 +62,22 @@ var ( "F1": "Control ID", "G1": "Node Name", "H1": "Node Type", - "I1": "Masked", + "I1": "Remediation", + "J1": "Masked", } cloudComplianceHeader = map[string]string{ - "A1": "Compliance Standard", + "A1": "Benchmark", "B1": "Status", "C1": "Title", "D1": "Description", "E1": "Control ID", "F1": "Account", "G1": "Cloud Provider", - "H1": "Masked", + "H1": "Resource", + "I1": "Region", + "J1": "Reason", + "K1": "Service", + "L1": "Masked", } ) @@ -432,6 +437,7 @@ func xlsxAddCompResults(xlsx *excelize.File, sheet string, offset int, data Scan c.TestNumber, data.ScanInfo.NodeName, data.ScanInfo.NodeType, + c.RemediationScript, c.Masked, } err = xlsx.SetSheetRow(sheet, cellName, &value) @@ -502,6 +508,10 @@ func xlsxAddCloudCompResults(xlsx *excelize.File, sheet string, data ScanData[mo c.ControlID, data.ScanInfo.NodeName, data.ScanInfo.NodeType, + c.Resource, + c.Region, + c.Reason, + c.Service, c.Masked, } err = xlsx.SetSheetRow(sheet, cellName, &value)