client

package
v0.0.0-...-6e31670 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package client contains sensor client functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	FSClient FleetspeakClient
	// contains filtered or unexported fields
}

Client represents a Emitto sensor client.

func New

func New(ctx context.Context, fleetspeakSocket, org, zone, ruleFile, suricataSocket string, filestore filestore.FileStore) (*Client, error)

New creates a new Emitto sensor client.

func (*Client) MonitorSurcataEVELog

func (c *Client) MonitorSurcataEVELog(d time.Duration, threshold int, logFile string)

MonitorSurcataEVELog reads logs from last `d` duration of time, and sends a notification alert if the threshold is exceeded

func (*Client) ProcessMessage

func (c *Client) ProcessMessage(ctx context.Context, m *fspb.Message) error

ProcessMessage handles a Fleetspeak message from Emitto.

func (*Client) SendHeartbeat

func (c *Client) SendHeartbeat()

SendHeartbeat sends a heartbeat message to the server.

type FleetspeakClient

type FleetspeakClient interface {
	// SendMessage sends a message to Fleetspeak.
	SendMessage(m *pb.SensorMessage) (string, error)
	// Receive initiates receiving messages from Fleetspeak.
	Receive(done <-chan struct{})
	// Messages provides access to the messages received from Fleetspeak.
	Messages() chan *fspb.Message
}

FleetspeakClient represents a Fleetspeak client.

type SuricataController

type SuricataController interface {
	// ReloadRules reloads Suricata rules.
	ReloadRules() error
}

SuricataController represents a Suricata controller.

Jump to

Keyboard shortcuts

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