Skip to content

Commit

Permalink
Merge pull request #35 from kubescape/uns-kdr
Browse files Browse the repository at this point in the history
Refactor topics.go to update topic names and add new topic for RuntimeIncident
  • Loading branch information
kooomix authored Jul 24, 2024
2 parents a424555 + ea9bb74 commit a0f91a8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions pulsar/common/kdr/datastructures.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package kdr

import (
"time"

"github.com/armosec/armoapi-go/identifiers"
"go.uber.org/zap"
)

type RuntimeIncidentIngesterOnFinishedMessage struct {
ReportTime time.Time `json:"reportTime"`
SendTime time.Time `json:"sendTime"`
CustomerGUID string `json:"customerGUID"`
IncidentPolicyGUIDs []string `json:"incidentPolicyGUIDs"`
IncidentGUID string `json:"incidentGUID"`
IncidentName string `json:"incidentName"` // incidentType.Name - ThreatName
Severity string `json:"severity"`
Resource identifiers.PortalDesignator `json:"resource"` // Pod, Node, Workload, Namespace, Cluster, etc.
}

func (si *RuntimeIncidentIngesterOnFinishedMessage) GetLoggerFields() []zap.Field {
fields := []zap.Field{
zap.String("customerGUID", si.CustomerGUID),
}

return fields
}
1 change: 1 addition & 0 deletions pulsar/common/topics.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const (
PostureOnFinishPulsarTopic = "kubescape-scan-report-finished-v1"
SecurityRisksOnFinishPulsarTopic = "security-risks-scan-report-finished-v1"
UIViewsIngesterOnFinishPulsarTopic = "ui-views-finished-v1"
RuntimeIncidentOnFinishPulsarTopic = "runtime-incident-finished-v1"

UNSOnFinishSubscriptionName = "uns-report-finished"

Expand Down

0 comments on commit a0f91a8

Please sign in to comment.