Skip to content

Commit

Permalink
Add more fields in cloud posture xlsx reports (#2392)
Browse files Browse the repository at this point in the history
Add more fields in posture xlsx reports
  • Loading branch information
ramanan-ravi authored Dec 11, 2024
1 parent bbe0574 commit 2a37d27
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 4 additions & 0 deletions deepfence_worker/tasks/reports/pdf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
16 changes: 13 additions & 3 deletions deepfence_worker/tasks/reports/xlsx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
)

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2a37d27

Please sign in to comment.