diff --git a/deepfence_server/handler/scan_reports.go b/deepfence_server/handler/scan_reports.go index 84cf52ecca..b4c098c9ee 100644 --- a/deepfence_server/handler/scan_reports.go +++ b/deepfence_server/handler/scan_reports.go @@ -1155,7 +1155,7 @@ func (h *Handler) ListSecretScanResultRulesHandler(w http.ResponseWriter, r *htt rules := []string{} for _, e := range entries { - rules = append(rules, e.Name) + rules = append(rules, e.RuleID) } err = httpext.JSON(w, http.StatusOK, model.SecretScanResultRules{Rules: lo.Uniq(rules)}) diff --git a/deepfence_server/model/scans.go b/deepfence_server/model/scans.go index 7e143b1213..d40f948f87 100644 --- a/deepfence_server/model/scans.go +++ b/deepfence_server/model/scans.go @@ -304,7 +304,7 @@ type Secret struct { UpdatedAt int64 `json:"updated_at" required:"true"` Level string `json:"level" validate:"required,oneof=critical high medium low unknown" required:"true" enum:"critical,high,medium,low,unknown"` Score float64 `json:"score" required:"true"` - Name string `json:"name" required:"true"` + RuleID string `json:"rule_id" required:"true"` Resources []BasicNode `json:"resources" required:"false"` } @@ -326,7 +326,6 @@ func (Secret) GetJSONCategory() string { type SecretRule struct { RuleID string `json:"rule_id"` - Name string `json:"name"` Part string `json:"part"` SignatureToMatch string `json:"signature_to_match"` Level string `json:"level" required:"true"` diff --git a/deepfence_worker/tasks/reports/pdf_secret.go b/deepfence_worker/tasks/reports/pdf_secret.go index 20a0d2e13b..ae0f4b3f40 100644 --- a/deepfence_worker/tasks/reports/pdf_secret.go +++ b/deepfence_worker/tasks/reports/pdf_secret.go @@ -91,7 +91,7 @@ func secretPDF(ctx context.Context, params utils.ReportParams) (core.Document, e text.NewCol(1, strconv.Itoa(k+1), props.Text{Size: 10, Top: 1, Align: align.Center}). WithStyle(cellStyle), - text.NewCol(2, v.Name, + text.NewCol(2, v.RuleID, props.Text{Size: 10, Top: 1, Align: align.Center, BreakLineStrategy: breakline.DashStrategy}).WithStyle(cellStyle), text.NewCol(3, v.FullFilename, props.Text{Size: 10, Left: 1, Top: 1, BreakLineStrategy: breakline.DashStrategy}). diff --git a/deepfence_worker/tasks/reports/xlsx.go b/deepfence_worker/tasks/reports/xlsx.go index 0c6d2fd296..fa39ad0394 100644 --- a/deepfence_worker/tasks/reports/xlsx.go +++ b/deepfence_worker/tasks/reports/xlsx.go @@ -206,7 +206,7 @@ func secretXLSX(ctx context.Context, params utils.ReportParams) (string, error) value := []interface{}{ s.FullFilename, s.MatchedContent, - s.Name, + s.RuleID, s.Level, s.StartingIndex, nodeScanData.ScanInfo.NodeName,