Documentation ¶
Index ¶
- type APICfg
- type ApiCredentialsCfg
- type CommonCfg
- type ConfigurationPaths
- type CrowdsecServiceCfg
- type CscliCfg
- type DatabaseCfg
- type FlushDBCfg
- type GlobalConfig
- type LocalApiClientCfg
- type LocalApiServerCfg
- type OnlineApiClientCfg
- type ProfileCfg
- type PrometheusCfg
- type SimulationConfig
- type TLSCfg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APICfg ¶ added in v1.0.0
type APICfg struct { Client *LocalApiClientCfg `yaml:"client"` Server *LocalApiServerCfg `yaml:"server"` }
type ApiCredentialsCfg ¶ added in v1.0.0
type CommonCfg ¶ added in v1.0.0
type CommonCfg struct { Daemonize bool PidDir string `yaml:"pid_dir"` LogMedia string `yaml:"log_media"` LogDir string `yaml:"log_dir,omitempty"` //if LogMedia = file LogLevel *log.Level `yaml:"log_level"` WorkingDir string `yaml:"working_dir,omitempty"` ///var/run }
daemonization/service related stuff
type ConfigurationPaths ¶ added in v1.0.0
type CrowdsecServiceCfg ¶ added in v1.0.0
type CrowdsecServiceCfg struct { AcquisitionFilePath string `yaml:"acquisition_path,omitempty"` ParserRoutinesCount int `yaml:"parser_routines"` BucketsRoutinesCount int `yaml:"buckets_routines"` OutputRoutinesCount int `yaml:"output_routines"` SimulationConfig *SimulationConfig `yaml:"-"` LintOnly bool `yaml:"-"` //if set to true, exit after loading configs BucketStateFile string `yaml:"state_input_file,omitempty"` //if we need to unserialize buckets at start BucketStateDumpDir string `yaml:"state_output_dir,omitempty"` //if we need to unserialize buckets on shutdown BucketsGCEnabled bool `yaml:"-"` //we need to garbage collect buckets when in forensic mode HubDir string `yaml:"-"` DataDir string `yaml:"-"` ConfigDir string `yaml:"-"` HubIndexFile string `yaml:"-"` SimulationFilePath string `yaml:"-"` }
Configurations needed for crowdsec to load parser/scenarios/... + acquisition
type CscliCfg ¶ added in v1.0.0
type CscliCfg struct { Output string `yaml:"output,omitempty"` HubBranch string `yaml:"hub_branch"` SimulationConfig *SimulationConfig `yaml:"-"` DbConfig *DatabaseCfg `yaml:"-"` HubDir string `yaml:"-"` DataDir string `yaml:"-"` ConfigDir string `yaml:"-"` HubIndexFile string `yaml:"-"` SimulationFilePath string `yaml:"-"` }
cscli specific config, such as hub directory
type DatabaseCfg ¶ added in v1.0.0
type FlushDBCfg ¶ added in v1.0.0
type GlobalConfig ¶ added in v1.0.0
type GlobalConfig struct { //just a path to ourself :p Self *string `yaml:"-"` Common *CommonCfg `yaml:"common,omitempty"` Prometheus *PrometheusCfg `yaml:"prometheus,omitempty"` Crowdsec *CrowdsecServiceCfg `yaml:"crowdsec_service,omitempty"` Cscli *CscliCfg `yaml:"cscli,omitempty"` DbConfig *DatabaseCfg `yaml:"db_config,omitempty"` API *APICfg `yaml:"api,omitempty"` ConfigPaths *ConfigurationPaths `yaml:"config_paths,omitempty"` }
top-level config : defaults,overriden by cfg file,overriden by cli
func NewConfig ¶ added in v1.0.0
func NewConfig() *GlobalConfig
func NewDefaultConfig ¶ added in v1.0.0
func NewDefaultConfig() *GlobalConfig
func (*GlobalConfig) CleanupPaths ¶ added in v1.0.0
func (c *GlobalConfig) CleanupPaths() error
func (*GlobalConfig) Dump ¶ added in v1.0.0
func (c *GlobalConfig) Dump() error
func (*GlobalConfig) LoadConfiguration ¶ added in v1.0.0
func (c *GlobalConfig) LoadConfiguration() error
func (*GlobalConfig) LoadConfigurationFile ¶ added in v1.0.0
func (c *GlobalConfig) LoadConfigurationFile(path string) error
func (*GlobalConfig) LoadSimulation ¶ added in v1.0.0
func (c *GlobalConfig) LoadSimulation() error
type LocalApiClientCfg ¶ added in v1.0.0
type LocalApiClientCfg struct { CredentialsFilePath string `yaml:"credentials_path,omitempty"` //credz will be edited by software, store in diff file Credentials *ApiCredentialsCfg `yaml:"-"` InsecureSkipVerify *bool `yaml:"insecure_skip_verify"` // check if api certificate is bad or not }
local api config (for crowdsec/cscli->lapi)
type LocalApiServerCfg ¶ added in v1.0.0
type LocalApiServerCfg struct { ListenURI string `yaml:"listen_uri,omitempty"` //127.0.0.1:8080 TLS *TLSCfg `yaml:"tls"` DbConfig *DatabaseCfg `yaml:"-"` LogDir string `yaml:"-"` OnlineClient *OnlineApiClientCfg `yaml:"online_client"` ProfilesPath string `yaml:"profiles_path,omitempty"` Profiles []*ProfileCfg `yaml:"-"` LogLevel *log.Level `yaml:"log_level"` }
local api service configuration
func (*LocalApiServerCfg) LoadProfiles ¶ added in v1.0.0
func (c *LocalApiServerCfg) LoadProfiles() error
type OnlineApiClientCfg ¶ added in v1.0.0
type OnlineApiClientCfg struct { CredentialsFilePath string `yaml:"credentials_path,omitempty"` //credz will be edited by software, store in diff file Credentials *ApiCredentialsCfg `yaml:"-"` }
global api config (for lapi->oapi)
type ProfileCfg ¶ added in v1.0.0
type ProfileCfg struct { Name string `yaml:"name,omitempty"` Debug *bool `yaml:"debug,omitempty"` Filters []string `yaml:"filters,omitempty"` //A list of OR'ed expressions. the models.Alert object RuntimeFilters []*vm.Program `json:"-"` DebugFilters []*exprhelpers.ExprDebugger `json:"-"` Decisions []models.Decision `yaml:"decisions,omitempty"` OnSuccess string `yaml:"on_success,omitempty"` //continue or break OnFailure string `yaml:"on_failure,omitempty"` //continue or break }
Profile structure(s) are used by the local API to "decide" what kind of decision should be applied when a scenario with an active remediation has been triggered
type PrometheusCfg ¶ added in v1.0.0
type SimulationConfig ¶ added in v0.3.0
type SimulationConfig struct { Simulation *bool `yaml:"simulation"` Exclusions []string `yaml:"exclusions,omitempty"` }
func (*SimulationConfig) IsSimulated ¶ added in v1.0.0
func (s *SimulationConfig) IsSimulated(scenario string) bool
Click to show internal directories.
Click to hide internal directories.