Versions in this module Expand all Collapse all v3 v3.0.5 Oct 2, 2023 Changes in this version type WAF + HideValues bool v3.0.4 Aug 10, 2023 Changes in this version + var RulesTimingRecord map[int]time.Duration = make(map[int]time.Duration) + var RulesTimingRecordMutex sync.Mutex + func ClearRuleTimingsRecord() + func GetRuleTimingsRecord() map[int]time.Duration + func UpdatePrintTransformationRules(val bool) bool + func UpdateRecordRuleTimings(val bool) bool + type BodyBuffer struct + func NewBodyBuffer(options types.BodyBufferOptions) *BodyBuffer + func (br *BodyBuffer) Reader() (io.Reader, error) + func (br *BodyBuffer) Reset() error + func (br *BodyBuffer) Size() int64 + func (br *BodyBuffer) Write(data []byte) (n int, err error) + func (br *BodyBuffer) WriteTo(w io.Writer) (int64, error) + type ByteLenger interface + Len func() int + type Rule struct + Audit bool + Capture bool + Chain *Rule + DisruptiveStatus int + HasChain bool + Log bool + LogData macro.Macro + Msg macro.Macro + MultiMatch bool + ParentID_ int + func NewRule() *Rule + func (r *Rule) AddAction(name string, action plugintypes.Action) error + func (r *Rule) AddTransformation(name string, t plugintypes.Transformation) error + func (r *Rule) AddVariable(v variables.RuleVariable, key string, iscount bool) error + func (r *Rule) AddVariableNegation(v variables.RuleVariable, key string) error + func (r *Rule) ClearTransformations() + func (r *Rule) Evaluate(phase types.RulePhase, tx plugintypes.TransactionState, ...) + func (r *Rule) ParentID() int + func (r *Rule) RecordRuleTimings(startTime *time.Time) + func (r *Rule) SetOperator(operator plugintypes.Operator, functionName string, params string) + func (r *Rule) Status() int + type RuleGroup struct + func NewRuleGroup() RuleGroup + func (rg *RuleGroup) Add(rule *Rule) error + func (rg *RuleGroup) Count() int + func (rg *RuleGroup) DeleteByID(id int) + func (rg *RuleGroup) DeleteByMsg(msg string) + func (rg *RuleGroup) DeleteByRange(start, end int) + func (rg *RuleGroup) DeleteByTag(tag string) + func (rg *RuleGroup) Eval(phase types.RulePhase, tx *Transaction) bool + func (rg *RuleGroup) FindByID(id int) *Rule + func (rg *RuleGroup) GetRules() []Rule + type Transaction struct + AllowType corazatypes.AllowType + AuditEngine types.AuditEngineStatus + AuditLogParts types.AuditLogParts + Capture bool + ForceRequestBodyVariable bool + ForceResponseBodyVariable bool + HashEnforcement bool + HashEngine bool + Logdata string + RequestBodyAccess bool + RequestBodyLimit int64 + ResponseBodyAccess bool + ResponseBodyLimit int64 + RuleEngine types.RuleEngineStatus + Skip int + SkipAfter string + Timestamp int64 + WAF *WAF + func (tx *Transaction) AddGetRequestArgument(key string, value string) + func (tx *Transaction) AddPathRequestArgument(key string, value string) + func (tx *Transaction) AddPostRequestArgument(key string, value string) + func (tx *Transaction) AddRequestHeader(key string, value string) + func (tx *Transaction) AddResponseArgument(key string, value string) + func (tx *Transaction) AddResponseHeader(key string, value string) + func (tx *Transaction) AuditLog() *auditlog.Log + func (tx *Transaction) CaptureField(index int, value string) + func (tx *Transaction) Capturing() bool + func (tx *Transaction) Close() error + func (tx *Transaction) Collection(idx variables.RuleVariable) collection.Collection + func (tx *Transaction) DebugLogger() debuglog.Logger + func (tx *Transaction) ExtractGetArguments(uri string) + func (tx *Transaction) GetField(rv ruleVariableParams) []types.MatchData + func (tx *Transaction) GetStopWatch() string + func (tx *Transaction) ID() string + func (tx *Transaction) Interrupt(interruption *types.Interruption) + func (tx *Transaction) Interruption() *types.Interruption + func (tx *Transaction) IsInterrupted() bool + func (tx *Transaction) IsRequestBodyAccessible() bool + func (tx *Transaction) IsResponseBodyAccessible() bool + func (tx *Transaction) IsResponseBodyProcessable() bool + func (tx *Transaction) IsRuleEngineOff() bool + func (tx *Transaction) LastPhase() types.RulePhase + func (tx *Transaction) MatchRule(r *Rule, mds []types.MatchData) + func (tx *Transaction) MatchedRules() []types.MatchedRule + func (tx *Transaction) ParseRequestReader(data io.Reader) (*types.Interruption, error) + func (tx *Transaction) ProcessConnection(client string, cPort int, server string, sPort int) + func (tx *Transaction) ProcessLogging() + func (tx *Transaction) ProcessRequestBody() (*types.Interruption, error) + func (tx *Transaction) ProcessRequestBytes(b []byte) (*types.Interruption, error) + func (tx *Transaction) ProcessRequestHeaders() *types.Interruption + func (tx *Transaction) ProcessResponseBody() (*types.Interruption, error) + func (tx *Transaction) ProcessResponseHeaders(code int, proto string) *types.Interruption + func (tx *Transaction) ProcessURI(uri string, method string, httpVersion string) + func (tx *Transaction) ReadRequestBodyFrom(r io.Reader) (*types.Interruption, int, error) + func (tx *Transaction) ReadResponseBodyFrom(r io.Reader) (*types.Interruption, int, error) + func (tx *Transaction) RemoveRuleByID(id int) + func (tx *Transaction) RemoveRuleTargetByID(id int, variable variables.RuleVariable, key string) + func (tx *Transaction) RequestBodyReader() (io.Reader, error) + func (tx *Transaction) ResponseBodyReader() (io.Reader, error) + func (tx *Transaction) SetDebugLogLevel(lvl debuglog.Level) + func (tx *Transaction) SetServerName(serverName string) + func (tx *Transaction) String() string + func (tx *Transaction) Variables() plugintypes.TransactionVariables + func (tx *Transaction) WriteRequestBody(b []byte) (*types.Interruption, int, error) + func (tx *Transaction) WriteResponseBody(b []byte) (*types.Interruption, int, error) + type TransactionVariables struct + func NewTransactionVariables() *TransactionVariables + func (v *TransactionVariables) All(f func(v variables.RuleVariable, col collection.Collection) bool) + func (v *TransactionVariables) Args() collection.Keyed + func (v *TransactionVariables) ArgsCombinedSize() collection.Collection + func (v *TransactionVariables) ArgsGet() collection.Map + func (v *TransactionVariables) ArgsGetNames() collection.Collection + func (v *TransactionVariables) ArgsNames() collection.Collection + func (v *TransactionVariables) ArgsPath() collection.Map + func (v *TransactionVariables) ArgsPost() collection.Map + func (v *TransactionVariables) ArgsPostNames() collection.Collection + func (v *TransactionVariables) Duration() collection.Single + func (v *TransactionVariables) Env() collection.Map + func (v *TransactionVariables) Files() collection.Map + func (v *TransactionVariables) FilesCombinedSize() collection.Single + func (v *TransactionVariables) FilesNames() collection.Map + func (v *TransactionVariables) FilesSizes() collection.Map + func (v *TransactionVariables) FilesTmpContent() collection.Map + func (v *TransactionVariables) FilesTmpNames() collection.Map + func (v *TransactionVariables) FullRequestLength() collection.Single + func (v *TransactionVariables) Geo() collection.Map + func (v *TransactionVariables) HighestSeverity() collection.Single + func (v *TransactionVariables) InboundDataError() collection.Single + func (v *TransactionVariables) MatchedVar() collection.Single + func (v *TransactionVariables) MatchedVarName() collection.Single + func (v *TransactionVariables) MatchedVars() collection.Map + func (v *TransactionVariables) MatchedVarsNames() collection.Collection + func (v *TransactionVariables) MultipartDataAfter() collection.Single + func (v *TransactionVariables) MultipartFilename() collection.Map + func (v *TransactionVariables) MultipartName() collection.Map + func (v *TransactionVariables) MultipartPartHeaders() collection.Map + func (v *TransactionVariables) OutboundDataError() collection.Single + func (v *TransactionVariables) QueryString() collection.Single + func (v *TransactionVariables) RemoteAddr() collection.Single + func (v *TransactionVariables) RemoteHost() collection.Single + func (v *TransactionVariables) RemotePort() collection.Single + func (v *TransactionVariables) RequestBasename() collection.Single + func (v *TransactionVariables) RequestBody() collection.Single + func (v *TransactionVariables) RequestBodyError() collection.Single + func (v *TransactionVariables) RequestBodyErrorMsg() collection.Single + func (v *TransactionVariables) RequestBodyLength() collection.Single + func (v *TransactionVariables) RequestBodyProcessor() collection.Single + func (v *TransactionVariables) RequestBodyProcessorError() collection.Single + func (v *TransactionVariables) RequestBodyProcessorErrorMsg() collection.Single + func (v *TransactionVariables) RequestCookies() collection.Map + func (v *TransactionVariables) RequestCookiesNames() collection.Collection + func (v *TransactionVariables) RequestFilename() collection.Single + func (v *TransactionVariables) RequestHeaders() collection.Map + func (v *TransactionVariables) RequestHeadersNames() collection.Collection + func (v *TransactionVariables) RequestLine() collection.Single + func (v *TransactionVariables) RequestMethod() collection.Single + func (v *TransactionVariables) RequestProtocol() collection.Single + func (v *TransactionVariables) RequestURI() collection.Single + func (v *TransactionVariables) RequestURIRaw() collection.Single + func (v *TransactionVariables) RequestXML() collection.Map + func (v *TransactionVariables) ResBodyError() collection.Single + func (v *TransactionVariables) ResBodyErrorMsg() collection.Single + func (v *TransactionVariables) ResBodyProcessorError() collection.Single + func (v *TransactionVariables) ResBodyProcessorErrorMsg() collection.Single + func (v *TransactionVariables) ResponseArgs() collection.Map + func (v *TransactionVariables) ResponseBody() collection.Single + func (v *TransactionVariables) ResponseBodyProcessor() collection.Single + func (v *TransactionVariables) ResponseContentLength() collection.Single + func (v *TransactionVariables) ResponseContentType() collection.Single + func (v *TransactionVariables) ResponseHeaders() collection.Map + func (v *TransactionVariables) ResponseHeadersNames() collection.Collection + func (v *TransactionVariables) ResponseProtocol() collection.Single + func (v *TransactionVariables) ResponseStatus() collection.Single + func (v *TransactionVariables) ResponseXML() collection.Map + func (v *TransactionVariables) Rule() collection.Map + func (v *TransactionVariables) ServerAddr() collection.Single + func (v *TransactionVariables) ServerName() collection.Single + func (v *TransactionVariables) ServerPort() collection.Single + func (v *TransactionVariables) StatusLine() collection.Single + func (v *TransactionVariables) TX() collection.Map + func (v *TransactionVariables) UniqueID() collection.Single + func (v *TransactionVariables) UrlencodedError() collection.Single + func (v *TransactionVariables) XML() collection.Map + type WAF struct + AbortOnRemoteRulesFail bool + ArgumentLimit int + ArgumentSeparator string + AuditEngine types.AuditEngineStatus + AuditLogParts types.AuditLogParts + AuditLogRelevantStatus *regexp.Regexp + AuditLogWriterConfig plugintypes.AuditLogConfig + ComponentNames []string + DataDir string + ErrorLogCb func(rule types.MatchedRule) + Logger debuglog.Logger + ProducerConnector string + ProducerConnectorVersion string + RequestBodyAccess bool + RequestBodyLimit int64 + RequestBodyLimitAction types.BodyLimitAction + RequestBodyNoFilesLimit int64 + ResponseBodyAccess bool + ResponseBodyLimit int64 + ResponseBodyLimitAction types.BodyLimitAction + ResponseBodyMimeTypes []string + RuleEngine types.RuleEngineStatus + Rules RuleGroup + SensorID string + ServerSignature string + TmpDir string + UploadDir string + UploadFileLimit int + UploadFileMode fs.FileMode + UploadKeepFiles bool + WebAppID string + func NewWAF() *WAF + func (w *WAF) AuditLogWriter() plugintypes.AuditLogWriter + func (w *WAF) InitAuditLogWriter() error + func (w *WAF) NewTransaction() *Transaction + func (w *WAF) NewTransactionWithID(id string) *Transaction + func (w *WAF) RequestBodyInMemoryLimit() *int64 + func (w *WAF) SetAuditLogWriter(alw plugintypes.AuditLogWriter) + func (w *WAF) SetDebugLogLevel(lvl debuglog.Level) error + func (w *WAF) SetDebugLogOutput(wr io.Writer) + func (w *WAF) SetDebugLogPath(path string) error + func (w *WAF) SetErrorCallback(cb func(rule types.MatchedRule)) + func (w *WAF) SetRequestBodyInMemoryLimit(limit int64) + func (w *WAF) Validate() error