mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 13:26:01 +03:00
Renames collection::Variable to VariableValue
This commit is contained in:
parent
de7c5c89bb
commit
eeec7efb68
@ -29,7 +29,7 @@
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
#include "modsecurity/collection/variable.h"
|
||||
#include "modsecurity/variable_value.h"
|
||||
|
||||
#ifndef HEADERS_MODSECURITY_ANCHORED_SET_VARIABLE_H_
|
||||
#define HEADERS_MODSECURITY_ANCHORED_SET_VARIABLE_H_
|
||||
@ -66,7 +66,7 @@ struct MyHash{
|
||||
|
||||
|
||||
class AnchoredSetVariable : public std::unordered_multimap<std::string,
|
||||
collection::Variable *, MyHash, MyEqual> {
|
||||
VariableValue *, MyHash, MyEqual> {
|
||||
public:
|
||||
AnchoredSetVariable(Transaction *t, std::string name);
|
||||
~AnchoredSetVariable();
|
||||
@ -81,13 +81,13 @@ class AnchoredSetVariable : public std::unordered_multimap<std::string,
|
||||
|
||||
void setCopy(std::string key, std::string value, size_t offset);
|
||||
|
||||
void resolve(std::vector<const collection::Variable *> *l);
|
||||
void resolve(std::vector<const VariableValue *> *l);
|
||||
|
||||
void resolve(const std::string &key,
|
||||
std::vector<const collection::Variable *> *l);
|
||||
std::vector<const VariableValue *> *l);
|
||||
|
||||
void resolveRegularExpression(Utils::Regex *r,
|
||||
std::vector<const collection::Variable *> *l);
|
||||
std::vector<const VariableValue *> *l);
|
||||
|
||||
std::unique_ptr<std::string> resolveFirst(const std::string &key);
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
#include "modsecurity/collection/variable.h"
|
||||
#include "modsecurity/variable_value.h"
|
||||
|
||||
#ifndef HEADERS_MODSECURITY_ANCHORED_VARIABLE_H_
|
||||
#define HEADERS_MODSECURITY_ANCHORED_VARIABLE_H_
|
||||
@ -53,7 +53,7 @@ class AnchoredVariable {
|
||||
void append(const std::string &a, size_t offset,
|
||||
bool spaceSeparator, int size);
|
||||
|
||||
void evaluate(std::vector<const collection::Variable *> *l);
|
||||
void evaluate(std::vector<const VariableValue *> *l);
|
||||
std::string * evaluate();
|
||||
std::unique_ptr<std::string> resolveFirst();
|
||||
|
||||
@ -63,7 +63,7 @@ class AnchoredVariable {
|
||||
std::string m_value;
|
||||
|
||||
private:
|
||||
collection::Variable *m_var;
|
||||
VariableValue *m_var;
|
||||
};
|
||||
|
||||
} // namespace modsecurity
|
||||
|
@ -25,7 +25,8 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include "modsecurity/collection/variable.h"
|
||||
#include "modsecurity/variable_value.h"
|
||||
|
||||
|
||||
#ifndef HEADERS_MODSECURITY_COLLECTION_COLLECTION_H_
|
||||
#define HEADERS_MODSECURITY_COLLECTION_COLLECTION_H_
|
||||
@ -56,11 +57,11 @@ class Collection {
|
||||
const std::string& var) = 0;
|
||||
|
||||
virtual void resolveSingleMatch(const std::string& var,
|
||||
std::vector<const Variable *> *l) = 0;
|
||||
std::vector<const VariableValue *> *l) = 0;
|
||||
virtual void resolveMultiMatches(const std::string& var,
|
||||
std::vector<const Variable *> *l) = 0;
|
||||
std::vector<const VariableValue *> *l) = 0;
|
||||
virtual void resolveRegularExpression(const std::string& var,
|
||||
std::vector<const Variable *> *l) = 0;
|
||||
std::vector<const VariableValue *> *l) = 0;
|
||||
|
||||
|
||||
/* store */
|
||||
@ -140,7 +141,7 @@ class Collection {
|
||||
|
||||
/* resolveSingleMatch */
|
||||
virtual void resolveSingleMatch(const std::string& var,
|
||||
std::string compartment, std::vector<const Variable *> *l) {
|
||||
std::string compartment, std::vector<const VariableValue *> *l) {
|
||||
std::string nkey = compartment + "::" + var;
|
||||
resolveSingleMatch(nkey, l);
|
||||
}
|
||||
@ -148,7 +149,7 @@ class Collection {
|
||||
|
||||
virtual void resolveSingleMatch(const std::string& var,
|
||||
std::string compartment, std::string compartment2,
|
||||
std::vector<const Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
std::string nkey = compartment + "::" + compartment2 + "::" + var;
|
||||
resolveSingleMatch(nkey, l);
|
||||
}
|
||||
@ -156,7 +157,7 @@ class Collection {
|
||||
|
||||
/* resolveMultiMatches */
|
||||
virtual void resolveMultiMatches(const std::string& var,
|
||||
std::string compartment, std::vector<const Variable *> *l) {
|
||||
std::string compartment, std::vector<const VariableValue *> *l) {
|
||||
std::string nkey = compartment + "::" + var;
|
||||
resolveMultiMatches(nkey, l);
|
||||
}
|
||||
@ -164,7 +165,7 @@ class Collection {
|
||||
|
||||
virtual void resolveMultiMatches(const std::string& var,
|
||||
std::string compartment, std::string compartment2,
|
||||
std::vector<const Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
std::string nkey = compartment + "::" + compartment2 + "::" + var;
|
||||
resolveMultiMatches(nkey, l);
|
||||
}
|
||||
@ -172,7 +173,7 @@ class Collection {
|
||||
|
||||
/* resolveRegularExpression */
|
||||
virtual void resolveRegularExpression(const std::string& var,
|
||||
std::string compartment, std::vector<const Variable *> *l) {
|
||||
std::string compartment, std::vector<const VariableValue *> *l) {
|
||||
std::string nkey = compartment + "::" + var;
|
||||
resolveRegularExpression(nkey, l);
|
||||
}
|
||||
@ -180,7 +181,7 @@ class Collection {
|
||||
|
||||
virtual void resolveRegularExpression(const std::string& var,
|
||||
std::string compartment, std::string compartment2,
|
||||
std::vector<const Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
std::string nkey = compartment + "::" + compartment2 + "::" + var;
|
||||
resolveRegularExpression(nkey, l);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
#endif
|
||||
|
||||
#include "modsecurity/collection/collection.h"
|
||||
#include "modsecurity/collection/variable.h"
|
||||
#include "modsecurity/variable_value.h"
|
||||
|
||||
#ifndef HEADERS_MODSECURITY_COLLECTION_COLLECTIONS_H_
|
||||
#define HEADERS_MODSECURITY_COLLECTION_COLLECTIONS_H_
|
||||
|
@ -26,7 +26,7 @@
|
||||
#define HEADERS_MODSECURITY_RULE_H_
|
||||
|
||||
#include "modsecurity/transaction.h"
|
||||
#include "modsecurity/collection/variable.h"
|
||||
#include "modsecurity/variable_value.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -55,7 +55,7 @@ class Rule {
|
||||
virtual bool evaluate(Transaction *transaction,
|
||||
std::shared_ptr<RuleMessage> rm);
|
||||
bool evaluateActions(Transaction *transaction);
|
||||
std::vector<std::unique_ptr<collection::Variable>>
|
||||
std::vector<std::unique_ptr<VariableValue>>
|
||||
getFinalVars(Transaction *trasn);
|
||||
void executeActionsAfterFullMatch(Transaction *trasn,
|
||||
bool containsDisruptive, std::shared_ptr<RuleMessage> ruleMessage);
|
||||
|
@ -40,11 +40,11 @@ typedef struct Transaction_t Transaction;
|
||||
typedef struct Rules_t Rules;
|
||||
#endif
|
||||
|
||||
#include "modsecurity/anchored_set_variable.h"
|
||||
#include "modsecurity/anchored_variable.h"
|
||||
#include "anchored_set_variable.h"
|
||||
#include "anchored_variable.h"
|
||||
#include "modsecurity/intervention.h"
|
||||
#include "modsecurity/collection/collections.h"
|
||||
#include "modsecurity/collection/variable.h"
|
||||
#include "modsecurity/variable_value.h"
|
||||
#include "modsecurity/collection/collection.h"
|
||||
#include "modsecurity/variable_origin.h"
|
||||
|
||||
|
@ -24,28 +24,27 @@
|
||||
|
||||
#include "modsecurity/variable_origin.h"
|
||||
|
||||
#ifndef HEADERS_MODSECURITY_COLLECTION_VARIABLE_H_
|
||||
#define HEADERS_MODSECURITY_COLLECTION_VARIABLE_H_
|
||||
#ifndef HEADERS_MODSECURITY_VARIABLE_H_
|
||||
#define HEADERS_MODSECURITY_VARIABLE_H_
|
||||
|
||||
#ifndef __cplusplus
|
||||
typedef struct Variable_t Variable;
|
||||
typedef struct Variable_t VariableValue;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace modsecurity {
|
||||
namespace collection {
|
||||
|
||||
class Collection;
|
||||
class Variable {
|
||||
class VariableValue {
|
||||
public:
|
||||
explicit Variable(const std::string *key) :
|
||||
explicit VariableValue(const std::string *key) :
|
||||
m_key(""),
|
||||
m_value("") {
|
||||
m_key.assign(*key);
|
||||
m_keyWithCollection = std::make_shared<std::string>(*key);
|
||||
}
|
||||
|
||||
Variable(const std::string *key, const std::string *value) :
|
||||
VariableValue(const std::string *key, const std::string *value) :
|
||||
m_key(""),
|
||||
m_value("") {
|
||||
m_key.assign(*key);
|
||||
@ -53,26 +52,26 @@ class Variable {
|
||||
m_keyWithCollection = std::make_shared<std::string>(*key);
|
||||
}
|
||||
|
||||
Variable() :
|
||||
VariableValue() :
|
||||
m_key(""),
|
||||
m_value("") {
|
||||
m_keyWithCollection = std::make_shared<std::string>(m_key);
|
||||
}
|
||||
|
||||
Variable(const std::string *a, const std::string *b, const std::string *c) :
|
||||
VariableValue(const std::string *a, const std::string *b, const std::string *c) :
|
||||
m_key(*a + ":" + *b),
|
||||
m_value(*c) {
|
||||
m_keyWithCollection = std::make_shared<std::string>(*a + ":" + *b);
|
||||
}
|
||||
|
||||
Variable(std::shared_ptr<std::string> fullName) :
|
||||
VariableValue(std::shared_ptr<std::string> fullName) :
|
||||
m_key(""),
|
||||
m_value("") {
|
||||
m_keyWithCollection = fullName;
|
||||
m_key.assign(*fullName.get());
|
||||
}
|
||||
|
||||
Variable(std::shared_ptr<std::string> fullName, const std::string *value) :
|
||||
VariableValue(std::shared_ptr<std::string> fullName, const std::string *value) :
|
||||
m_key(""),
|
||||
m_value("") {
|
||||
m_value.assign(*value);
|
||||
@ -81,7 +80,7 @@ class Variable {
|
||||
}
|
||||
|
||||
|
||||
explicit Variable(const Variable *o) :
|
||||
explicit VariableValue(const VariableValue *o) :
|
||||
m_key(""),
|
||||
m_value("") {
|
||||
m_key.assign(o->m_key);
|
||||
@ -104,8 +103,7 @@ class Variable {
|
||||
std::list<std::unique_ptr<VariableOrigin>> m_orign;
|
||||
};
|
||||
|
||||
} // namespace collection
|
||||
} // namespace modsecurity
|
||||
#endif
|
||||
|
||||
#endif // HEADERS_MODSECURITY_COLLECTION_VARIABLE_H_
|
||||
#endif // HEADERS_MODSECURITY_VARIABLE_H_
|
@ -47,14 +47,15 @@ pkginclude_HEADERS = \
|
||||
../headers/modsecurity/rules_exceptions.h \
|
||||
../headers/modsecurity/rules_properties.h \
|
||||
../headers/modsecurity/transaction.h \
|
||||
../headers/modsecurity/variable_origin.h
|
||||
../headers/modsecurity/variable_origin.h \
|
||||
../headers/modsecurity/variable_value.h
|
||||
|
||||
|
||||
|
||||
libmodsecurity_includesub_collection_HEADERS = \
|
||||
../headers/modsecurity/collection/collection.h \
|
||||
../headers/modsecurity/collection/collections.h \
|
||||
../headers/modsecurity/collection/variable.h
|
||||
../headers/modsecurity/collection/collections.h
|
||||
|
||||
|
||||
|
||||
libmodsecurity_includesub_actions_HEADERS = \
|
||||
|
@ -49,7 +49,7 @@ bool SetVar::evaluate(Rule *rule, Transaction *t) {
|
||||
}
|
||||
|
||||
std::string m_variableNameExpanded;
|
||||
std::vector<const collection::Variable *> l;
|
||||
std::vector<const VariableValue *> l;
|
||||
|
||||
auto *v = m_variable.get();
|
||||
Variables::Tx_DynamicElement *tx = dynamic_cast<Variables::Tx_DynamicElement *> (v);
|
||||
@ -106,7 +106,7 @@ bool SetVar::evaluate(Rule *rule, Transaction *t) {
|
||||
}
|
||||
|
||||
try {
|
||||
std::vector<const collection::Variable *> l;
|
||||
std::vector<const VariableValue *> l;
|
||||
m_variable->evaluate(t, rule, &l);
|
||||
if (l.size() == 0) {
|
||||
value = 0;
|
||||
|
@ -13,14 +13,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "modsecurity/anchored_set_variable.h"
|
||||
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "modsecurity/anchored_set_variable.h"
|
||||
#include "modsecurity/modsecurity.h"
|
||||
#include "modsecurity/transaction.h"
|
||||
#include "src/utils/regex.h"
|
||||
@ -42,7 +41,7 @@ AnchoredSetVariable::~AnchoredSetVariable() {
|
||||
|
||||
void AnchoredSetVariable::unset() {
|
||||
for (const auto& x : *this) {
|
||||
collection::Variable *var = x.second;
|
||||
VariableValue *var = x.second;
|
||||
delete var;
|
||||
}
|
||||
clear();
|
||||
@ -53,7 +52,7 @@ void AnchoredSetVariable::set(const std::string &key,
|
||||
const std::string &value, size_t offset, size_t len) {
|
||||
std::unique_ptr<VariableOrigin> origin(new VariableOrigin());
|
||||
std::string *v = new std::string(value);
|
||||
collection::Variable *var = new collection::Variable(std::make_shared<std::string>(m_name + ":" + key), v);
|
||||
VariableValue *var = new VariableValue(std::make_shared<std::string>(m_name + ":" + key), v);
|
||||
delete v;
|
||||
|
||||
origin->m_offset = offset;
|
||||
@ -68,7 +67,7 @@ void AnchoredSetVariable::set(const std::string &key,
|
||||
const std::string &value, size_t offset) {
|
||||
std::unique_ptr<VariableOrigin> origin(new VariableOrigin());
|
||||
std::string *v = new std::string(value);
|
||||
collection::Variable *var = new collection::Variable(std::make_shared<std::string>(m_name + ":" + key), v);
|
||||
VariableValue *var = new VariableValue(std::make_shared<std::string>(m_name + ":" + key), v);
|
||||
delete v;
|
||||
|
||||
origin->m_offset = offset;
|
||||
@ -80,18 +79,18 @@ void AnchoredSetVariable::set(const std::string &key,
|
||||
|
||||
|
||||
void AnchoredSetVariable::resolve(
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
for (const auto& x : *this) {
|
||||
l->insert(l->begin(), new collection::Variable(x.second));
|
||||
l->insert(l->begin(), new VariableValue(x.second));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void AnchoredSetVariable::resolve(const std::string &key,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
auto range = this->equal_range(key);
|
||||
for (auto it = range.first; it != range.second; ++it) {
|
||||
l->push_back(new collection::Variable(it->second));
|
||||
l->push_back(new VariableValue(it->second));
|
||||
}
|
||||
}
|
||||
|
||||
@ -109,13 +108,13 @@ std::unique_ptr<std::string> AnchoredSetVariable::resolveFirst(
|
||||
|
||||
|
||||
void AnchoredSetVariable::resolveRegularExpression(Utils::Regex *r,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
for (const auto& x : *this) {
|
||||
int ret = Utils::regex_search(x.first, *r);
|
||||
if (ret <= 0) {
|
||||
continue;
|
||||
}
|
||||
l->insert(l->begin(), new collection::Variable(x.second));
|
||||
l->insert(l->begin(), new VariableValue(x.second));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,14 +13,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "modsecurity/anchored_variable.h"
|
||||
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "../headers/modsecurity/anchored_variable.h"
|
||||
#include "modsecurity/modsecurity.h"
|
||||
#include "modsecurity/transaction.h"
|
||||
#include "src/utils/regex.h"
|
||||
@ -36,7 +35,7 @@ AnchoredVariable::AnchoredVariable(Transaction *t,
|
||||
m_name(""),
|
||||
m_value("") {
|
||||
m_name.append(name);
|
||||
m_var = new collection::Variable(&m_name);
|
||||
m_var = new VariableValue(&m_name);
|
||||
}
|
||||
|
||||
|
||||
@ -110,13 +109,13 @@ void AnchoredVariable::append(const std::string &a, size_t offset,
|
||||
}
|
||||
|
||||
|
||||
void AnchoredVariable::evaluate(std::vector<const collection::Variable *> *l) {
|
||||
void AnchoredVariable::evaluate(std::vector<const VariableValue *> *l) {
|
||||
if (m_name.empty() || m_value.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_var->m_value.assign(m_value);
|
||||
collection::Variable *m_var2 = new collection::Variable(m_var);
|
||||
VariableValue *m_var2 = new VariableValue(m_var);
|
||||
l->push_back(m_var2);
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include "modsecurity/collection/variable.h"
|
||||
#include "modsecurity/variable_value.h"
|
||||
#include "src/utils/regex.h"
|
||||
#include "src/utils/string.h"
|
||||
|
||||
@ -86,35 +86,35 @@ void InMemoryPerProcess::del(const std::string& key) {
|
||||
|
||||
|
||||
void InMemoryPerProcess::resolveSingleMatch(const std::string& var,
|
||||
std::vector<const Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
auto range = this->equal_range(var);
|
||||
|
||||
for (auto it = range.first; it != range.second; ++it) {
|
||||
l->push_back(new Variable(&m_name, &it->first, &it->second));
|
||||
l->push_back(new VariableValue(&m_name, &it->first, &it->second));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void InMemoryPerProcess::resolveMultiMatches(const std::string& var,
|
||||
std::vector<const Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
size_t keySize = var.size();
|
||||
l->reserve(15);
|
||||
|
||||
if (keySize == 0) {
|
||||
for (auto &i : *this) {
|
||||
l->insert(l->begin(), new Variable(&m_name, &i.first, &i.second));
|
||||
l->insert(l->begin(), new VariableValue(&m_name, &i.first, &i.second));
|
||||
}
|
||||
} else {
|
||||
auto range = this->equal_range(var);
|
||||
for (auto it = range.first; it != range.second; ++it) {
|
||||
l->insert(l->begin(), new Variable(&m_name, &var, &it->second));
|
||||
l->insert(l->begin(), new VariableValue(&m_name, &var, &it->second));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void InMemoryPerProcess::resolveRegularExpression(const std::string& var,
|
||||
std::vector<const Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
|
||||
|
||||
//if (var.find(":") == std::string::npos) {
|
||||
@ -146,7 +146,7 @@ void InMemoryPerProcess::resolveRegularExpression(const std::string& var,
|
||||
continue;
|
||||
}
|
||||
|
||||
l->insert(l->begin(), new Variable(&m_name, &x.first, &x.second));
|
||||
l->insert(l->begin(), new VariableValue(&m_name, &x.first, &x.second));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#include "modsecurity/collection/variable.h"
|
||||
#include "modsecurity/variable_value.h"
|
||||
#include "modsecurity/collection/collection.h"
|
||||
|
||||
#ifndef SRC_COLLECTION_BACKEND_IN_MEMORY_PER_PROCESS_H_
|
||||
@ -86,11 +86,11 @@ class InMemoryPerProcess :
|
||||
std::unique_ptr<std::string> resolveFirst(const std::string& var) override;
|
||||
|
||||
void resolveSingleMatch(const std::string& var,
|
||||
std::vector<const Variable *> *l) override;
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
void resolveMultiMatches(const std::string& var,
|
||||
std::vector<const Variable *> *l) override;
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
void resolveRegularExpression(const std::string& var,
|
||||
std::vector<const Variable *> *l) override;
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
|
||||
private:
|
||||
pthread_mutex_t m_lock;
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <string>
|
||||
#include <memory>
|
||||
|
||||
#include "modsecurity/collection/variable.h"
|
||||
#include "modsecurity/variable_value.h"
|
||||
#include "src/utils/regex.h"
|
||||
|
||||
#undef LMDB_STDOUT_COUT
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include "modsecurity/collection/variable.h"
|
||||
#include "modsecurity/variable_value.h"
|
||||
#include "modsecurity/collection/collection.h"
|
||||
|
||||
#ifndef SRC_COLLECTION_BACKEND_LMDB_H_
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include <vector>
|
||||
#endif
|
||||
|
||||
#include "modsecurity/collection/variable.h"
|
||||
#include "modsecurity/variable_value.h"
|
||||
#include "modsecurity/collection/collection.h"
|
||||
#include "src/collection/backend/in_memory-per_process.h"
|
||||
#include "src/utils/string.h"
|
||||
|
@ -26,10 +26,10 @@
|
||||
#include <iterator>
|
||||
#include <iostream>
|
||||
|
||||
#include "modsecurity/variable_value.h"
|
||||
#include "modsecurity/modsecurity.h"
|
||||
#include "src/utils/string.h"
|
||||
#include "modsecurity/transaction.h"
|
||||
#include "modsecurity/collection/variable.h"
|
||||
#include "src/variables/variable.h"
|
||||
#include "src/variables/highest_severity.h"
|
||||
#include "src/actions/transformations/transformation.h"
|
||||
@ -278,7 +278,7 @@ int Lua::getvars(lua_State *L) {
|
||||
const char *varname = NULL;
|
||||
Transaction *t = NULL;
|
||||
void *z = NULL;
|
||||
std::vector<const collection::Variable *> l;
|
||||
std::vector<const VariableValue *> l;
|
||||
int idx = 1;
|
||||
|
||||
/* Retrieve parameters. */
|
||||
@ -307,7 +307,7 @@ int Lua::getvars(lua_State *L) {
|
||||
idx++;
|
||||
}
|
||||
|
||||
for (const collection::Variable * i : l) {
|
||||
for (const VariableValue * i : l) {
|
||||
delete i;
|
||||
}
|
||||
|
||||
|
22
src/rule.cc
22
src/rule.cc
@ -421,14 +421,14 @@ std::list<std::pair<std::shared_ptr<std::string>,
|
||||
}
|
||||
|
||||
|
||||
std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
|
||||
std::vector<std::unique_ptr<VariableValue>> Rule::getFinalVars(
|
||||
Transaction *trans) {
|
||||
std::list<std::string> exclusions;
|
||||
std::list<std::string> exclusions_update_by_tag_remove;
|
||||
std::list<std::string> exclusions_update_by_msg_remove;
|
||||
std::list<std::string> exclusions_update_by_id_remove;
|
||||
std::vector<Variables::Variable *> variables;
|
||||
std::vector<std::unique_ptr<collection::Variable>> finalVars;
|
||||
std::vector<std::unique_ptr<VariableValue>> finalVars;
|
||||
|
||||
std::copy(m_variables->begin(), m_variables->end(),
|
||||
std::back_inserter(variables));
|
||||
@ -439,7 +439,7 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
|
||||
continue;
|
||||
}
|
||||
if (a.second->m_isExclusion) {
|
||||
std::vector<const collection::Variable *> z;
|
||||
std::vector<const VariableValue *> z;
|
||||
a.second->evaluate(trans, this, &z);
|
||||
for (auto &y : z) {
|
||||
exclusions_update_by_tag_remove.push_back(
|
||||
@ -461,7 +461,7 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
|
||||
continue;
|
||||
}
|
||||
if (a.second->m_isExclusion) {
|
||||
std::vector<const collection::Variable *> z;
|
||||
std::vector<const VariableValue *> z;
|
||||
a.second->evaluate(trans, this, &z);
|
||||
for (auto &y : z) {
|
||||
exclusions_update_by_msg_remove.push_back(
|
||||
@ -483,7 +483,7 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
|
||||
continue;
|
||||
}
|
||||
if (a.second->m_isExclusion) {
|
||||
std::vector<const collection::Variable *> z;
|
||||
std::vector<const VariableValue *> z;
|
||||
a.second->evaluate(trans, this, &z);
|
||||
for (auto &y : z) {
|
||||
exclusions_update_by_id_remove.push_back(std::string(y->m_key));
|
||||
@ -500,7 +500,7 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
|
||||
for (int i = 0; i < variables.size(); i++) {
|
||||
Variable *variable = variables.at(i);
|
||||
if (variable->m_isExclusion) {
|
||||
std::vector<const collection::Variable *> z;
|
||||
std::vector<const VariableValue *> z;
|
||||
variable->evaluate(trans, this, &z);
|
||||
for (auto &y : z) {
|
||||
exclusions.push_back(std::string(y->m_key));
|
||||
@ -512,7 +512,7 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
|
||||
|
||||
for (int i = 0; i < variables.size(); i++) {
|
||||
Variable *variable = variables.at(i);
|
||||
std::vector<const collection::Variable *> e;
|
||||
std::vector<const VariableValue *> e;
|
||||
bool ignoreVariable = false;
|
||||
|
||||
if (variable->m_isExclusion) {
|
||||
@ -520,7 +520,7 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
|
||||
}
|
||||
|
||||
variable->evaluate(trans, this, &e);
|
||||
for (const collection::Variable *v : e) {
|
||||
for (const VariableValue *v : e) {
|
||||
std::string key = v->m_key;
|
||||
|
||||
if (std::find_if(exclusions.begin(), exclusions.end(),
|
||||
@ -648,8 +648,8 @@ std::vector<std::unique_ptr<collection::Variable>> Rule::getFinalVars(
|
||||
continue;
|
||||
}
|
||||
|
||||
std::unique_ptr<collection::Variable> var(
|
||||
new collection::Variable(v));
|
||||
std::unique_ptr<VariableValue> var(
|
||||
new VariableValue(v));
|
||||
delete v;
|
||||
v = NULL;
|
||||
finalVars.push_back(std::move(var));
|
||||
@ -737,7 +737,7 @@ bool Rule::evaluate(Transaction *trans,
|
||||
std::vector<Variable *> *variables = this->m_variables;
|
||||
bool recursiveGlobalRet;
|
||||
bool containsDisruptive = false;
|
||||
std::vector<std::unique_ptr<collection::Variable>> finalVars;
|
||||
std::vector<std::unique_ptr<VariableValue>> finalVars;
|
||||
std::string eparam;
|
||||
|
||||
if (ruleMessage == NULL) {
|
||||
|
@ -17,8 +17,9 @@
|
||||
#include <memory>
|
||||
|
||||
#include "src/run_time_string.h"
|
||||
|
||||
#include "modsecurity/variable_value.h"
|
||||
#include "modsecurity/transaction.h"
|
||||
#include "modsecurity/collection/variable.h"
|
||||
#include "src/variables/rule.h"
|
||||
#include "src/variables/tx.h"
|
||||
#include "src/variables/highest_severity.h"
|
||||
@ -51,7 +52,7 @@ std::string RunTimeString::evaluate(Transaction *t) {
|
||||
if (z->m_string.size() > 0) {
|
||||
s.append(z->m_string);
|
||||
} else if (z->m_var != NULL && t != NULL) {
|
||||
std::vector<const collection::Variable *> l;
|
||||
std::vector<const VariableValue *> l;
|
||||
z->m_var->evaluate(t, NULL, &l);
|
||||
if (l.size() > 0) {
|
||||
s.append(l[0]->m_value);
|
||||
|
@ -784,7 +784,7 @@ int Transaction::processRequestBody() {
|
||||
* computationally intensive.
|
||||
*/
|
||||
std::string fullRequest;
|
||||
std::vector<const collection::Variable *> l;
|
||||
std::vector<const VariableValue *> l;
|
||||
m_variableRequestHeaders.resolve(&l);
|
||||
for (auto &a : l) {
|
||||
std::string z(a->m_key, 16, a->m_key.length() - 16);
|
||||
@ -1369,7 +1369,7 @@ std::string Transaction::toOldAuditLogFormatIndex(const std::string &filename,
|
||||
ss << utils::string::dash_if_empty(this->m_clientIpAddress.c_str()) << " ";
|
||||
/** TODO: Check variable */
|
||||
Variables::RemoteUser *r = new Variables::RemoteUser("REMOTE_USER");
|
||||
std::vector<const collection::Variable *> l;
|
||||
std::vector<const VariableValue *> l;
|
||||
r->evaluate(this, NULL, &l);
|
||||
delete r;
|
||||
|
||||
@ -1432,7 +1432,7 @@ std::string Transaction::toOldAuditLogFormat(int parts,
|
||||
audit_log << std::endl;
|
||||
|
||||
if (parts & audit_log::AuditLog::BAuditLogPart) {
|
||||
std::vector<const collection::Variable *> l;
|
||||
std::vector<const VariableValue *> l;
|
||||
audit_log << "--" << trailer << "-" << "B--" << std::endl;
|
||||
audit_log << utils::string::dash_if_empty(
|
||||
m_variableRequestMethod.evaluate());
|
||||
@ -1472,7 +1472,7 @@ std::string Transaction::toOldAuditLogFormat(int parts,
|
||||
audit_log << std::endl;
|
||||
}
|
||||
if (parts & audit_log::AuditLog::FAuditLogPart) {
|
||||
std::vector<const collection::Variable *> l;
|
||||
std::vector<const VariableValue *> l;
|
||||
|
||||
audit_log << "--" << trailer << "-" << "F--" << std::endl;
|
||||
audit_log << "HTTP/" << m_httpVersion.c_str() << " ";
|
||||
@ -1572,7 +1572,7 @@ std::string Transaction::toJSON(int parts) {
|
||||
|
||||
/* request headers */
|
||||
if (parts & audit_log::AuditLog::BAuditLogPart) {
|
||||
std::vector<const collection::Variable *> l;
|
||||
std::vector<const VariableValue *> l;
|
||||
yajl_gen_string(g, reinterpret_cast<const unsigned char*>("headers"),
|
||||
strlen("headers"));
|
||||
yajl_gen_map_open(g);
|
||||
@ -1603,7 +1603,7 @@ std::string Transaction::toJSON(int parts) {
|
||||
|
||||
/* response headers */
|
||||
if (parts & audit_log::AuditLog::FAuditLogPart) {
|
||||
std::vector<const collection::Variable *> l;
|
||||
std::vector<const VariableValue *> l;
|
||||
yajl_gen_string(g, reinterpret_cast<const unsigned char*>("headers"),
|
||||
strlen("headers"));
|
||||
yajl_gen_map_open(g);
|
||||
|
@ -37,7 +37,7 @@ class Args_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgs.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ class Args_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgs.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -67,7 +67,7 @@ class Args_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgs.resolveRegularExpression(&m_r, l);
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ class ArgsCombinedSize : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableARGScombinedSize.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -37,7 +37,7 @@ class ArgsGet_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgsGet.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ class ArgsGet_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgsGet.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -66,7 +66,7 @@ class ArgsGet_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgsGet.resolveRegularExpression(&m_r, l);
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class ArgsGetNames_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgsGetNames.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ class ArgsGetNames_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgsGetNames.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -65,7 +65,7 @@ class ArgsGetNames_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgsGetNames.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class ArgsNames_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgsNames.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ class ArgsNames_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgsNames.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -65,7 +65,7 @@ class ArgsNames_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgsNames.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ class ArgsPost_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgsPost.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ class ArgsPost_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgsPost.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -66,7 +66,7 @@ class ArgsPost_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgsPost.resolveRegularExpression(&m_r, l);
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ class ArgsPostNames_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgsPostNames.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ class ArgsPostNames_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgsPostNames.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -65,7 +65,7 @@ class ArgsPostNames_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableArgsPostNames.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class AuthType : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableAuthType.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -29,12 +29,12 @@ namespace Variables {
|
||||
|
||||
void Duration::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
double e = utils::cpu_seconds() - transaction->m_creationTimeStamp;
|
||||
|
||||
transaction->m_variableDuration.assign(std::to_string(e));
|
||||
|
||||
l->push_back(new collection::Variable(&m_retName,
|
||||
l->push_back(new VariableValue(&m_retName,
|
||||
&transaction->m_variableDuration));
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ class Duration : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override;
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
std::string m_retName;
|
||||
};
|
||||
|
||||
|
@ -34,7 +34,7 @@ namespace Variables {
|
||||
|
||||
void Env::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
for (char **current = environ; *current; current++) {
|
||||
std::string env = std::string(*current);
|
||||
size_t pos = env.find_first_of("=");
|
||||
@ -51,7 +51,7 @@ void Env::evaluate(Transaction *transaction,
|
||||
if (x.first != m_name && m_name.length() > 0) {
|
||||
continue;
|
||||
}
|
||||
l->push_back(new collection::Variable(&m_collectionName, &x.first, &x.second));
|
||||
l->push_back(new VariableValue(&m_collectionName, &x.first, &x.second));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ class Env : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override;
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
};
|
||||
|
||||
|
||||
|
@ -38,7 +38,7 @@ class Files_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableFiles.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ class Files_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableFiles.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -67,7 +67,7 @@ class Files_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableFiles.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class FilesCombinedSize : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableFilesCombinedSize.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -38,7 +38,7 @@ class FilesNames_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableFilesNames.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ class FilesNames_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableFilesNames.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -68,7 +68,7 @@ class FilesNames_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableFilesNames.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class FilesSizes_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableFilesSizes.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ class FilesSizes_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableFilesSizes.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -67,7 +67,7 @@ class FilesSizes_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableFilesSizes.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class FilesTmpContent_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableFilesTmpContent.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ class FilesTmpContent_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableFilesTmpContent.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -67,7 +67,7 @@ class FilesTmpContent_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableFilesTmpContent.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ class FilesTmpNames_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableFilesTmpNames.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ class FilesTmpNames_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableFilesTmpNames.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -66,7 +66,7 @@ class FilesTmpNames_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableFilesTmpNames.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class FullRequest : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableFullRequest.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class FullRequestLength : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableFullRequestLength.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -38,7 +38,7 @@ class Geo_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableGeo.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ class Geo_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableGeo.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -67,7 +67,7 @@ class Geo_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableGeo.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ class Global_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_global_collection->resolveMultiMatches(
|
||||
m_dictElement, t->m_collections.m_global_collection_key, l);
|
||||
}
|
||||
@ -55,7 +55,7 @@ class Global_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_global_collection->resolveMultiMatches(m_name,
|
||||
t->m_collections.m_global_collection_key, l);
|
||||
}
|
||||
@ -71,7 +71,7 @@ class Global_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_global_collection->resolveRegularExpression(
|
||||
m_dictElement, t->m_collections.m_global_collection_key, l);
|
||||
}
|
||||
@ -89,7 +89,7 @@ class Global_DynamicElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
std::string string = m_string->evaluate(t);
|
||||
t->m_collections.m_global_collection->resolveMultiMatches(
|
||||
string, t->m_collections.m_global_collection_key, l);
|
||||
|
@ -28,10 +28,10 @@ namespace Variables {
|
||||
|
||||
void HighestSeverity::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableHighestSeverityAction.assign(
|
||||
std::to_string(transaction->m_highestSeverityAction));
|
||||
l->push_back(new collection::Variable(m_fullName,
|
||||
l->push_back(new VariableValue(m_fullName,
|
||||
&transaction->m_variableHighestSeverityAction));
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ class HighestSeverity : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override;
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
std::string m_retName;
|
||||
};
|
||||
|
||||
|
@ -36,7 +36,7 @@ class InboundDataError : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableInboundDataError.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -39,7 +39,7 @@ class Ip_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_ip_collection->resolveMultiMatches(m_dictElement,
|
||||
t->m_collections.m_ip_collection_key, l);
|
||||
|
||||
@ -56,7 +56,7 @@ class Ip_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_ip_collection->resolveMultiMatches(m_name,
|
||||
t->m_collections.m_ip_collection_key, l);
|
||||
}
|
||||
@ -72,7 +72,7 @@ class Ip_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_ip_collection->resolveRegularExpression(m_dictElement,
|
||||
t->m_collections.m_ip_collection_key, l);
|
||||
}
|
||||
@ -90,7 +90,7 @@ class Ip_DynamicElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
std::string string = m_string->evaluate(t);
|
||||
t->m_collections.m_ip_collection->resolveMultiMatches("IP:" + string,
|
||||
t->m_collections.m_ip_collection_key, l);
|
||||
|
@ -36,7 +36,7 @@ class MatchedVar : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableMatchedVar.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class MatchedVarName : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableMatchedVarName.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -38,7 +38,7 @@ class MatchedVars_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableMatchedVars.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ class MatchedVars_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableMatchedVars.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -67,7 +67,7 @@ class MatchedVars_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableMatchedVars.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class MatchedVarsNames_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableMatchedVarsNames.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ class MatchedVarsNames_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableMatchedVarsNames.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -67,7 +67,7 @@ class MatchedVarsNames_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableMatchedVarsNames.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -26,9 +26,9 @@ namespace Variables {
|
||||
|
||||
void ModsecBuild::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
|
||||
l->push_back(new collection::Variable(&m_retName, &m_build));
|
||||
l->push_back(new VariableValue(&m_retName, &m_build));
|
||||
}
|
||||
|
||||
|
||||
|
@ -45,7 +45,7 @@ class ModsecBuild : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override;
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
|
||||
std::string m_build;
|
||||
std::string m_retName;
|
||||
|
@ -36,7 +36,7 @@ class MultipartBoundaryQuoted : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableMultipartBoundaryQuoted.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class MultipartBoundaryWhiteSpace : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableMultipartBoundaryWhiteSpace.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class MultipartCrlfLFLines : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableMultipartCrlfLFLines.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class MultipartDateAfter : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableMultipartDataAfter.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class MultipartDateBefore : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableMultipartDataBefore.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class MultipartFileLimitExceeded : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableMultipartFileLimitExceeded.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -38,7 +38,7 @@ class MultiPartFileName_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableMultipartFileName.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ class MultiPartFileName_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableMultipartFileName.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -67,7 +67,7 @@ class MultiPartFileName_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableMultipartFileName.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class MultipartHeaderFolding : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableMultipartHeaderFolding.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class MultipartInvalidHeaderFolding : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableMultipartInvalidHeaderFolding.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class MultipartInvalidPart : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableMultipartInvalidPart.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ class MultipartInvalidQuoting : public Variable {
|
||||
: Variable("MULTIPART_INVALID_QUOTING") { }
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableMultipartInvalidQuoting.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class MultipartLFLine : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableMultipartLFLine.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class MultipartMissingSemicolon : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableMultipartMissingSemicolon.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -38,7 +38,7 @@ class MultiPartName_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableMultipartName.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ class MultiPartName_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableMultipartName.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -67,7 +67,7 @@ class MultiPartName_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableMultipartName.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ class MultipartStrictError : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableMultipartStrictError.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class MultipartUnmatchedBoundary : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableMultipartUnmatchedBoundary.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class OutboundDataError : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableOutboundDataError.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class PathInfo : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variablePathInfo.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class QueryString : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableQueryString.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class RemoteAddr : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableRemoteAddr.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class RemoteHost : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableRemoteHost.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class RemotePort : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableRemotePort.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -38,14 +38,14 @@ namespace Variables {
|
||||
|
||||
void RemoteUser::evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
size_t pos;
|
||||
std::string base64;
|
||||
collection::Variable *var;
|
||||
VariableValue *var;
|
||||
std::string header;
|
||||
|
||||
std::vector<const collection::Variable *> *l2 = \
|
||||
new std::vector<const collection::Variable *>();
|
||||
std::vector<const VariableValue *> *l2 = \
|
||||
new std::vector<const VariableValue *>();
|
||||
transaction->m_variableRequestHeaders.resolve("authorization", l2);
|
||||
|
||||
if (l2->size() < 1) {
|
||||
@ -66,7 +66,7 @@ void RemoteUser::evaluate(Transaction *transaction,
|
||||
}
|
||||
transaction->m_variableRemoteUser.assign(std::string(base64, 0, pos));
|
||||
|
||||
var = new collection::Variable(&l2->at(0)->m_key,
|
||||
var = new VariableValue(&l2->at(0)->m_key,
|
||||
&transaction->m_variableRemoteUser);
|
||||
|
||||
for (auto &i : l2->at(0)->m_orign) {
|
||||
|
@ -38,7 +38,7 @@ class RemoteUser : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override;
|
||||
std::vector<const VariableValue *> *l) override;
|
||||
std::string m_retName;
|
||||
};
|
||||
|
||||
|
@ -36,7 +36,7 @@ class ReqbodyError : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableReqbodyError.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ class ReqbodyErrorMsg : public Variable {
|
||||
: Variable("REQBODY_ERROR_MSG") { }
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableReqbodyErrorMsg.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ class ReqbodyProcessor : public Variable {
|
||||
: Variable("REQBODY_PROCESSOR") { }
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableReqbodyProcessor.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class ReqbodyProcessorError : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableReqbodyProcessorError.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class ReqbodyProcessorErrorMsg : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableReqbodyProcessorErrorMsg.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -36,7 +36,7 @@ class RequestBasename : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableRequestBasename.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ class RequestBody : public Variable {
|
||||
: Variable("REQUEST_BODY") { }
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableRequestBody.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ class RequestBodyLength : public Variable {
|
||||
: Variable("REQUEST_BODY_LENGTH") { }
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableRequestBodyLength.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -38,7 +38,7 @@ class RequestCookies_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableRequestCookies.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ class RequestCookies_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableRequestCookies.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -67,7 +67,7 @@ class RequestCookies_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableRequestCookies.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class RequestCookiesNames_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableRequestCookiesNames.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ class RequestCookiesNames_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableRequestCookiesNames.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -67,7 +67,7 @@ class RequestCookiesNames_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableRequestCookiesNames.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ class RequestFilename : public Variable {
|
||||
: Variable("REQUEST_FILENAME") { }
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableRequestFilename.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -38,7 +38,7 @@ class RequestHeaders_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableRequestHeaders.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ class RequestHeaders_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableRequestHeaders.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -67,7 +67,7 @@ class RequestHeaders_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableRequestHeaders.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class RequestHeadersNames_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableRequestHeadersNames.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ class RequestHeadersNames_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableRequestHeadersNames.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -65,7 +65,7 @@ class RequestHeadersNames_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableRequestHeadersNames.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ class RequestLine : public Variable {
|
||||
: Variable("REQUEST_LINE") { }
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableRequestLine.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ class RequestMethod : public Variable {
|
||||
: Variable("REQUEST_METHOD") { }
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableRequestMethod.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ class RequestProtocol : public Variable {
|
||||
: Variable("REQUEST_PROTOCOL") { }
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableRequestProtocol.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ class RequestURI : public Variable {
|
||||
: Variable("REQUEST_URI") { }
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableRequestURI.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ class RequestURIRaw : public Variable {
|
||||
: Variable("REQUEST_URI_RAW") { }
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableRequestURIRaw.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -39,7 +39,7 @@ class Resource_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_resource_collection->resolveMultiMatches(m_dictElement,
|
||||
t->m_collections.m_resource_collection_key,
|
||||
t->m_rules->m_secWebAppId.m_value, l);
|
||||
@ -56,7 +56,7 @@ class Resource_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_resource_collection->resolveMultiMatches(m_name,
|
||||
t->m_collections.m_resource_collection_key,
|
||||
t->m_rules->m_secWebAppId.m_value, l);
|
||||
@ -73,7 +73,7 @@ class Resource_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
t->m_collections.m_resource_collection->resolveRegularExpression(
|
||||
m_dictElement, t->m_collections.m_resource_collection_key,
|
||||
t->m_rules->m_secWebAppId.m_value, l);
|
||||
@ -92,7 +92,7 @@ class Resource_DynamicElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *t,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
std::string string = m_string->evaluate(t);
|
||||
t->m_collections.m_resource_collection->resolveMultiMatches(
|
||||
string,
|
||||
|
@ -35,7 +35,7 @@ class ResponseBody : public Variable {
|
||||
: Variable("RESPONSE_BODY") { }
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableResponseBody.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ class ResponseContentLength : public Variable {
|
||||
: Variable("RESPONSE_CONTENT_LENGTH") { }
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableResponseContentLength.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ class ResponseContentType : public Variable {
|
||||
: Variable("RESPONSE_CONTENT_TYPE") { }
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) {
|
||||
std::vector<const VariableValue *> *l) {
|
||||
transaction->m_variableResponseContentType.evaluate(l);
|
||||
}
|
||||
};
|
||||
|
@ -38,7 +38,7 @@ class ResponseHeaders_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableResponseHeaders.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ class ResponseHeaders_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableResponseHeaders.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -67,7 +67,7 @@ class ResponseHeaders_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableResponseHeaders.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class ResponseHeadersNames_DictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableResponseHeadersNames.resolve(m_dictElement, l);
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ class ResponseHeadersNames_NoDictElement : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableResponseHeadersNames.resolve(l);
|
||||
}
|
||||
};
|
||||
@ -65,7 +65,7 @@ class ResponseHeadersNames_DictElementRegexp : public Variable {
|
||||
|
||||
void evaluate(Transaction *transaction,
|
||||
Rule *rule,
|
||||
std::vector<const collection::Variable *> *l) override {
|
||||
std::vector<const VariableValue *> *l) override {
|
||||
transaction->m_variableResponseHeadersNames.resolveRegularExpression(
|
||||
&m_r, l);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user