utils

package
v0.0.0-...-2e82817 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCPU

func CheckCPU(cores int) error

func CheckDistro

func CheckDistro(distro string) error

func CheckErr

func CheckErr(e error)

Check Check if error is not nil or exit with error code

func CheckMem

func CheckMem(size uint64) error

func ConfigureFirewall

func ConfigureFirewall(mode string, c Config) error

func GenerateFromTemplate

func GenerateFromTemplate(data interface{}, t string, cfile string) error

func GenerateSecret

func GenerateSecret() string

func GetIfaceIP

func GetIfaceIP(iface string) (string, error)

func GetMainIP

func GetMainIP() (string, error)

func GetMainIface

func GetMainIface(mode string) (string, error)

func GetMyPath

func GetMyPath() (string, error)

func InitDocker

func InitDocker(mode string, c Config, master bool, tag string, lite bool) error

func InstallDocker

func InstallDocker(mode string) error

func InstallMaster

func InstallMaster(mode, datadir, pass, tag string, lite bool) error

func InstallOpenVPNClient

func InstallOpenVPNClient(mode, host string) error

func InstallOpenVPNMaster

func InstallOpenVPNMaster(mode string) error

func InstallProbe

func InstallProbe(mode, datadir, pass, host, tag string, lite bool) error

func InstallSuricata

func InstallSuricata(mode string, iface string) error

func MakeDir

func MakeDir(mode os.FileMode, arg ...string) string

func ReadYAML

func ReadYAML(url string, result interface{}) error

func Restart

func Restart(mode string)

func RunCmd

func RunCmd(mode, command string, arg ...string) error

func RunEnvCmd

func RunEnvCmd(mode string, env []string, command string, arg ...string) error

func Uninstall

func Uninstall(mode string) error

func WriteToFile

func WriteToFile(fileName string, body string) error

func WriteYAML

func WriteYAML(url string, data interface{}) error

Types

type Config

type Config struct {
	ServerType       string
	Lite             bool
	ServerName       string
	DBHost           string
	DBPass           string
	LogstashPipeline string
	ESMem            uint64
	LSMem            uint64
	Updates          uint32
	ESData           string
	ESBackups        string
	Cert             string
	Datasources      string
	ScannerIface     string
	ScannerIP        string
	Correlation      string
	Rules            string
	Tag              string
	Kind             string
	Last             int64
}

Jump to

Keyboard shortcuts

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