Documentation ¶
Index ¶
Constants ¶
View Source
const ( IpsetMode = "ipset" IptablesMode = "iptables" NftablesMode = "nftables" PfMode = "pf" )
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"` UpdateFrequency string `yaml:"update_frequency"` Daemon bool `yaml:"daemonize"` Logging LoggingConfig `yaml:",inline"` DisableIPV6 bool `yaml:"disable_ipv6"` 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"` // specific to iptables, following https://github.com/asians-cloud/cs-blackrules-bouncer/issues/19 IptablesChains []string `yaml:"iptables_chains"` SupportedDecisionsTypes []string `yaml:"supported_decisions_types"` // specific to nftables, following https://github.com/asians-cloud/cs-blackrules-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 { LogMode string `yaml:"log_mode"` LogDir string `yaml:"log_dir"` LogLevel *log.Level `yaml:"log_level"` CompressLogs *bool `yaml:"compress_logs,omitempty"` LogMaxSize int `yaml:"log_max_size,omitempty"` LogMaxFiles int `yaml:"log_max_files,omitempty"` LogMaxAge int `yaml:"log_max_age,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.