diff --git a/broadcastevents/events.go b/broadcastevents/events.go index c23222f..9aabcc8 100644 --- a/broadcastevents/events.go +++ b/broadcastevents/events.go @@ -17,19 +17,19 @@ type EventBase struct { } type AttackChainCreated struct { - EventBase `json:",inline"` - ClusterName string `json:"clusterName"` - ACId string `json:"ACId"` - ACType string `json:"ACType"` - ACFirstSeeing string `json:"ACFirstSeeing"` + EventBase `json:",inline"` + ClusterName string `json:"clusterName"` + ACId string `json:"ACId"` + ACType string `json:"ACType"` + ACFirstSeeing string `json:"ACFirstSeeing"` } type AttackChainResolved struct { - EventBase `json:",inline"` - ClusterName string `json:"clusterName"` - ACId string `json:"ACId"` - ACType string `json:"ACType"` - ACFirstSeeing string `json:"ACFirstSeeing"` + EventBase `json:",inline"` + ClusterName string `json:"clusterName"` + ACId string `json:"ACId"` + ACType string `json:"ACType"` + ACFirstSeeing string `json:"ACFirstSeeing"` } type AggregationEvent struct { @@ -95,3 +95,8 @@ type AlertChannelEvent struct { Compliance string `json:"compliance score has decreased,omitempty"` NewAdmin string `json:"new cluster admin was added,omitempty"` } + +type ScanWithoutAccessKeyEvent struct { + EventBase `json:",inline"` + ClusterName string `json:"clusterName"` +} diff --git a/broadcastevents/events_test.go b/broadcastevents/events_test.go index 9bb94a1..a847705 100644 --- a/broadcastevents/events_test.go +++ b/broadcastevents/events_test.go @@ -117,3 +117,10 @@ func TestNewIgnoreRuleEvent(t *testing.T) { assert.Equal(t, "id1,id2", event.IgnoredIds) assert.Equal(t, 2, event.Resources) } + +func TestNewScanWithoutAccessKeyEvent(t *testing.T) { + event := NewScanWithoutAccessKeyEvent("testGUID", "cluster123") + assert.Equal(t, "testGUID", event.CustomerGUID) + assert.Equal(t, "cluster123", event.ClusterName) + assert.Equal(t, "ScanWithoutAccessKey", event.EventName) +} diff --git a/broadcastevents/factory.go b/broadcastevents/factory.go index c9606ab..a851976 100644 --- a/broadcastevents/factory.go +++ b/broadcastevents/factory.go @@ -310,3 +310,10 @@ func newAlertChannelDetailedEvent(customerGUID, name string, channel notificatio } return event } + +func NewScanWithoutAccessKeyEvent(customerGUID, clusterName string) ScanWithoutAccessKeyEvent { + return ScanWithoutAccessKeyEvent{ + EventBase: NewBaseEvent(customerGUID, "ScanWithoutAccessKey", nil), + ClusterName: clusterName, + } +}