mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-18 10:20:35 +03:00
actions: Compute the rule association during rules load
This commit is contained in:
@@ -39,7 +39,6 @@ class Session_DictElement : public Variable {
|
||||
m_dictElement("SESSION:" + dictElement) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
RuleWithActions *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_session_collection->resolveMultiMatches(
|
||||
m_name, t->m_collections.m_session_collection_key,
|
||||
@@ -56,7 +55,6 @@ class Session_NoDictElement : public Variable {
|
||||
: Variable("SESSION") { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
RuleWithActions *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_session_collection->resolveMultiMatches("",
|
||||
t->m_collections.m_session_collection_key,
|
||||
@@ -72,7 +70,6 @@ class Session_DictElementRegexp : public VariableRegex {
|
||||
m_dictElement(dictElement) { }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
RuleWithActions *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_session_collection->resolveRegularExpression(
|
||||
m_dictElement, t->m_collections.m_session_collection_key,
|
||||
@@ -83,14 +80,16 @@ class Session_DictElementRegexp : public VariableRegex {
|
||||
};
|
||||
|
||||
|
||||
class Session_DynamicElement : public Variable {
|
||||
class Session_DynamicElement : public VariableWithRunTimeString {
|
||||
public:
|
||||
explicit Session_DynamicElement(std::unique_ptr<RunTimeString> dictElement)
|
||||
: Variable("SESSION:dynamic"),
|
||||
m_string(std::move(dictElement)) { }
|
||||
: VariableWithRunTimeString(
|
||||
"SESSION:dynamic",
|
||||
std::move(dictElement)
|
||||
)
|
||||
{ }
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
RuleWithActions *rule,
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
std::string string = m_string->evaluate(t);
|
||||
t->m_collections.m_session_collection->resolveMultiMatches(
|
||||
@@ -112,8 +111,6 @@ class Session_DynamicElement : public Variable {
|
||||
t->m_rules->m_secWebAppId.m_value,
|
||||
value);
|
||||
}
|
||||
|
||||
std::unique_ptr<RunTimeString> m_string;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user