Versions in this module Expand all Collapse all v1 v1.2.0 Sep 10, 2021 Changes in this version type Waf + ComponentNames []string + ContentInjection bool v1.1.0 Sep 6, 2021 v1.0.0 Sep 1, 2021 Changes in this version + const ACTION_TYPE_DATA + const ACTION_TYPE_DISRUPTIVE + const ACTION_TYPE_FLOW + const ACTION_TYPE_METADATA + const ACTION_TYPE_NONDISRUPTIVE + const AUDIT_LOG_DISABLED + const AUDIT_LOG_ENABLED + const AUDIT_LOG_RELEVANT + const CONN_ENGINE_DETECTONLY + const CONN_ENGINE_OFF + const CONN_ENGINE_ON + const REQUEST_BODY_LIMIT_ACTION_PROCESS_PARTIAL + const REQUEST_BODY_LIMIT_ACTION_REJECT + const REQUEST_BODY_PROCESSOR_DEFAULT + const REQUEST_BODY_PROCESSOR_JSON + const REQUEST_BODY_PROCESSOR_MULTIPART + const REQUEST_BODY_PROCESSOR_URLENCODED + const REQUEST_BODY_PROCESSOR_XML + const RULE_ENGINE_DETECTONLY + const RULE_ENGINE_OFF + const RULE_ENGINE_ON + const VARIABLES_COUNT + const VARIABLE_ARGS + const VARIABLE_ARGS_COMBINED_SIZE + const VARIABLE_ARGS_GET + const VARIABLE_ARGS_GET_NAMES + const VARIABLE_ARGS_NAMES + const VARIABLE_ARGS_POST + const VARIABLE_ARGS_POST_NAMES + const VARIABLE_AUTH_TYPE + const VARIABLE_DURATION + const VARIABLE_FILES + const VARIABLE_FILES_COMBINED_SIZE + const VARIABLE_FILES_NAMES + const VARIABLE_FILES_SIZES + const VARIABLE_FILES_TMPNAMES + const VARIABLE_FILES_TMP_CONTENT + const VARIABLE_FULL_REQUEST + const VARIABLE_FULL_REQUEST_LENGTH + const VARIABLE_GEO + const VARIABLE_GLOBAL + const VARIABLE_INBOUND_DATA_ERROR + const VARIABLE_INBOUND_ERROR_DATA + const VARIABLE_IP + const VARIABLE_JSON + const VARIABLE_MATCHED_VAR + const VARIABLE_MATCHED_VARS + const VARIABLE_MATCHED_VARS_NAMES + const VARIABLE_MATCHED_VAR_NAME + const VARIABLE_MULTIPART_BOUNDARY_QUOTED + const VARIABLE_MULTIPART_BOUNDARY_WHITESPACE + const VARIABLE_MULTIPART_CRLF_LF_LINES + const VARIABLE_MULTIPART_DATA_AFTER + const VARIABLE_MULTIPART_DATA_BEFORE + const VARIABLE_MULTIPART_FILENAME + const VARIABLE_MULTIPART_FILE_LIMIT_EXCEEDED + const VARIABLE_MULTIPART_HEADER_FOLDING + const VARIABLE_MULTIPART_INVALID_HEADER_FOLDING + const VARIABLE_MULTIPART_INVALID_PART + const VARIABLE_MULTIPART_INVALID_QUOTING + const VARIABLE_MULTIPART_LF_LINE + const VARIABLE_MULTIPART_MISSING_SEMICOLON + const VARIABLE_MULTIPART_NAME + const VARIABLE_MULTIPART_STRICT_ERROR + const VARIABLE_MULTIPART_UNMATCHED_BOUNDARY + const VARIABLE_OUTBOUND_DATA_ERROR + const VARIABLE_PATH_INFO + const VARIABLE_QUERY_STRING + const VARIABLE_REMOTE_ADDR + const VARIABLE_REMOTE_HOST + const VARIABLE_REMOTE_PORT + const VARIABLE_REQBODY_ERROR + const VARIABLE_REQBODY_ERROR_MSG + const VARIABLE_REQBODY_PROCESSOR + const VARIABLE_REQBODY_PROCESSOR_ERROR + const VARIABLE_REQBODY_PROCESSOR_ERROR_MSG + const VARIABLE_REQUEST_BASENAME + const VARIABLE_REQUEST_BODY + const VARIABLE_REQUEST_BODY_LENGTH + const VARIABLE_REQUEST_COOKIES + const VARIABLE_REQUEST_COOKIES_NAMES + const VARIABLE_REQUEST_FILENAME + const VARIABLE_REQUEST_HEADERS + const VARIABLE_REQUEST_HEADERS_NAMES + const VARIABLE_REQUEST_LINE + const VARIABLE_REQUEST_METHOD + const VARIABLE_REQUEST_PROTOCOL + const VARIABLE_REQUEST_URI + const VARIABLE_REQUEST_URI_RAW + const VARIABLE_RESOURCE + const VARIABLE_RESPONSE_BODY + const VARIABLE_RESPONSE_CONTENT_LENGTH + const VARIABLE_RESPONSE_CONTENT_TYPE + const VARIABLE_RESPONSE_HEADERS + const VARIABLE_RESPONSE_HEADERS_NAMES + const VARIABLE_RESPONSE_PROTOCOL + const VARIABLE_RESPONSE_STATUS + const VARIABLE_RULE + const VARIABLE_SERVER_ADDR + const VARIABLE_SERVER_NAME + const VARIABLE_SERVER_PORT + const VARIABLE_SESSION + const VARIABLE_SESSIONID + const VARIABLE_TX + const VARIABLE_UNIQUE_ID + const VARIABLE_URI_PARSE_ERROR + const VARIABLE_URLENCODED_ERROR + const VARIABLE_USER + const VARIABLE_USERID + const VARIABLE_XML + func NameToVariable(name string) (byte, error) + func VariableToName(v byte) string + type BodyBuffer struct + func NewBodyReader(tmpDir string, memLimit int64) *BodyBuffer + func (br *BodyBuffer) Close() + func (br *BodyBuffer) Reader() io.Reader + func (br *BodyBuffer) Size() int64 + func (br *BodyBuffer) Write(data []byte) (n int, err error) + type Collection struct + PersistenceKey string + func NewCollection(name string) *Collection + func (c *Collection) Add(key string, value string) + func (c *Collection) AddUnique(key string, value string) + func (c *Collection) Data() map[string][]string + func (c *Collection) Find(key string, re *regex.Regexp, exceptions []string) []MatchData + func (c *Collection) Get(key string) []string + func (c *Collection) GetFirstInt(key string) int + func (c *Collection) GetFirstInt64(key string) int64 + func (c *Collection) GetFirstString(key string) string + func (c *Collection) Name() string + func (c *Collection) Remove(key string) + func (c *Collection) Reset() + func (c *Collection) Set(key string, value []string) + func (c *Collection) SetData(data map[string][]string) + type Interruption struct + Action string + Data string + RuleId int + Status int + type MatchData struct + Collection string + Key string + Value string + type MatchedRule struct + MatchedData []MatchData + Messages []string + Rule Rule + type Operator interface + Evaluate func(*Transaction, string) bool + Init func(string) error + type Phase int + const PHASE_LOGGING + const PHASE_REQUEST_BODY + const PHASE_REQUEST_HEADERS + const PHASE_RESPONSE_BODY + const PHASE_RESPONSE_HEADERS + type Rule struct + Accuracy int + Actions []RuleAction + AlwaysMatch bool + Chain *Rule + File string + HasChain bool + Id int + Line int + Log bool + LogData string + Maturity int + Msg string + MultiMatch bool + Operator *RuleOperator + ParentId int + Phase Phase + Raw string + Rev string + SecMark string + Severity int + Tags []string + Transformations []transformations.Transformation + Variables []RuleVariable + Version string + func NewRule() *Rule + func (r *Rule) Evaluate(tx *Transaction) []MatchData + type RuleAction interface + Evaluate func(*Rule, *Transaction) + Init func(*Rule, string) error + Type func() int + type RuleGroup struct + func NewRuleGroup() *RuleGroup + func (rg *RuleGroup) Add(rule *Rule) error + func (rg *RuleGroup) Clear() + func (rg *RuleGroup) Count() int + func (rg *RuleGroup) DeleteById(id int) + func (rg *RuleGroup) Eval(phase Phase, tx *Transaction) bool + func (rg *RuleGroup) FindById(id int) *Rule + func (rg *RuleGroup) FindByMsg(msg string) []*Rule + func (rg *RuleGroup) FindByTag(tag string) []*Rule + func (rg *RuleGroup) GetRules() []*Rule + type RuleOperator struct + Data string + Negation bool + Operator Operator + type RuleVariable struct + Collection byte + Count bool + Exceptions []string + Key string + Regex *regex.Regexp + type Transaction struct + AuditEngine int + AuditLogParts []rune + Capture bool + ForceRequestBodyVariable bool + HashEnforcement bool + HashEngine bool + Id string + Interruption *Interruption + LastPhase Phase + Log bool + Logdata string + MatchedRules []MatchedRule + RequestBodyAccess bool + RequestBodyBuffer *BodyBuffer + RequestBodyLimit int64 + RequestBodyProcessor int + ResponseBodyAccess bool + ResponseBodyBuffer *BodyBuffer + ResponseBodyLimit int64 + RuleEngine int + RuleRemoveById []int + RuleRemoveTargetById map[int][]VariableKey + Skip int + SkipAfter string + Status int + StopWatches map[Phase]int + Timestamp int64 + Waf *Waf + func (tx *Transaction) AddArgument(orig string, key string, value string) + func (tx *Transaction) AddRequestHeader(key string, value string) + func (tx *Transaction) AddResponseHeader(key string, value string) + func (tx *Transaction) AuditLog() *loggers.AuditLog + func (tx *Transaction) CaptureField(index int, value string) + func (tx *Transaction) ExtractArguments(orig string, uri string) + func (tx *Transaction) GetCollection(variable byte) *Collection + func (tx *Transaction) GetCollections() map[string]*Collection + func (tx *Transaction) GetField(rv RuleVariable, exceptions []string) []MatchData + func (tx *Transaction) GetStopWatch() string + func (tx *Transaction) Interrupted() bool + func (tx *Transaction) IsProcessableResponseBody() bool + func (tx *Transaction) MacroExpansion(data string) string + func (tx *Transaction) MatchRule(rule Rule, msgs []string, match []MatchData) + func (tx *Transaction) MatchVars(match []MatchData) + func (tx *Transaction) ParseRequestReader(data io.Reader) (*Interruption, error) + func (tx *Transaction) ProcessConnection(client string, cPort int, server string, sPort int) + func (tx *Transaction) ProcessLogging() + func (tx *Transaction) ProcessRequest(req *http.Request) (*Interruption, error) + func (tx *Transaction) ProcessRequestBody() (*Interruption, error) + func (tx *Transaction) ProcessRequestHeaders() *Interruption + func (tx *Transaction) ProcessResponseBody() (*Interruption, error) + func (tx *Transaction) ProcessResponseHeaders(code int, proto string) *Interruption + func (tx *Transaction) ProcessUri(uri string, method string, httpVersion string) + func (tx *Transaction) RemoveRuleTargetById(id int, col byte, key string) + func (tx *Transaction) ResetCapture() + func (tx *Transaction) SetFullRequest() + type VariableKey struct + Collection byte + Key string + type Waf struct + AbortOnRemoteRulesFail bool + ArgumentSeparator string + AuditEngine int + AuditLogParts []rune + AuditLogRelevantStatus regex.Regexp + CollectionTimeout int + ComponentSignature string + DataDir string + GeoDb geoip.GeoDb + Logger *zap.Logger + LoggerAtomicLevel zap.AtomicLevel + Persistence persistence.Persistence + RejectOnRequestBodyLimit bool + RejectOnResponseBodyLimit bool + RequestBodyAccess bool + RequestBodyInMemoryLimit int64 + RequestBodyLimit int64 + RequestBodyLimitAction int + RequestBodyNoFilesLimit int64 + ResponseBodyAccess bool + ResponseBodyLimit int64 + ResponseBodyMimeTypes []string + RuleEngine int + Rules *RuleGroup + SensorId string + ServerSignature string + TmpDir string + Unicode *utils.Unicode + UploadDir string + UploadFileLimit int + UploadFileMode fs.FileMode + UploadKeepFiles bool + WebAppId string + func NewWaf() *Waf + func (w *Waf) AddAuditLogger(engine string, args map[string]string) error + func (w *Waf) AuditLoggers() []loggers.Logger + func (w *Waf) NewTransaction() *Transaction + func (w *Waf) SetLogLevel(lvl int) error v1.0.0-beta.7 Aug 27, 2021 v1.0.0-beta.6 Aug 25, 2021 v1.0.0-beta.5 Aug 23, 2021 v1.0.0-beta.4 Aug 21, 2021 v1.0.0-beta.3 Aug 18, 2021 v1.0.0-beta.2 Aug 9, 2021 v1.0.0-beta.1 Jul 29, 2021 Other modules containing this package github.com/jptosso/coraza-waf/v2