event

package
v0.0.2-0...-4ce78c8 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Passed is used to report successful result of a rule check (condition passed)
	Passed = "passed"
	// Failed is used to report unsuccessful result of a rule check (condition failed)
	Failed = "failed"
	// Error is used to report result of a rule check that resulted in an error (unable to evaluate condition)
	Error = "error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data map[string]interface{}

Data defines a key value map for storing attributes of a reported rule event

type Event

type Event struct {
	AgentRuleID      string      `json:"agentRuleId,omitempty"`
	AgentRuleVersion int         `json:"agentRuleVersion,omitempty"`
	Result           string      `json:"result,omitempty"`
	ResourceType     string      `json:"resourceType,omitempty"`
	ResourceID       string      `json:"resourceId,omitempty"`
	Tags             []string    `json:"tags"`
	Data             interface{} `json:"data,omitempty"`
}

Event describes a log event sent for an evaluated compliance/security rule.

type Reporter

type Reporter interface {
	Report(event *Event)
	ReportRaw(content []byte, tags ...string)
}

Reporter defines an interface for reporting rule events

func NewReporter

func NewReporter(logSource *config.LogSource, logChan chan *message.Message) Reporter

NewReporter returns an instance of Reporter

Jump to

Keyboard shortcuts

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