-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add pulsar topics and message structs + fix BuildNonPersistentTopic (#4)
* add pulsar topics and message structs Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io> * move files Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io> * more consts Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io> * Update pulsar/common/attackchains/topics.go Co-authored-by: kooomix <eranm@armosec.io> Signed-off-by: YiscahLevySilas1 <80635572+YiscahLevySilas1@users.noreply.github.com> * Update pulsar/connector/types.go Co-authored-by: kooomix <eranm@armosec.io> Signed-off-by: YiscahLevySilas1 <80635572+YiscahLevySilas1@users.noreply.github.com> * delete duplication Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io> * add AttackChainDelete Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io> --------- Signed-off-by: YiscahLevySilas1 <yiscahls@armosec.io> Signed-off-by: YiscahLevySilas1 <80635572+YiscahLevySilas1@users.noreply.github.com> Co-authored-by: kooomix <eranm@armosec.io>
- Loading branch information
1 parent
4f24edf
commit dc797df
Showing
4 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package attackchains | ||
|
||
// structs for Pulsar messages | ||
|
||
type AttackChainEngineIngesterMessage struct { | ||
ImageScanID string `json:"imageScanID"` | ||
ReportGUID string `json:"reportGUID"` | ||
CustomerGUID string `json:"customerGUID"` | ||
ClusterName string `json:"clusterName"` | ||
} | ||
|
||
type AttackChainFirstSeen struct { | ||
AttackChainID string `json:"attackChainID,omitempty" bson:"attackChainID,omitempty"` // name/cluster/resourceID | ||
CustomerGUID string `json:"customerGUID,omitempty" bson:"customerGUID,omitempty"` | ||
ViewedMainScreen string `json:"viewedMainScreen,omitempty" bson:"viewedMainScreen,omitempty"` | ||
} | ||
|
||
type AttackChainScanStatus struct { | ||
ClusterName string `json:"clusterName,omitempty" bson:"clusterName,omitempty"` | ||
CustomerGUID string `json:"customerGUID,omitempty" bson:"customerGUID,omitempty"` | ||
ProcessingStatus string `json:"processingStatus,omitempty" bson:"processingStatus,omitempty"` // "processing"/ "done" | ||
} | ||
|
||
type AttackChainDelete struct { | ||
ClusterName string `json:"clusterName,omitempty" bson:"clusterName,omitempty"` | ||
CustomerGUID string `json:"customerGUID,omitempty" bson:"customerGUID,omitempty"` | ||
} | ||
|
||
func (acps *AttackChainScanStatus) GetCustomerGUID() string { | ||
return acps.CustomerGUID | ||
} | ||
|
||
func (acfs *AttackChainFirstSeen) GetCustomerGUID() string { | ||
return acfs.CustomerGUID | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package attackchains | ||
|
||
const ( | ||
// topic names | ||
AttackChainStateScanStateTopic = "attack-chain-scan-state-v1" | ||
AttackChainStateViewedTopic = "attack-chain-viewed-v1" | ||
KubescapeScanReportFinishedTopic = "kubescape-scan-report-finished-v1" | ||
) | ||
|
||
// --------- Ingesters structs and consts ------------- | ||
|
||
// supported topics and properties: | ||
// [topic]/[propName]/[propValue] | ||
|
||
// attack-chain-scan-state-v1/action/update | ||
// attack-chain-viewed-v1/action/update | ||
|
||
const ( | ||
MsgPropAction = "action" | ||
MsgPropActionValueUpdate = "update" | ||
NsgPropActionValueDelete = "delete" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
package connector | ||
|