Skip to content

Commit

Permalink
Remove unused fields from scan status
Browse files Browse the repository at this point in the history
  • Loading branch information
ramanan-ravi committed Apr 23, 2024
1 parent 29666c6 commit 2659879
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 30 deletions.
15 changes: 3 additions & 12 deletions scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,9 @@ func (c *ComplianceScanner) RunComplianceScan() error {
func (c *ComplianceScanner) PublishScanStatus(scanMsg string, status string, extras map[string]interface{}) error {
scanMsg = strings.ReplaceAll(scanMsg, "\n", " ")
scanLog := map[string]interface{}{
"scan_id": c.config.ScanID,
"time_stamp": util.GetIntTimestamp(),
"@timestamp": util.GetDatetimeNow(),
"scan_message": scanMsg,
"scan_status": status,
"type": util.ComplianceScanLogs,
"node_name": c.config.NodeName,
"node_id": c.config.NodeID,
"node_type": "host",
"host_name": c.config.NodeName,
"compliance_check_types": c.config.ComplianceCheckTypes,
"masked": false,
"scan_id": c.config.ScanID,
"scan_message": scanMsg,
"scan_status": status,
}
for k, v := range extras {
scanLog[k] = v
Expand Down
18 changes: 0 additions & 18 deletions util/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,3 @@ type ComplianceDoc struct {
ComplianceCheckType string `json:"compliance_check_type"`
ScanID string `json:"scan_id"`
}

type ComplianceScanLog struct {
Type string `json:"type"`
TimeStamp int64 `json:"time_stamp"`
Timestamp string `json:"@timestamp"`
Masked bool `json:"masked"`
NodeID string `json:"node_id"`
NodeType string `json:"node_type"`
KubernetesClusterName string `json:"kubernetes_cluster_name"`
KubernetesClusterID string `json:"kubernetes_cluster_id"`
NodeName string `json:"node_name"`
ScanStatus string `json:"scan_status"`
ScanMessage string `json:"scan_message"`
ComplianceCheckType string `json:"compliance_check_type"`
TotalChecks int `json:"total_checks"`
Result map[string]int `json:"result"`
ScanID string `json:"scan_id"`
}

0 comments on commit 2659879

Please sign in to comment.