EventSource defines the contract all event sources have to satisfy. ETW, kernel driver, or userspace instrumentation are all examples of event sources. The main responsibility of the event source is to capture the events emitted by the operating system, parse, enrich, and build the state that repres
| 30 | // the events emitted by the operating system, parse, enrich, and build |
| 31 | // the state that represents the foundation for the detection engine. |
| 32 | type EventSource interface { |
| 33 | // Open starts the instrumentation machinery. It receives the global |
| 34 | // configuration that the event source can utilize to influence how |
| 35 | // the events are captured. Before opening the event source, it is |
| 36 | // important to register any event listener that acts on behalf of the |
| 37 | // received event. Likewise, if any filter must be set to drop unwanted |
| 38 | // signals, it needs to be set before the event source is opened. |
| 39 | Open(config *config.Config) error |
| 40 | // Close performs event source shutdown. Once event source is closed, |
| 41 | // any buffered or pending events are no longer dispatched to event |
| 42 | // listeners. |
| 43 | Close() error |
| 44 | // Errors returns the channel that receives errors that are side effect |
| 45 | // of event capture, parsing, or enrichment phase. |
| 46 | Errors() <-chan error |
| 47 | // Events return the channel where event source pushes all captured events. |
| 48 | // At this point, the event has the full state associated with it. For example, |
| 49 | // the full process state or the event call stack. |
| 50 | Events() <-chan *event.Event |
| 51 | // SetFilter attaches the filter to the event source. Only events that match |
| 52 | // the filter are forwarded to the event source output channel. |
| 53 | SetFilter(f filter.Filter) |
| 54 | // RegisterEventListener installs event listener. Event listener represents any |
| 55 | // component that satisfies the event.Listener interface. Event listener can |
| 56 | // decide if the event is pushed to the output queue. |
| 57 | RegisterEventListener(lis event.Listener) |
| 58 | } |
no outgoing calls
no test coverage detected