confighandler

package
v0.0.0-...-9ce7603 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2018 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Structure of the config
	QueueLog      string `yaml:"QUEUE_LOG"`
	QueueIncident string `yaml:"QUEUE_INCIDENT"`
	RabbitHost    string `yaml:"RABBITMQ_HOST"`
	RabbitPort    string `yaml:"RABBITMQ_PORT"`
	RabbitUser    string `yaml:"RABBITMQ_USER"`
	RabbitPass    string `yaml:"RABBITMQ_PASS"`
	SyslogFile    string `yaml:"LOGFILE"`
	RulesFile     string `yaml:"RULESFILE"`
	SyslogIP      string `yaml:"SYSLOG_LISTENIP"`
	SyslogPort    string `yaml:"SYSLOG_LISTENPORT"`
}

Config is a struc of configs :D Use for unmarshall the config file for basic parameters of the app

func GetConfig

func GetConfig(path string) (Config, error)

GetConfig readds locally defined yaml config file Unmarshall the file and return a Config struct to the caller

type Rule

type Rule struct {
	RuleName     string   `yaml:"RuleName"`
	AlertType    string   `yaml:"AlertType"`
	DeviceType   string   `yaml:"DeviceType"`
	Regex        string   `yaml:"Regex"`
	PreAudits    []string `yaml:"PreAudits"`
	Remediations []string `yaml:"Remediations"`
	PostAudits   []string `yaml:"PostAudits"`
}

Rule represents a how a syslog matching rule should look like

func GetRules

func GetRules(path string) ([]Rule, error)

GetRules reads the yaml file containing the rules and unmarshal the info into a Rule

Jump to

Keyboard shortcuts

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