@@ -102,127 +102,6 @@ class Rule {
102102};
103103
104104
105- class RuleWithActions : public Rule {
106- public:
107- RuleWithActions (
108- Actions *a,
109- Transformations *t,
110- std::unique_ptr<std::string> fileName,
111- int lineNumber);
112-
113- ~RuleWithActions ();
114-
115- void executeAction (Transaction *trans,
116- bool containsBlock,
117- std::shared_ptr<RuleMessage> ruleMessage,
118- actions::Action *a,
119- bool context);
120-
121- void executeTransformations (
122- Transaction *trasn, const std::string &value, TransformationResults &ret);
123- inline void executeTransformation (
124- actions::transformations::Transformation *a,
125- std::shared_ptr<std::string> *value,
126- Transaction *trans,
127- TransformationResults *ret,
128- std::string *path,
129- int *nth) const ;
130-
131- void executeActionsIndependentOfChainedRuleResult (Transaction *trasn,
132- bool *b, std::shared_ptr<RuleMessage> ruleMessage);
133- void executeActionsAfterFullMatch (Transaction *trasn,
134- bool containsDisruptive, std::shared_ptr<RuleMessage> ruleMessage);
135-
136- std::vector<actions::Action *> getActionsByName (const std::string& name,
137- Transaction *t);
138- bool containsTag (const std::string& name, Transaction *t);
139- bool containsMsg (const std::string& name, Transaction *t);
140-
141- inline bool isChained () const { return m_isChained == true ; }
142- inline bool hasCaptureAction () const { return m_containsCaptureAction == true ; }
143- inline void setChained (bool b) { m_isChained = b; }
144- inline bool hasDisruptiveAction () const { return m_disruptiveAction != NULL ; }
145- inline bool hasBlockAction () const { return m_containsStaticBlockAction == true ; }
146- inline bool hasMultimatch () const { return m_containsMultiMatchAction == true ; }
147-
148- inline bool hasLogData () const { return m_logData != NULL ; }
149- std::string logData (Transaction *t);
150- inline bool hasMsg () const { return m_msg != NULL ; }
151- std::string msg (Transaction *t);
152- inline bool hasSeverity () const { return m_severity != NULL ; }
153- int severity () const ;
154-
155- std::string m_rev;
156- std::string m_ver;
157- int m_accuracy;
158- int m_maturity;
159-
160- int64_t m_ruleId;
161-
162- private:
163- /* actions */
164- actions::Action *m_disruptiveAction;
165- actions::LogData *m_logData;
166- actions::Msg *m_msg;
167- actions::Severity *m_severity;
168- MatchActions m_actionsRuntimePos;
169- SetVars m_actionsSetVar;
170- Tags m_actionsTag;
171-
172- /* actions > transformations */
173- Transformations m_transformations;
174-
175- bool m_containsCaptureAction:1 ;
176- bool m_containsMultiMatchAction:1 ;
177- bool m_containsStaticBlockAction:1 ;
178- bool m_isChained:1 ;
179- };
180-
181-
182- class RuleWithOperator : public RuleWithActions {
183- public:
184- RuleWithOperator (operators::Operator *op,
185- variables::Variables *variables,
186- std::vector<actions::Action *> *actions,
187- Transformations *transformations,
188- std::unique_ptr<std::string> fileName,
189- int lineNumber);
190-
191- virtual ~RuleWithOperator ();
192-
193- bool evaluate (Transaction *transaction,
194- std::shared_ptr<RuleMessage> rm) override ;
195-
196- void getVariablesExceptions (Transaction *t,
197- variables::Variables *exclusion, variables::Variables *addition);
198- inline void getFinalVars (variables::Variables *vars,
199- variables::Variables *eclusion, Transaction *trans);
200-
201- bool executeOperatorAt (Transaction *trasn, const std::string &key,
202- std::string value, std::shared_ptr<RuleMessage> rm);
203-
204- static void updateMatchedVars (Transaction *trasn, const std::string &key,
205- const std::string &value);
206- static void cleanMatchedVars (Transaction *trasn);
207-
208- inline bool isUnconditional () const { return m_operator == NULL ; }
209-
210- std::string getOperatorName () const ;
211-
212- virtual std::string getReference () override {
213- return std::to_string (m_ruleId);
214- }
215-
216- std::unique_ptr<RuleWithOperator> m_chainedRuleChild;
217- RuleWithOperator *m_chainedRuleParent;
218-
219- private:
220- modsecurity::variables::Variables *m_variables;
221- operators::Operator *m_operator;
222-
223- bool m_unconditional:1 ;
224- };
225-
226105} // namespace modsecurity
227106#endif
228107
0 commit comments