Documentation ¶
Index ¶
- Constants
- Variables
- func ConfModPrisonCheck(cfg *ConfModPrison, confRoot string) error
- func PrisonRuleCheck(conf *PrisonRuleConf) error
- func PrisonRuleListCheck(conf *PrisonRuleConfList) error
- func ProductRulesCheck(conf map[string]*PrisonRuleConfList) error
- type AccessCounter
- type AccessSign
- type AccessSignConf
- type AccessSigner
- type ConfModPrison
- type ModulePrison
- type ModulePrisonState
- type PrisonInfo
- type PrisonRuleConf
- type PrisonRuleConfList
- type ProductRuleConf
Constants ¶
View Source
const ( ModPrison = "mod_prison" ReqCtxPrisonInfo = "mod_prison.prison_info" )
Variables ¶
View Source
var (
ErrPrison = errors.New("PRISON") // deny by mod_prison
)
Functions ¶
func ConfModPrisonCheck ¶
func ConfModPrisonCheck(cfg *ConfModPrison, confRoot string) error
ConfModPrisonCheck check conf of mod_prison
func PrisonRuleCheck ¶
func PrisonRuleCheck(conf *PrisonRuleConf) error
PrisonRuleCheck check prisonRule
func PrisonRuleListCheck ¶
func PrisonRuleListCheck(conf *PrisonRuleConfList) error
PrisonRuleListCheck check prisonRuleList
func ProductRulesCheck ¶
func ProductRulesCheck(conf map[string]*PrisonRuleConfList) error
ProductRulesCheck check ProductRules
Types ¶
type AccessCounter ¶
type AccessCounter struct {
// contains filtered or unexported fields
}
func NewAccessCounter ¶
func NewAccessCounter() *AccessCounter
func (*AccessCounter) IncAndCheck ¶
func (c *AccessCounter) IncAndCheck(checkPeriodNs int64, threshold int32) (bool, int64)
type AccessSign ¶
type AccessSign [16]byte
type AccessSignConf ¶
type AccessSignConf struct { UseSocketIP bool // if true, add socketip to input of signature UseClientIP bool // if true, add clientip to input of signature UseConnectID bool // if true, add connect id to input of signature UseUrl bool // if true, add url to input of signature UseHost bool // if true, add host to input of signature UsePath bool // if true, add path to input of signature UseHeaders bool // if true, use all request headers UrlRegexp string // url regmatch str Query []string // query key list Header []string // header key list Cookie []string // cookie key list }
type AccessSigner ¶
type AccessSigner struct { AccessSignConf // basic conf for signature UrlReg *regexp.Regexp // url regular expression }
func (*AccessSigner) Sign ¶
func (s *AccessSigner) Sign(label string, req *bfe_basic.Request) (AccessSign, error)
type ConfModPrison ¶
type ModulePrison ¶
type ModulePrison struct {
// contains filtered or unexported fields
}
func NewModulePrison ¶
func NewModulePrison() *ModulePrison
func (*ModulePrison) Init ¶
func (m *ModulePrison) Init(cbs *bfe_module.BfeCallbacks, whs *web_monitor.WebHandlers, cr string) error
func (*ModulePrison) Name ¶
func (m *ModulePrison) Name() string
type ModulePrisonState ¶
type PrisonInfo ¶
type PrisonRuleConf ¶
type PrisonRuleConf struct { Cond *string // condition for prison rule Action *action.Action // action for prison rule AccessSignConf *AccessSignConf // sign conf for prison rule Name *string // rule name CheckPeriod *int64 // check period in seconds StayPeriod *int64 // stayPeriod in seconds Threshold *int32 // threshold AccessDictSize *int // size of access dict PrisonDictSize *int // size of prison dict }
type PrisonRuleConfList ¶
type PrisonRuleConfList []*PrisonRuleConf
type ProductRuleConf ¶
type ProductRuleConf struct { Version *string // version of the config Config *map[string]*PrisonRuleConfList // product name => list of prison rules }
Click to show internal directories.
Click to hide internal directories.