Skip to content

Commit

Permalink
Rename secret field 'name' to 'rule_id' (#2363)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramanan-ravi authored Nov 6, 2024
1 parent e94ed7a commit b5f0168
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion deepfence_server/handler/scan_reports.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)})
Expand Down
3 changes: 1 addition & 2 deletions deepfence_server/model/scans.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand All @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion deepfence_worker/tasks/reports/pdf_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}).
Expand Down
2 changes: 1 addition & 1 deletion deepfence_worker/tasks/reports/xlsx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b5f0168

Please sign in to comment.