event

package
v0.0.0-...-fc1add6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2020 License: CC0-1.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(typ ...Type)

Register ... registers the given Type objects for use as Event matchers Type objects are sequentially called, so order matters

Types

type Event

type Event map[string]interface{}

Event ... holds raw CloudWatch event data

func (Event) Flatten

func (e Event) Flatten() Event

Flatten ... flattens an Event to a single-level map appending subsequent keys and zero-indexed array elements with '.' as the delimiter

func (Event) Type

func (e Event) Type() Type

Type ... calls Type.Is(Event) on each registered Type, returning the first Type that matches the provided Event type or nil if no matching Type is found

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

Processor ... is used for retaining state data for processing Event objects

func New

func New() (p *Processor, err error)

New ... returns a new *Processor

func (*Processor) ProductArn

func (p *Processor) ProductArn() string

ProductArn ... returns the value for the default SecurityHub Arn format: arn:aws:securityhub:<region>:<account-id>:product/<account-id>/default

func (*Processor) Publish

func (p *Processor) Publish(evt ...Event) error

Publish ... calls securityhub.BatchImportFindings providing the results from calling Type.Finding(Event) on each provided Event, returns an error upon failure

type RawEvent

type RawEvent []byte

RawEvent ... is a []byte with a conversion method attached (Event)

func (RawEvent) Event

func (r RawEvent) Event() (Event, error)

Event ... converts a RawEvent to an Event

type Type

type Type interface {
	Is(Event) bool
	Init(*Processor)
	Finding(Event) *securityhub.AwsSecurityFinding
}

Type ... interface for creating custom Event matchers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL