Documentation ¶
Overview ¶
Copyright (c) 2020 The BFE Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 The BFE Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 The BFE Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 The BFE Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 The BFE Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 The BFE Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2020 The BFE Authors.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func NewWafHandler() *wafHandler
- func NewWafJob(req *bfe_basic.Request, rule string, jtype string) *wafJob
- func NewWafLogger() *wafLogger
- func ProductWafRuleConfLoad(fileName string) (productWafRuleConfig, error)
- type ConfModWaf
- type ModuleWaf
- type ModuleWafState
- type WarRuleTable
Constants ¶
const ( CheckType = "Check" // check job is async job, which just check and log, but never block BlockType = "Block" // block job is sync job, which check, log and maybe block )
const (
DefaultRulePath = "mod_waf/waf_rule.data" // default product rule path
)
const (
ModWaf = "mod_waf" // mod waf
)
Variables ¶
var (
ErrWaf = errors.New("WAF") // deny by Waf
)
Functions ¶
func NewWafHandler ¶
func NewWafHandler() *wafHandler
func NewWafLogger ¶
func NewWafLogger() *wafLogger
func ProductWafRuleConfLoad ¶
Types ¶
type ConfModWaf ¶
type ConfModWaf struct { Basic struct { ProductRulePath string // path of waf rule data } Log access_log.LogConfig }
func (*ConfModWaf) Check ¶
func (cfg *ConfModWaf) Check(confRoot string) error
type ModuleWaf ¶
type ModuleWaf struct {
// contains filtered or unexported fields
}
func NewModuleWaf ¶
func NewModuleWaf() *ModuleWaf
func (*ModuleWaf) Init ¶
func (m *ModuleWaf) Init(cbs *bfe_module.BfeCallbacks, whs *web_monitor.WebHandlers, cr string) error
type ModuleWafState ¶
type ModuleWafState struct { CheckedReq *metrics.Counter // record how many requests check waf rule HitBlockedReq *metrics.Counter // record how many requests check waf rule HitCheckedRule *metrics.Counter // hit checked rule BlockedRuleError *metrics.Counter //err times of check blocked rule CheckedRuleError *metrics.Counter // err times of check checked rule }
type WarRuleTable ¶
type WarRuleTable struct {
// contains filtered or unexported fields
}
func NewWarRuleTable ¶
func NewWarRuleTable() *WarRuleTable
func (*WarRuleTable) Search ¶
func (t *WarRuleTable) Search(product string) (*ruleList, bool)
func (*WarRuleTable) Update ¶
func (t *WarRuleTable) Update(ruleConf *productWafRuleConfig)