Skip to content

Commit

Permalink
Merge pull request #168 from armosec/SUB-2869
Browse files Browse the repository at this point in the history
SUB-2869 | add ScanWithoutAccessKeyEvent
  • Loading branch information
refaelm92 authored Nov 1, 2023
2 parents fa0afcc + ceb5d75 commit c580c50
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
25 changes: 15 additions & 10 deletions broadcastevents/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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"`
}
7 changes: 7 additions & 0 deletions broadcastevents/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
7 changes: 7 additions & 0 deletions broadcastevents/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

0 comments on commit c580c50

Please sign in to comment.