waf

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Acl

type Acl struct {
	ARN string
	Id  string
}

type Decisions

type Decisions struct {
	V4Add        map[string][]*string
	V6Add        map[string][]*string
	V4Del        map[string][]*string
	V6Del        map[string][]*string
	CountriesAdd map[string][]*string
	CountriesDel map[string][]*string
}

type IPSetManager

type IPSetManager struct {
	IPSets []*WAFIpSet
	// contains filtered or unexported fields
}

func NewIPSetManager

func NewIPSetManager(setPrefix string, scope string, client *wafv2.WAFV2, logger *log.Entry) *IPSetManager

func (*IPSetManager) AddIp

func (im *IPSetManager) AddIp(ip string, decisionType string)

func (*IPSetManager) Commit

func (im *IPSetManager) Commit() error

func (*IPSetManager) DeleteEmptySets

func (im *IPSetManager) DeleteEmptySets()

func (*IPSetManager) DeleteIp

func (im *IPSetManager) DeleteIp(ip string, decisionType string)

func (*IPSetManager) DeleteSets

func (im *IPSetManager) DeleteSets()

func (*IPSetManager) FindAvailableSet

func (im *IPSetManager) FindAvailableSet(ipType string, decisionType string) (*WAFIpSet, error)

type IpSet

type IpSet struct {
	ARN string
	Id  string
}

type RuleGroup

type RuleGroup struct {
	ARN string
	Id  string
}

type WAF

type WAF struct {
	Logger        *log.Entry
	DecisionsChan chan Decisions
	T             *tomb.Tomb
	// contains filtered or unexported fields
}

func NewWaf

func NewWaf(config cfg.AclConfig) (*WAF, error)

func (*WAF) AddRuleGroupToACL

func (w *WAF) AddRuleGroupToACL(acl *wafv2.WebACL, token *string) error

func (*WAF) Cleanup

func (w *WAF) Cleanup() error

func (*WAF) CleanupAcl

func (w *WAF) CleanupAcl(acl *wafv2.WebACL, token *string) error

func (*WAF) CreateRuleGroup

func (w *WAF) CreateRuleGroup(ruleGroupName string) error

func (*WAF) DeleteRuleGroup

func (w *WAF) DeleteRuleGroup(ruleGroupName string, token string, id string) error

func (*WAF) Dump

func (w *WAF) Dump()

func (*WAF) GetRuleGroup

func (w *WAF) GetRuleGroup(ruleGroupname string) (string, wafv2.RuleGroup, error)

func (*WAF) GetWebACL

func (w *WAF) GetWebACL(aclName string, id string) (*wafv2.WebACL, *string, error)

func (*WAF) Init

func (w *WAF) Init() error

func (*WAF) ListIpSet

func (w *WAF) ListIpSet() (map[string]IpSet, error)

func (*WAF) ListResources

func (w *WAF) ListResources() (map[string]Acl, map[string]IpSet, map[string]RuleGroup, error)

func (*WAF) ListRuleGroups

func (w *WAF) ListRuleGroups() (map[string]RuleGroup, error)

func (*WAF) ListWebACL

func (w *WAF) ListWebACL() (map[string]Acl, error)

func (*WAF) Process

func (w *WAF) Process() error

func (*WAF) RemoveRuleGroupFromACL

func (w *WAF) RemoveRuleGroupFromACL(acl *wafv2.WebACL, token *string) error

func (*WAF) UpdateGeoSet

func (w *WAF) UpdateGeoSet(d Decisions) error

func (*WAF) UpdateRuleGroup

func (w *WAF) UpdateRuleGroup() error

func (*WAF) UpdateSetsContent

func (w *WAF) UpdateSetsContent(d Decisions) error

type WAFIpSet

type WAFIpSet struct {
	// contains filtered or unexported fields
}

func NewIpSet

func NewIpSet(setPrefix string, ipType string, decisionType string, scope string, client *wafv2.WAFV2) *WAFIpSet

func (*WAFIpSet) Add

func (w *WAFIpSet) Add(ip string)

func (*WAFIpSet) Commit

func (w *WAFIpSet) Commit() error

func (*WAFIpSet) Contains

func (w *WAFIpSet) Contains(ip string) bool

func (*WAFIpSet) ContainsAll

func (w *WAFIpSet) ContainsAll(ips []string) bool

func (*WAFIpSet) DeleteIpSet

func (w *WAFIpSet) DeleteIpSet() error

func (*WAFIpSet) GetDecisionType

func (w *WAFIpSet) GetDecisionType() string

func (*WAFIpSet) GetIPs

func (w *WAFIpSet) GetIPs() []string

func (*WAFIpSet) GetName

func (w *WAFIpSet) GetName() string

func (*WAFIpSet) GetType

func (w *WAFIpSet) GetType() string

func (*WAFIpSet) IsStale

func (w *WAFIpSet) IsStale() bool

func (*WAFIpSet) Remove

func (w *WAFIpSet) Remove(ip string)

func (*WAFIpSet) RemoveAll

func (w *WAFIpSet) RemoveAll()

func (*WAFIpSet) Size

func (w *WAFIpSet) Size() int

func (*WAFIpSet) ToStatement

func (w *WAFIpSet) ToStatement(ipHeader string, ipHeaderPosition string) *wafv2.IPSetReferenceStatement

Jump to

Keyboard shortcuts

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