mod_waf

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

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

View Source
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
)
View Source
const (
	DefaultRulePath = "mod_waf/waf_rule.data" // default product rule path
)
View Source
const (
	ModWaf = "mod_waf" // mod waf
)

Variables

View Source
var (
	ErrWaf = errors.New("WAF") // deny by Waf
)

Functions

func NewWafHandler

func NewWafHandler() *wafHandler

func NewWafJob

func NewWafJob(req *bfe_basic.Request, rule string, jtype string) *wafJob

func NewWafLogger

func NewWafLogger() *wafLogger

func ProductWafRuleConfLoad

func ProductWafRuleConfLoad(fileName string) (productWafRuleConfig, error)

Types

type ConfModWaf

type ConfModWaf struct {
	Basic struct {
		ProductRulePath string // path of waf rule data
	}
	Log access_log.LogConfig
}

func ConfLoad

func ConfLoad(filePath string, confRoot string) (*ConfModWaf, error)

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 (*ModuleWaf) Name

func (m *ModuleWaf) Name() string

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL