Documentation
¶
Index ¶
Constants ¶
View Source
const ( IpsetMode = "ipset" IptablesMode = "iptables" NftablesMode = "nftables" PfMode = "pf" DryRunMode = "dry-run" )
Variables ¶
This section is empty.
Functions ¶
func MergedConfig ¶
MergedConfig() returns the byte content of the patched configuration file (with .yaml.local).
Types ¶
type BouncerConfig ¶
type BouncerConfig struct {
Mode string `yaml:"mode"` // ipset,iptables,tc
PidDir string `yaml:"pid_dir"` // unused
UpdateFrequency string `yaml:"update_frequency"`
Daemon *bool `yaml:"daemonize"` // unused
Logging LoggingConfig `yaml:",inline"`
DisableIPV6 bool `yaml:"disable_ipv6"`
DisableIPV4 bool `yaml:"disable_ipv4"`
DenyAction string `yaml:"deny_action"`
DenyLog bool `yaml:"deny_log"`
DenyLogPrefix string `yaml:"deny_log_prefix"`
BlacklistsIpv4 string `yaml:"blacklists_ipv4"`
BlacklistsIpv6 string `yaml:"blacklists_ipv6"`
SetType string `yaml:"ipset_type"`
SetSize int `yaml:"ipset_size"`
SetDisableTimeouts bool `yaml:"ipset_disable_timeouts"`
// specific to iptables, following https://github.com/crowdsecurity/cs-firewall-bouncer/issues/19
IptablesChains []string `yaml:"iptables_chains"`
IptablesV4Chains []string `yaml:"iptables_v4_chains"`
IptablesV6Chains []string `yaml:"iptables_v6_chains"`
IptablesAddRuleComments bool `yaml:"iptables_add_rule_comments"`
SupportedDecisionsTypes []string `yaml:"supported_decisions_types"`
// specific to nftables, following https://github.com/crowdsecurity/cs-firewall-bouncer/issues/74
Nftables struct {
Ipv4 nftablesFamilyConfig `yaml:"ipv4"`
Ipv6 nftablesFamilyConfig `yaml:"ipv6"`
} `yaml:"nftables"`
NftablesHooks []string `yaml:"nftables_hooks"`
PF struct {
AnchorName string `yaml:"anchor_name"`
BatchSize int `yaml:"batch_size"`
} `yaml:"pf"`
PrometheusConfig PrometheusConfig `yaml:"prometheus"`
}
type LoggingConfig ¶
type LoggingConfig struct {
LogLevel *log.Level `yaml:"log_level"`
LogMode string `yaml:"log_mode"`
LogDir string `yaml:"log_dir"`
LogMaxSize int `yaml:"log_max_size,omitempty"`
LogMaxFiles int `yaml:"log_max_files,omitempty"`
LogMaxAge int `yaml:"log_max_age,omitempty"`
CompressLogs *bool `yaml:"compress_logs,omitempty"`
}
func (*LoggingConfig) LoggerForFile ¶
func (c *LoggingConfig) LoggerForFile(fileName string) (io.Writer, error)
type PrometheusConfig ¶
Click to show internal directories.
Click to hide internal directories.