Adds first PoC for the operator offset feature

This commit is contained in:
Felipe Zimmerle 2017-01-19 14:34:48 -03:00 committed by Felipe Zimmerle
parent 9a8fc3116a
commit ecbf292f6d
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277
89 changed files with 2908 additions and 105 deletions

View File

@ -16,13 +16,15 @@
#ifdef __cplusplus #ifdef __cplusplus
#include <string> #include <string>
#include <iostream>
#include <memory>
#endif #endif
#include "modsecurity/variable_origin.h"
#ifndef HEADERS_MODSECURITY_COLLECTION_VARIABLE_H_ #ifndef HEADERS_MODSECURITY_COLLECTION_VARIABLE_H_
#define HEADERS_MODSECURITY_COLLECTION_VARIABLE_H_ #define HEADERS_MODSECURITY_COLLECTION_VARIABLE_H_
#ifndef __cplusplus #ifndef __cplusplus
typedef struct Variable_t Variable; typedef struct Variable_t Variable;
#endif #endif
@ -54,6 +56,7 @@ class Variable {
const std::string *m_value; const std::string *m_value;
bool m_dynamic_value; bool m_dynamic_value;
bool m_dynamic; bool m_dynamic;
std::list<std::unique_ptr<VariableOrigin>> m_orign;
}; };
} // namespace collection } // namespace collection

View File

@ -55,10 +55,15 @@ class Rule {
std::vector<const collection::Variable *> getFinalVars(Transaction *trasn); std::vector<const collection::Variable *> getFinalVars(Transaction *trasn);
void executeActionsAfterFullMatch(Transaction *trasn, void executeActionsAfterFullMatch(Transaction *trasn,
bool containsDisruptive, RuleMessage *ruleMessage); bool containsDisruptive, RuleMessage *ruleMessage);
std::vector<std::string *> executeSecDefaultActionTransofrmations( std::list<
std::pair<
std::unique_ptr<std::string>,
std::unique_ptr<std::string>
>
> executeSecDefaultActionTransofrmations(
Transaction *trasn, const std::string &value, bool multiMatch); Transaction *trasn, const std::string &value, bool multiMatch);
bool executeOperatorAt(Transaction *trasn, std::string key, bool executeOperatorAt(Transaction *trasn, std::string key,
std::string value); std::string value, RuleMessage *rm);
void executeActionsIndependentOfChainedRuleResult(Transaction *trasn, void executeActionsIndependentOfChainedRuleResult(Transaction *trasn,
bool *b, RuleMessage *ruleMessage); bool *b, RuleMessage *ruleMessage);
std::string resolveMatchMessage(std::string key, std::string value); std::string resolveMatchMessage(std::string key, std::string value);

View File

@ -67,6 +67,8 @@ class RuleMessage {
std::string m_rev; std::string m_rev;
int m_maturity; int m_maturity;
int m_accuracy; int m_accuracy;
std::string m_reference;
std::string m_referenceOp;
std::list<std::string> m_tags; std::list<std::string> m_tags;
std::list<std::string> m_server_logs; std::list<std::string> m_server_logs;

View File

@ -43,6 +43,7 @@ typedef struct Rules_t Rules;
#include "modsecurity/collection/collections.h" #include "modsecurity/collection/collections.h"
#include "modsecurity/collection/variable.h" #include "modsecurity/collection/variable.h"
#include "modsecurity/collection/collection.h" #include "modsecurity/collection/collection.h"
#include "modsecurity/variable_origin.h"
#define LOGFY_ADD(a, b) \ #define LOGFY_ADD(a, b) \
yajl_gen_string(g, reinterpret_cast<const unsigned char*>(a), strlen(a)); \ yajl_gen_string(g, reinterpret_cast<const unsigned char*>(a), strlen(a)); \
@ -86,36 +87,69 @@ class Operator;
} }
class VariableOriginRequest : public VariableOrigin {
public:
VariableOriginRequest()
: m_length(0),
m_offset(0) { }
std::string toText() {
#if 0
return "Variable origin was extracted straight from " \
"request/response, offset: " + std::to_string(m_offset) + \
", length: " + std::to_string(m_length) + ".";
#else
return "rr:" + std::to_string(m_offset) + "," \
+ std::to_string(m_length);
#endif
}
int m_length;
int m_offset;
};
class AnchoredVariable { class AnchoredVariable {
public: public:
AnchoredVariable(Transaction *t, std::string name) AnchoredVariable(Transaction *t, std::string name)
: m_offset(0), : m_name(""),
m_name(name),
m_transaction(t), m_transaction(t),
m_value("") { } m_value("") {
size_t m_offset; m_name.append(name);
std::string m_value; m_var = new collection::Variable(&m_name);
Transaction *m_transaction; m_var->m_dynamic = false;
std::string m_name; m_var->m_value = &m_value;
}
void set(const std::string &a, size_t offset) { void set(const std::string &a, size_t offset) {
m_value = a; std::unique_ptr<VariableOriginRequest> origin (new VariableOriginRequest());
m_offset = offset; m_offset = offset;
m_value.assign(a.c_str(), a.size());
origin->m_offset = offset;
origin->m_length = m_value.size();
m_var->m_orign.push_back(std::move(origin));
} }
void append(const std::string &a, size_t offset, void append(const std::string &a, size_t offset,
bool spaceSeparator = false) { bool spaceSeparator = false) {
std::unique_ptr<VariableOriginRequest> origin (new VariableOriginRequest());
if (spaceSeparator && !m_value.empty()) { if (spaceSeparator && !m_value.empty()) {
m_value.append(" " + a); m_value.append(" " + a);
} else { } else {
m_value.append(a); m_value.append(a);
} }
m_offset = offset; m_offset = offset;
origin->m_offset = offset;
origin->m_length = a.size();
m_var->m_orign.push_back(std::move(origin));
} }
void evaluate(std::vector<const collection::Variable *> *l) { void evaluate(std::vector<const collection::Variable *> *l) {
l->push_back(new collection::Variable(&m_name, if (m_name.empty() || m_var->m_key == NULL
&m_value)); || m_var->m_value == NULL || m_var->m_key->empty()) {
return;
}
l->push_back(m_var);
} }
std::string *evaluate() { std::string *evaluate() {
@ -124,6 +158,12 @@ class AnchoredVariable {
} }
return &m_value; return &m_value;
} }
int m_offset;
std::string m_value;
Transaction *m_transaction;
std::string m_name;
collection::Variable *m_var;
}; };
@ -310,8 +350,9 @@ class Transaction : public TransactionAnchoredVariables {
bool intervention(ModSecurityIntervention *it); bool intervention(ModSecurityIntervention *it);
bool addArgument(const std::string& orig, const std::string& key, bool addArgument(const std::string& orig, const std::string& key,
const std::string& value); const std::string& value, size_t offset);
bool extractArguments(const std::string &orig, const std::string& buf); bool extractArguments(const std::string &orig, const std::string& buf,
size_t offset);
const char *getResponseBody(); const char *getResponseBody();
int getResponseBodyLenth(); int getResponseBodyLenth();

View File

@ -0,0 +1,46 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#ifdef __cplusplus
#include <string>
#endif
#ifndef HEADERS_MODSECURITY_VARIABLE_ORIGIN_H_
#define HEADERS_MODSECURITY_VARIABLE_ORIGIN_H_
#ifndef __cplusplus
typedef struct DebugLog_t DebugLog;
#endif
#ifdef __cplusplus
namespace modsecurity {
/** @ingroup ModSecurity_CPP_API */
class VariableOrigin {
public:
VariableOrigin() { }
virtual std::string toText() = 0;
};
} // namespace modsecurity
#endif
#endif // HEADERS_MODSECURITY_VARIABLE_ORIGIN_H_

View File

@ -24,7 +24,8 @@ namespace modsecurity {
namespace operators { namespace operators {
bool BeginsWith::evaluate(Transaction *transaction, const std::string &str) { bool BeginsWith::evaluate(Transaction *transaction, Rule *rule,
const std::string &str, RuleMessage *ruleMessage) {
bool ret = false; bool ret = false;
std::string p = MacroExpansion::expand(m_param, transaction); std::string p = MacroExpansion::expand(m_param, transaction);
@ -32,6 +33,7 @@ bool BeginsWith::evaluate(Transaction *transaction, const std::string &str) {
if (str.size() < p.size()) { if (str.size() < p.size()) {
ret = false; ret = false;
} else if (!str.compare(0, p.size(), p)) { } else if (!str.compare(0, p.size(), p)) {
logOffset(ruleMessage, 0, p.size());
ret = true; ret = true;
} }

View File

@ -32,7 +32,8 @@ class BeginsWith : public Operator {
explicit BeginsWith(std::string param) explicit BeginsWith(std::string param)
: Operator("BeginsWith", param) { } : Operator("BeginsWith", param) { }
bool evaluate(Transaction *transaction, const std::string &str) override; bool evaluate(Transaction *transaction, Rule *rule, const std::string &str,
RuleMessage *ruleMessage) override;
}; };
} // namespace operators } // namespace operators

View File

@ -22,11 +22,15 @@
namespace modsecurity { namespace modsecurity {
namespace operators { namespace operators {
bool Contains::evaluate(Transaction *transaction, const std::string &input) { bool Contains::evaluate(Transaction *transaction, Rule *rule,
const std::string &input, RuleMessage *ruleMessage) {
std::string p = MacroExpansion::expand(m_param, transaction); std::string p = MacroExpansion::expand(m_param, transaction);
bool contains = input.find(p) != std::string::npos; size_t offset = input.find(p);
bool contains = offset != std::string::npos;
if (contains && transaction) { if (contains && transaction) {
logOffset(ruleMessage, offset, p.size());
transaction->m_matched.push_back(p); transaction->m_matched.push_back(p);
} }

View File

@ -20,6 +20,7 @@
#include <list> #include <list>
#include "modsecurity/transaction.h" #include "modsecurity/transaction.h"
#include "modsecurity/rule_message.h"
#include "src/operators/operator.h" #include "src/operators/operator.h"
@ -33,7 +34,8 @@ class Contains : public Operator {
: Operator(op, param, negation) { } : Operator(op, param, negation) { }
explicit Contains(std::string param) explicit Contains(std::string param)
: Operator("Contains", param) { } : Operator("Contains", param) { }
bool evaluate(Transaction *transaction, const std::string &exp) override; bool evaluate(Transaction *transaction, Rule *rule,
const std::string &str, RuleMessage *ruleMessage) override;
}; };
} // namespace operators } // namespace operators

View File

@ -19,6 +19,7 @@
#include "src/operators/operator.h" #include "src/operators/operator.h"
#include "src/macro_expansion.h" #include "src/macro_expansion.h"
#include "modsecurity/rule_message.h"
namespace modsecurity { namespace modsecurity {
namespace operators { namespace operators {
@ -36,8 +37,8 @@ bool ContainsWord::acceptableChar(const std::string& a, size_t pos) {
return true; return true;
} }
bool ContainsWord::evaluate(Transaction *transaction, bool ContainsWord::evaluate(Transaction *transaction, Rule *rule,
const std::string& input) { const std::string &input, RuleMessage *ruleMessage) {
std::string paramTarget = MacroExpansion::expand(m_param, transaction); std::string paramTarget = MacroExpansion::expand(m_param, transaction);
if (paramTarget.empty()) { if (paramTarget.empty()) {
@ -53,14 +54,17 @@ bool ContainsWord::evaluate(Transaction *transaction,
size_t pos = input.find(paramTarget); size_t pos = input.find(paramTarget);
while (pos != std::string::npos) { while (pos != std::string::npos) {
if (pos == 0 && acceptableChar(input, paramTarget.size())) { if (pos == 0 && acceptableChar(input, paramTarget.size())) {
logOffset(ruleMessage, 0, paramTarget.size());
return true; return true;
} }
if (pos + paramTarget.size() == input.size() && if (pos + paramTarget.size() == input.size() &&
acceptableChar(input, pos - 1)) { acceptableChar(input, pos - 1)) {
logOffset(ruleMessage, pos, paramTarget.size());
return true; return true;
} }
if (acceptableChar(input, pos - 1) && if (acceptableChar(input, pos - 1) &&
acceptableChar(input, pos + paramTarget.size())) { acceptableChar(input, pos + paramTarget.size())) {
logOffset(ruleMessage, pos, paramTarget.size());
return true; return true;
} }
pos = input.find(paramTarget, pos + 1); pos = input.find(paramTarget, pos + 1);

View File

@ -19,7 +19,7 @@
#include <string> #include <string>
#include "src/operators/operator.h" #include "src/operators/operator.h"
#include "modsecurity/rule_message.h"
namespace modsecurity { namespace modsecurity {
namespace operators { namespace operators {
@ -31,7 +31,8 @@ class ContainsWord : public Operator {
: Operator(op, param, negation) { } : Operator(op, param, negation) { }
explicit ContainsWord(std::string param) explicit ContainsWord(std::string param)
: Operator("ContainsWord", param) { } : Operator("ContainsWord", param) { }
bool evaluate(Transaction *transaction, const std::string &str); bool evaluate(Transaction *transaction, Rule *rule,
const std::string &str, RuleMessage *ruleMessage) override;
bool acceptableChar(const std::string& a, size_t pos); bool acceptableChar(const std::string& a, size_t pos);
}; };

View File

@ -24,13 +24,18 @@ namespace modsecurity {
namespace operators { namespace operators {
bool EndsWith::evaluate(Transaction *transaction, const std::string &input) { bool EndsWith::evaluate(Transaction *transaction, Rule *rule,
const std::string &input, RuleMessage *ruleMessage) {
bool ret = false; bool ret = false;
std::string p = MacroExpansion::expand(m_param, transaction); std::string p = MacroExpansion::expand(m_param, transaction);
if (input.length() >= p.length()) { if (input.length() >= p.length()) {
ret = (0 == input.compare(input.length() - p.length(), ret = (0 == input.compare(input.length() - p.length(),
p.length(), p)); p.length(), p));
if (ret) {
logOffset(ruleMessage, input.length() - p.length(),
p.size());
}
} }
return ret; return ret;

View File

@ -31,7 +31,8 @@ class EndsWith : public Operator {
: Operator(op, param, negation) { } : Operator(op, param, negation) { }
explicit EndsWith(std::string param) explicit EndsWith(std::string param)
: Operator("EndsWith", param) { } : Operator("EndsWith", param) { }
bool evaluate(Transaction *transaction, const std::string &str) override; bool evaluate(Transaction *transaction, Rule *rule,
const std::string &str, RuleMessage *ruleMessage) override;
}; };

View File

@ -74,6 +74,16 @@ bool Operator::debug(Transaction *transaction, int x, std::string a) {
return true; return true;
} }
bool Operator::evaluateInternal(Transaction *transaction,
Rule *rule, const std::string& a, RuleMessage *rm) {
bool res = evaluate(transaction, rule, a, rm);
if (m_negation) {
return !res;
}
return res;
}
bool Operator::evaluateInternal(Transaction *transaction, bool Operator::evaluateInternal(Transaction *transaction,
Rule *rule, const std::string& a) { Rule *rule, const std::string& a) {

View File

@ -20,7 +20,7 @@
#include "modsecurity/transaction.h" #include "modsecurity/transaction.h"
#include "modsecurity/rule.h" #include "modsecurity/rule.h"
#include "modsecurity/rule_message.h"
namespace modsecurity { namespace modsecurity {
namespace operators { namespace operators {
@ -62,12 +62,30 @@ class Operator {
bool evaluateInternal(Transaction *t, const std::string& a); bool evaluateInternal(Transaction *t, const std::string& a);
bool evaluateInternal(Transaction *t, Rule *rule, bool evaluateInternal(Transaction *t, Rule *rule,
const std::string& a); const std::string& a);
bool evaluateInternal(Transaction *t, Rule *rule,
const std::string& a, RuleMessage *ruleMessage);
virtual bool evaluate(Transaction *transaction, const std::string &str); virtual bool evaluate(Transaction *transaction, const std::string &str);
virtual bool evaluate(Transaction *transaction, Rule *rule, virtual bool evaluate(Transaction *transaction, Rule *rule,
const std::string &str) { const std::string &str) {
return evaluate(transaction, str); return evaluate(transaction, str);
} }
virtual bool evaluate(Transaction *transaction, Rule *rule,
const std::string &str, RuleMessage *ruleMessage) {
return evaluate(transaction, str);
}
static void logOffset(RuleMessage *ruleMessage, int offset, int len) {
if (ruleMessage) {
if (ruleMessage->m_reference.empty() == false) {
ruleMessage->m_reference.append(";");
}
ruleMessage->m_reference.append("op:"
+ std::to_string(offset) + ","
+ std::to_string(len));
}
}
std::string m_match_message; std::string m_match_message;
bool m_negation; bool m_negation;

View File

@ -79,7 +79,7 @@ void Pm::postOrderTraversal(acmp_btree_node_t *node) {
bool Pm::evaluate(Transaction *transaction, Rule *rule, bool Pm::evaluate(Transaction *transaction, Rule *rule,
const std::string &input) { const std::string &input, RuleMessage *ruleMessage) {
int rc = 0; int rc = 0;
ACMPT pt; ACMPT pt;
pt.parser = m_p; pt.parser = m_p;
@ -89,7 +89,8 @@ bool Pm::evaluate(Transaction *transaction, Rule *rule,
rc = acmp_process_quick(&pt, &match, input.c_str(), input.length()); rc = acmp_process_quick(&pt, &match, input.c_str(), input.length());
bool capture = rule && rule->getActionsByName("capture").size() > 0; bool capture = rule && rule->getActionsByName("capture").size() > 0;
if (rc == 1 && transaction) { if (rc > 0 && transaction) {
logOffset(ruleMessage, rc, input.size());
transaction->m_matched.push_back(std::string(match)); transaction->m_matched.push_back(std::string(match));
} }
@ -100,7 +101,7 @@ bool Pm::evaluate(Transaction *transaction, Rule *rule,
std::string(match)); std::string(match));
} }
return rc == 1; return rc > 0;
} }

View File

@ -44,11 +44,8 @@ class Pm : public Operator {
} }
~Pm(); ~Pm();
bool evaluate(Transaction *transaction, Rule *rule, bool evaluate(Transaction *transaction, Rule *rule,
const std::string &input) override; const std::string &str, RuleMessage *ruleMessage) override;
bool evaluate(Transaction *transaction,
const std::string &input) override {
return evaluate(transaction, NULL, input);
}
bool init(const std::string &file, std::string *error) override; bool init(const std::string &file, std::string *error) override;
void postOrderTraversal(acmp_btree_node_t *node); void postOrderTraversal(acmp_btree_node_t *node);

View File

@ -21,6 +21,7 @@
#include "src/operators/operator.h" #include "src/operators/operator.h"
#include "src/macro_expansion.h" #include "src/macro_expansion.h"
#include "modsecurity/rule.h" #include "modsecurity/rule.h"
#include "modsecurity/rule_message.h"
namespace modsecurity { namespace modsecurity {
namespace operators { namespace operators {
@ -28,7 +29,7 @@ namespace operators {
bool Rx::evaluate(Transaction *transaction, Rule *rule, bool Rx::evaluate(Transaction *transaction, Rule *rule,
const std::string& input) { const std::string& input, RuleMessage *ruleMessage) {
SMatch match; SMatch match;
std::list<SMatch> matches; std::list<SMatch> matches;
@ -50,6 +51,10 @@ bool Rx::evaluate(Transaction *transaction, Rule *rule,
} }
} }
for (const auto & i : matches) {
logOffset(ruleMessage, i.m_offset, i.m_length);
}
if (matches.size() > 0) { if (matches.size() > 0) {
return true; return true;
} }

View File

@ -51,11 +51,15 @@ class Rx : public Operator {
delete m_re; delete m_re;
} }
bool evaluate(Transaction *transaction, Rule *rule, bool evaluate(Transaction *transaction, Rule *rule,
const std::string &input) override; const std::string &input) override {
return evaluate(transaction, NULL, input, NULL);
}
bool evaluate(Transaction *transaction, bool evaluate(Transaction *transaction,
const std::string &input) override { const std::string &input) override {
return evaluate(transaction, NULL, input); return evaluate(transaction, NULL, input);
} }
bool evaluate(Transaction *transaction, Rule *rule,
const std::string& input, RuleMessage *ruleMessage) override;
private: private:
Regex *m_re; Regex *m_re;

View File

@ -109,8 +109,8 @@ bool ValidateByteRange::init(const std::string &file,
} }
bool ValidateByteRange::evaluate(Transaction *transaction, bool ValidateByteRange::evaluate(Transaction *transaction, Rule *rule,
const std::string &input) { const std::string &input, RuleMessage *ruleMessage) {
bool ret = true; bool ret = true;
size_t count = 0; size_t count = 0;
@ -119,6 +119,7 @@ bool ValidateByteRange::evaluate(Transaction *transaction,
if (!(table[x >> 3] & (1 << (x & 0x7)))) { if (!(table[x >> 3] & (1 << (x & 0x7)))) {
// debug(9, "Value " + std::to_string(x) + " in " + // debug(9, "Value " + std::to_string(x) + " in " +
// input + " ouside range: " + param); // input + " ouside range: " + param);
logOffset(ruleMessage, i, 1);
count++; count++;
} }
} }

View File

@ -39,7 +39,8 @@ class ValidateByteRange : public Operator {
} }
~ValidateByteRange() override { } ~ValidateByteRange() override { }
bool evaluate(Transaction *transaction, const std::string &input) override; bool evaluate(Transaction *transaction, Rule *rule,
const std::string &input, RuleMessage *ruleMessage) override;
bool getRange(const std::string &rangeRepresentation, std::string *error); bool getRange(const std::string &rangeRepresentation, std::string *error);
bool init(const std::string& file, std::string *error) override; bool init(const std::string& file, std::string *error) override;
private: private:

View File

@ -24,8 +24,9 @@ namespace operators {
int ValidateUrlEncoding::validate_url_encoding(const char *input, int ValidateUrlEncoding::validate_url_encoding(const char *input,
uint64_t input_length) { uint64_t input_length, size_t *offset) {
int i; int i;
*offset = 0;
if ((input == NULL) || (input_length <= 0)) { if ((input == NULL) || (input_length <= 0)) {
return -1; return -1;
@ -35,6 +36,7 @@ int ValidateUrlEncoding::validate_url_encoding(const char *input,
while (i < input_length) { while (i < input_length) {
if (input[i] == '%') { if (input[i] == '%') {
if (i + 2 >= input_length) { if (i + 2 >= input_length) {
*offset = i;
/* Not enough bytes. */ /* Not enough bytes. */
return -3; return -3;
} else { } else {
@ -53,6 +55,7 @@ int ValidateUrlEncoding::validate_url_encoding(const char *input,
i += 3; i += 3;
} else { } else {
/* Non-hexadecimal characters used in encoding. */ /* Non-hexadecimal characters used in encoding. */
*offset = i;
return -2; return -2;
} }
} }
@ -65,15 +68,16 @@ int ValidateUrlEncoding::validate_url_encoding(const char *input,
} }
bool ValidateUrlEncoding::evaluate(Transaction *transaction, bool ValidateUrlEncoding::evaluate(Transaction *transaction, Rule *rule,
const std::string &input) { const std::string &input, RuleMessage *ruleMessage) {
size_t offset = 0;
bool res = false; bool res = false;
if (input.empty() == true) { if (input.empty() == true) {
return res; return res;
} }
int rc = validate_url_encoding(input.c_str(), input.size()); int rc = validate_url_encoding(input.c_str(), input.size(), &offset);
switch (rc) { switch (rc) {
case 1 : case 1 :
/* Encoding is valid */ /* Encoding is valid */
@ -90,6 +94,7 @@ bool ValidateUrlEncoding::evaluate(Transaction *transaction,
transaction->debug(7, "Invalid URL Encoding: Non-hexadecimal " transaction->debug(7, "Invalid URL Encoding: Non-hexadecimal "
"digits used at '" + input + "'"); "digits used at '" + input + "'");
#endif #endif
logOffset(ruleMessage, offset, input.size());
} }
res = true; /* Invalid match. */ res = true; /* Invalid match. */
break; break;
@ -99,6 +104,7 @@ bool ValidateUrlEncoding::evaluate(Transaction *transaction,
transaction->debug(7, "Invalid URL Encoding: Not enough " \ transaction->debug(7, "Invalid URL Encoding: Not enough " \
"characters at the end of input at '" + input + "'"); "characters at the end of input at '" + input + "'");
#endif #endif
logOffset(ruleMessage, offset, input.size());
} }
res = true; /* Invalid match. */ res = true; /* Invalid match. */
break; break;
@ -110,6 +116,7 @@ bool ValidateUrlEncoding::evaluate(Transaction *transaction,
"Error (rc = " + std::to_string(rc) + ") at '" + "Error (rc = " + std::to_string(rc) + ") at '" +
input + "'"); input + "'");
#endif #endif
logOffset(ruleMessage, offset, input.size());
} }
res = true; res = true;
break; break;

View File

@ -32,8 +32,10 @@ class ValidateUrlEncoding : public Operator {
ValidateUrlEncoding() ValidateUrlEncoding()
: Operator("ValidateUrlEncoding") { } : Operator("ValidateUrlEncoding") { }
bool evaluate(Transaction *transaction, const std::string &input) override; bool evaluate(Transaction *transaction, Rule *rule,
int validate_url_encoding(const char *input, uint64_t input_length); const std::string &input, RuleMessage *ruleMessage) override;
int validate_url_encoding(const char *input, uint64_t input_length,
size_t *offset);
}; };
} // namespace operators } // namespace operators

View File

@ -113,8 +113,8 @@ int ValidateUtf8Encoding::detect_utf8_character(
return unicode_len; return unicode_len;
} }
bool ValidateUtf8Encoding::evaluate(Transaction *transaction, bool ValidateUtf8Encoding::evaluate(Transaction *transaction, Rule *rule,
const std::string &str) { const std::string &str, RuleMessage *ruleMessage) {
unsigned int i, bytes_left; unsigned int i, bytes_left;
const char *str_c = str.c_str(); const char *str_c = str.c_str();
@ -143,6 +143,7 @@ bool ValidateUtf8Encoding::evaluate(Transaction *transaction,
"at " + str + ". [offset \"" + "at " + str + ". [offset \"" +
std::to_string(i) + "\"]"); std::to_string(i) + "\"]");
#endif #endif
logOffset(ruleMessage, i, str.size());
} }
return true; return true;
break; break;
@ -154,6 +155,7 @@ bool ValidateUtf8Encoding::evaluate(Transaction *transaction,
"at " + str + ". [offset \"" + "at " + str + ". [offset \"" +
std::to_string(i) + "\"]"); std::to_string(i) + "\"]");
#endif #endif
logOffset(ruleMessage, i, str.size());
} }
return true; return true;
break; break;
@ -165,6 +167,7 @@ bool ValidateUtf8Encoding::evaluate(Transaction *transaction,
"at " + str + ". [offset \"" + "at " + str + ". [offset \"" +
std::to_string(i) + "\"]"); std::to_string(i) + "\"]");
#endif #endif
logOffset(ruleMessage, i, str.size());
} }
return true; return true;
break; break;
@ -175,6 +178,7 @@ bool ValidateUtf8Encoding::evaluate(Transaction *transaction,
"at " + str + ". [offset \"" + "at " + str + ". [offset \"" +
std::to_string(i) + "\"]"); std::to_string(i) + "\"]");
#endif #endif
logOffset(ruleMessage, i, str.size());
} }
return true; return true;
break; break;
@ -187,6 +191,7 @@ bool ValidateUtf8Encoding::evaluate(Transaction *transaction,
"at " + str + ". [offset \"" + "at " + str + ". [offset \"" +
std::to_string(i) + "\"]"); std::to_string(i) + "\"]");
#endif #endif
logOffset(ruleMessage, i, str.size());
} }
return true; return true;
} }

View File

@ -39,7 +39,8 @@ class ValidateUtf8Encoding : public Operator {
ValidateUtf8Encoding() ValidateUtf8Encoding()
: Operator("ValidateUtf8Encoding") { } : Operator("ValidateUtf8Encoding") { }
bool evaluate(Transaction *transaction, const std::string &input) override; bool evaluate(Transaction *transaction, Rule *rule,
const std::string &str, RuleMessage *ruleMessage) override;
int detect_utf8_character(const unsigned char *p_read, int detect_utf8_character(const unsigned char *p_read,
unsigned int length); unsigned int length);

View File

@ -24,15 +24,21 @@ namespace modsecurity {
namespace operators { namespace operators {
bool Within::evaluate(Transaction *transaction, const std::string &str) { bool Within::evaluate(Transaction *transaction, Rule *rule,
const std::string &str, RuleMessage *ruleMessage) {
bool res = false; bool res = false;
std::string paramTarget = MacroExpansion::expand(m_param, transaction); std::string paramTarget = MacroExpansion::expand(m_param, transaction);
size_t pos = 0;
if (str.empty()) { if (str.empty()) {
return true; return true;
} }
res = paramTarget.find(str) != std::string::npos; pos = paramTarget.find(str);
res = pos != std::string::npos;
if (res) {
logOffset(ruleMessage, pos, str.size());
}
return res; return res;
} }

View File

@ -31,7 +31,8 @@ class Within : public Operator {
: Operator(op, param, negation) { } : Operator(op, param, negation) { }
explicit Within(std::string param) explicit Within(std::string param)
: Operator("Within", param) { } : Operator("Within", param) { }
bool evaluate(Transaction *transaction, const std::string &str); bool evaluate(Transaction *transaction, Rule *rule,
const std::string &str, RuleMessage *ruleMessage);
}; };
} // namespace operators } // namespace operators

View File

@ -178,10 +178,10 @@ int JSON::addArgument(const std::string& value) {
} }
if (m_data.prefix.empty()) { if (m_data.prefix.empty()) {
m_transaction->addArgument("JSON", m_data.current_key, value); m_transaction->addArgument("JSON", m_data.current_key, value, 0);
} else { } else {
m_transaction->addArgument("JSON", m_data.prefix + "." + \ m_transaction->addArgument("JSON", m_data.prefix + "." + \
m_data.current_key, value); m_data.current_key, value, 0);
} }
return 1; return 1;

View File

@ -182,8 +182,8 @@ void Rule::updateMatchedVars(Transaction *trasn, std::string key,
void Rule::cleanMatchedVars(Transaction *trasn) { void Rule::cleanMatchedVars(Transaction *trasn) {
trasn->debug(4, "Matched vars cleaned."); trasn->debug(4, "Matched vars cleaned.");
trasn->m_collections.storeOrUpdateFirst("MATCHED_VAR", "");
trasn->m_variableMatchedVar.set("", trasn->m_variableOffset); trasn->m_variableMatchedVar.set("", trasn->m_variableOffset);
trasn->m_variableMatchedVarName.set("", trasn->m_variableOffset);
trasn->m_collections.del("MATCHED_VARS_NAME"); trasn->m_collections.del("MATCHED_VARS_NAME");
trasn->m_collections.del("MATCHED_VARS"); trasn->m_collections.del("MATCHED_VARS");
trasn->m_collections.del("MATCHED_VARS_NAMES"); trasn->m_collections.del("MATCHED_VARS_NAMES");
@ -256,7 +256,7 @@ void Rule::executeActionsIndependentOfChainedRuleResult(Transaction *trasn,
bool Rule::executeOperatorAt(Transaction *trasn, std::string key, bool Rule::executeOperatorAt(Transaction *trasn, std::string key,
std::string value) { std::string value, RuleMessage *ruleMessage) {
#if MSC_EXEC_CLOCK_ENABLED #if MSC_EXEC_CLOCK_ENABLED
clock_t begin = clock(); clock_t begin = clock();
clock_t end; clock_t end;
@ -268,7 +268,7 @@ bool Rule::executeOperatorAt(Transaction *trasn, std::string key,
utils::string::toHexIfNeeded(value)) \ utils::string::toHexIfNeeded(value)) \
+ "\" (Variable: " + key + ")"); + "\" (Variable: " + key + ")");
ret = this->op->evaluateInternal(trasn, this, value); ret = this->op->evaluateInternal(trasn, this, value, ruleMessage);
if (ret == false) { if (ret == false) {
return false; return false;
} }
@ -285,19 +285,32 @@ bool Rule::executeOperatorAt(Transaction *trasn, std::string key,
// FIXME: this should be a list instead of a vector, keeping the but // FIXME: this should be a list instead of a vector, keeping the but
// of v2 alive. // of v2 alive.
std::vector<std::string *> Rule::executeSecDefaultActionTransofrmations( std::list<std::pair<std::unique_ptr<std::string>,
std::unique_ptr<std::string>>>
Rule::executeSecDefaultActionTransofrmations(
Transaction *trasn, const std::string &in, bool multiMatch) { Transaction *trasn, const std::string &in, bool multiMatch) {
int none = 0; int none = 0;
int transformations = 0; int transformations = 0;
std::vector<std::string *> ret;
std::string *value = new std::string(in); std::list<std::pair<std::unique_ptr<std::string>,
std::string *newValue = NULL; std::unique_ptr<std::string>>> ret;
std::unique_ptr<std::string> value =
std::unique_ptr<std::string>(new std::string(in));
std::unique_ptr<std::string> newValue;
std::unique_ptr<std::string> trans =
std::unique_ptr<std::string>(new std::string());
if (multiMatch == true) { if (multiMatch == true) {
ret.push_back(value); ret.push_back(std::make_pair(
ret.push_back(value); std::move(value),
std::move(trans)));
ret.push_back(std::make_pair(
std::move(value),
std::move(trans)));
} }
for (Action *a : this->m_actionsRuntimePre) { for (Action *a : this->m_actionsRuntimePre) {
@ -313,18 +326,21 @@ std::vector<std::string *> Rule::executeSecDefaultActionTransofrmations(
for (Action *a : trasn->m_rules->m_defaultActions[this->phase]) { for (Action *a : trasn->m_rules->m_defaultActions[this->phase]) {
if (a->action_kind \ if (a->action_kind \
== actions::Action::RunTimeBeforeMatchAttemptKind) { == actions::Action::RunTimeBeforeMatchAttemptKind) {
newValue = new std::string(a->evaluate(*value, trasn)); newValue = std::unique_ptr<std::string>(new std::string(a->evaluate(*value, trasn)));
if (multiMatch == true) { if (multiMatch == true) {
if (*newValue != *value) { if (*newValue != *value) {
ret.push_back(newValue); ret.push_back(std::make_pair(
} else { std::move(newValue),
delete value; std::move(trans)));
} }
} else {
delete value;
} }
value = newValue; value = std::move(newValue);
if (trans->empty()) {
trans->append(a->m_name);
} else {
trans->append("," + a->m_name);
}
trasn->debug(9, "(SecDefaultAction) T (" + \ trasn->debug(9, "(SecDefaultAction) T (" + \
std::to_string(transformations) + ") " + \ std::to_string(transformations) + ") " + \
a->m_name + ": \"" + \ a->m_name + ": \"" + \
@ -336,28 +352,29 @@ std::vector<std::string *> Rule::executeSecDefaultActionTransofrmations(
} }
for (Action *a : this->m_actionsRuntimePre) { for (Action *a : this->m_actionsRuntimePre) {
if (none == 0) { if (none == 0) {
newValue = new std::string(a->evaluate(*value, trasn)); newValue = std::unique_ptr<std::string>(new std::string(a->evaluate(*value, trasn)));
if (multiMatch == true) { if (multiMatch == true) {
if (*value != *newValue) { if (*value != *newValue) {
ret.push_back(newValue); ret.push_back(std::make_pair(
value = newValue; std::move(newValue),
} else { std::move(trans)));
delete value; value = std::move(newValue);
} }
} else {
delete value;
} }
value = newValue; value = std::move(newValue);
trasn->debug(9, " T (" + \ trasn->debug(9, " T (" + \
std::to_string(transformations) + ") " + \ std::to_string(transformations) + ") " + \
a->m_name + ": \"" + \ a->m_name + ": \"" + \
utils::string::limitTo(80, *value) + "\""); utils::string::limitTo(80, *value) + "\"");
if (trans->empty()) {
trans->append(a->m_name);
} else {
trans->append("," + a->m_name);
}
transformations++; transformations++;
} }
if (a->m_isNone) { if (a->m_isNone) {
@ -366,15 +383,18 @@ std::vector<std::string *> Rule::executeSecDefaultActionTransofrmations(
} }
if (multiMatch == true) { if (multiMatch == true) {
// v2 checks the last entry twice. Don't know why. // v2 checks the last entry twice. Don't know why.
ret.push_back(ret.back()); ret.push_back(std::move(ret.back()));
trasn->debug(9, "multiMatch is enabled. " \ trasn->debug(9, "multiMatch is enabled. " \
+ std::to_string(ret.size()) + \ + std::to_string(ret.size()) + \
" values to be tested."); " values to be tested.");
for (const std::string *a : ret) { //for (const std::string *a : ret) {
trasn->debug(9, " - " + *a); // trasn->debug(9, " - " + *a);
} //}
} else { } else {
ret.push_back(value); ret.push_back(std::make_pair(
std::move(value),
std::move(trans)));
} }
return ret; return ret;
@ -592,24 +612,34 @@ bool Rule::evaluate(Transaction *trasn) {
const std::string value = *(v->m_value); const std::string value = *(v->m_value);
const std::string key = *(v->m_key); const std::string key = *(v->m_key);
std::vector<std::string *> values; std::list<std::pair<std::unique_ptr<std::string>,
std::unique_ptr<std::string>>> values;
bool multiMatch = getActionsByName("multimatch").size() > 0; bool multiMatch = getActionsByName("multimatch").size() > 0;
values = executeSecDefaultActionTransofrmations(trasn, value, values = executeSecDefaultActionTransofrmations(trasn, value,
multiMatch); multiMatch);
for (const auto &valueTemp : values) {
for (const std::string *valueTemp : values) {
bool ret; bool ret;
std::string valueAfterTrans = std::move(*valueTemp.first);
ret = executeOperatorAt(trasn, key, valueAfterTrans, &ruleMessage);
ret = executeOperatorAt(trasn, key, *valueTemp);
if (ret == true) { if (ret == true) {
ruleMessage.m_match = resolveMatchMessage(key, value); ruleMessage.m_match = resolveMatchMessage(key, value);
for (auto &i : v->m_orign) {
if (ruleMessage.m_reference.empty()) {
ruleMessage.m_reference.append(i->toText());
} else {
ruleMessage.m_reference.append(";" + i->toText());
}
}
ruleMessage.m_reference.append("-" + *valueTemp.second);
updateMatchedVars(trasn, key, value); updateMatchedVars(trasn, key, value);
executeActionsIndependentOfChainedRuleResult(trasn, executeActionsIndependentOfChainedRuleResult(trasn,
&containsDisruptive, &ruleMessage); &containsDisruptive, &ruleMessage);
globalRet = true; globalRet = true;
} }
delete valueTemp;
} }
} }

View File

@ -49,6 +49,7 @@ std::string RuleMessage::disruptiveErrorLog(Transaction *trans,
+ "\"]"); + "\"]");
msg.append(" [uri \"" + trans->m_uri_no_query_string_decoded + "\"]"); msg.append(" [uri \"" + trans->m_uri_no_query_string_decoded + "\"]");
msg.append(" [unique_id \"" + trans->m_id + "\"]"); msg.append(" [unique_id \"" + trans->m_id + "\"]");
msg.append(" [ref \"" + m_reference + "\"]");
return modsecurity::utils::string::toHexIfNeeded(msg); return modsecurity::utils::string::toHexIfNeeded(msg);
} }
@ -73,6 +74,7 @@ std::string RuleMessage::noClientErrorLog(Transaction *trans) {
for (auto &a : m_tags) { for (auto &a : m_tags) {
msg.append(" [tag \"" + a + "\"]"); msg.append(" [tag \"" + a + "\"]");
} }
msg.append(" [ref \"" + m_reference + "\"]");
return modsecurity::utils::string::toHexIfNeeded(msg); return modsecurity::utils::string::toHexIfNeeded(msg);
} }

View File

@ -224,7 +224,7 @@ int Transaction::processConnection(const char *client, int cPort,
bool Transaction::extractArguments(const std::string &orig, bool Transaction::extractArguments(const std::string &orig,
const std::string& buf) { const std::string& buf, size_t offset) {
char sep1 = '&'; char sep1 = '&';
std::vector<std::string> key_value_sets = utils::string::split(buf, sep1); std::vector<std::string> key_value_sets = utils::string::split(buf, sep1);
@ -270,7 +270,8 @@ bool Transaction::extractArguments(const std::string &orig,
} }
addArgument(orig, std::string(reinterpret_cast<char *>(key_c), key_s-1), addArgument(orig, std::string(reinterpret_cast<char *>(key_c), key_s-1),
std::string(reinterpret_cast<char *>(value_c), value_s-1)); std::string(reinterpret_cast<char *>(value_c), value_s-1), offset);
offset = offset + t.size() + 1;
free(key_c); free(key_c);
free(value_c); free(value_c);
@ -281,7 +282,7 @@ bool Transaction::extractArguments(const std::string &orig,
bool Transaction::addArgument(const std::string& orig, const std::string& key, bool Transaction::addArgument(const std::string& orig, const std::string& key,
const std::string& value) { const std::string& value, size_t offset) {
debug(4, "Adding request argument (" + orig + "): name \"" + \ debug(4, "Adding request argument (" + orig + "): name \"" + \
key + "\", value \"" + value + "\""); key + "\", value \"" + value + "\"");
@ -289,12 +290,12 @@ bool Transaction::addArgument(const std::string& orig, const std::string& key,
if (orig == "GET") { if (orig == "GET") {
m_collections.store("ARGS_GET:" + key, value); m_collections.store("ARGS_GET:" + key, value);
m_variableArgGetNames.append(key, 0, true); m_variableArgGetNames.append(key, offset, true);
} else if (orig == "POST") { } else if (orig == "POST") {
m_collections.store("ARGS_POST:" + key, value); m_collections.store("ARGS_POST:" + key, value);
m_variableArgPostNames.append(key, 0, true); m_variableArgPostNames.append(key, offset, true);
} }
m_variableArgsNames.append(key, 0, true); m_variableArgsNames.append(key, offset, true);
m_ARGScombinedSizeDouble = m_ARGScombinedSizeDouble + \ m_ARGScombinedSizeDouble = m_ARGScombinedSizeDouble + \
key.length() + value.length(); key.length() + value.length();
@ -346,6 +347,7 @@ int Transaction::processURI(const char *uri, const char *method,
m_variableRequestLine.set(std::string(method) + " " + std::string(uri) m_variableRequestLine.set(std::string(method) + " " + std::string(uri)
+ " HTTP/" + std::string(http_version), m_variableOffset); + " HTTP/" + std::string(http_version), m_variableOffset);
m_variableOffset = m_variableRequestLine.m_value.size();
if (pos != std::string::npos) { if (pos != std::string::npos) {
m_uri_no_query_string_decoded = std::string(m_uri_decoded, 0, pos); m_uri_no_query_string_decoded = std::string(m_uri_decoded, 0, pos);
@ -356,7 +358,8 @@ int Transaction::processURI(const char *uri, const char *method,
if (pos_raw != std::string::npos) { if (pos_raw != std::string::npos) {
std::string qry = std::string(uri_s, pos_raw + 1, std::string qry = std::string(uri_s, pos_raw + 1,
uri_s.length() - (pos_raw + 1)); uri_s.length() - (pos_raw + 1));
m_variableQueryString.set(qry, m_variableOffset); m_variableQueryString.set(qry, pos_raw + 1
+ std::string(method).size() + 1);
} }
std::string path_info; std::string path_info;
@ -405,9 +408,9 @@ int Transaction::processURI(const char *uri, const char *method,
m_variableRequestURI.set(parsedURI, m_variableOffset); m_variableRequestURI.set(parsedURI, m_variableOffset);
m_variableRequestURIRaw.set(uri, m_variableOffset); m_variableRequestURIRaw.set(uri, m_variableOffset);
if (pos != std::string::npos && (m_uri_decoded.length() - pos) > 2) { if (m_variableQueryString.m_value.empty() == false) {
extractArguments("GET", std::string(uri_s, pos_raw + 1, extractArguments("GET", m_variableQueryString.m_value,
uri_s.length() - (pos_raw + 1))); m_variableQueryString.m_offset);
} }
return true; return true;
} }
@ -679,7 +682,7 @@ int Transaction::processRequestBody() {
m_variableReqbodyProcessorError.set("0", m_variableOffset); m_variableReqbodyProcessorError.set("0", m_variableOffset);
} }
} else if (m_requestBodyType == WWWFormUrlEncoded) { } else if (m_requestBodyType == WWWFormUrlEncoded) {
extractArguments("POST", m_requestBody.str()); extractArguments("POST", m_requestBody.str(), 0);
} else if (m_collections.resolveFirst( } else if (m_collections.resolveFirst(
"REQUEST_HEADERS:Content-Type") != NULL) { "REQUEST_HEADERS:Content-Type") != NULL) {
std::string *a = m_collections.resolveFirst( std::string *a = m_collections.resolveFirst(

View File

@ -530,6 +530,7 @@ int acmp_process_quick(ACMPT *acmpt, const char **match, const char *data, size_
ACMP *parser; ACMP *parser;
acmp_node_t *node, *go_to; acmp_node_t *node, *go_to;
const char *end; const char *end;
int offset = 0;
if (acmpt->parser->is_failtree_done == 0) { if (acmpt->parser->is_failtree_done == 0) {
acmp_prepare(acmpt->parser); acmp_prepare(acmpt->parser);
@ -551,7 +552,7 @@ int acmp_process_quick(ACMPT *acmpt, const char **match, const char *data, size_
if (go_to != NULL) { if (go_to != NULL) {
if (go_to->is_last) { if (go_to->is_last) {
*match = go_to->text; *match = go_to->text;
return 1; return offset;
} }
} }
if (node == parser->root_node) break; if (node == parser->root_node) break;
@ -562,8 +563,9 @@ int acmp_process_quick(ACMPT *acmpt, const char **match, const char *data, size_
/* If node has o_match, then we found a pattern */ /* If node has o_match, then we found a pattern */
if (node->o_match != NULL) { if (node->o_match != NULL) {
*match = node->text; *match = node->text;
return 1; return offset;
} }
offset++;
} }
acmpt->ptr = node; acmpt->ptr = node;
return 0; return 0;

View File

@ -91,6 +91,8 @@ std::list<SMatch> Regex::searchAll(const std::string& s) {
continue; continue;
} }
match.match = std::string(tmpString, start, len); match.match = std::string(tmpString, start, len);
match.m_offset = start;
match.m_length = len;
retList.push_front(match); retList.push_front(match);
} }

View File

@ -31,11 +31,16 @@ namespace Utils {
class SMatch { class SMatch {
public: public:
SMatch() : size_(0) { } SMatch() : size_(0),
m_offset(0),
m_length(0),
match("") { }
size_t size() const { return size_; } size_t size() const { return size_; }
std::string str() const { return match; } std::string str() const { return match; }
int size_;
std::string match; std::string match;
int size_;
int m_offset;
int m_length;
}; };

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_ARGS_COMBINED_SIZE_H_
#define SRC_VARIABLES_ARGS_COMBINED_SIZE_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ArgsCombinedSize : public Variable {
public:
ArgsCombinedSize()
: Variable("ARGS_COMBINED_SIZE") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableARGScombinedSize.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_ARGS_COMBINED_SIZE_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_ARGS_NAMES_GET_H_
#define SRC_VARIABLES_ARGS_NAMES_GET_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ArgsGetNames : public Variable {
public:
ArgsGetNames()
: Variable("ARGS_GET_NAMES") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableArgGetNames.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_ARGS_NAMES_GET_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_ARGS_NAMES_H_
#define SRC_VARIABLES_ARGS_NAMES_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ArgsNames : public Variable {
public:
ArgsNames()
: Variable("ARGS_NAMES") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableArgsNames.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_ARGS_NAMES_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_ARGS_NAMES_POST_H_
#define SRC_VARIABLES_ARGS_NAMES_POST_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ArgsPostNames : public Variable {
public:
ArgsPostNames()
: Variable("ARGS_POST_NAMES") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableArgPostNames.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_ARGS_NAMES_POST_H_

47
src/variables/auth_type.h Normal file
View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_AUTH_TYPE_H_
#define SRC_VARIABLES_AUTH_TYPE_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class AuthType : public Variable {
public:
AuthType()
: Variable("AUTH_TYPE") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableAuthType.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_AUTH_TYPE_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_FILES_COMBINED_SIZE_H_
#define SRC_VARIABLES_FILES_COMBINED_SIZE_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class FilesCombinedSize : public Variable {
public:
FilesCombinedSize()
: Variable("FILES_COMBINED_SIZE") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableFilesCombinedSize.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_FILES_COMBINED_SIZE_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_FILES_TMP_NAMES_H_
#define SRC_VARIABLES_FILES_TMP_NAMES_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class FilesTmpNames : public Variable {
public:
FilesTmpNames()
: Variable("FILES_TMPNAMES") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableFilesTmpNames.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_FILES_TMP_NAMES_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_FULL_REQUEST_H_
#define SRC_VARIABLES_FULL_REQUEST_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class FullRequest : public Variable {
public:
FullRequest()
: Variable("FULL_REQUEST") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableFullRequest.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_FULL_REQUEST_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_FULL_REQUEST_LENGTH_H_
#define SRC_VARIABLES_FULL_REQUEST_LENGTH_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class FullRequestLength : public Variable {
public:
FullRequestLength()
: Variable("FULL_REQUEST_LENGTH") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableFullRequestLength.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_FULL_REQUEST_LENGTH_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_INBOUND_DATA_ERROR_H_
#define SRC_VARIABLES_INBOUND_DATA_ERROR_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class InboundDataError : public Variable {
public:
InboundDataError()
: Variable("INBOUND_DATA_ERROR") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableInboundDataError.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_INBOUND_DATA_ERROR_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_MATCHED_VAR_H_
#define SRC_VARIABLES_MATCHED_VAR_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class MatchedVar : public Variable {
public:
MatchedVar()
: Variable("MATCHED_VAR") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableMatchedVar.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_MATCHED_VAR_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_MATCHED_VAR_NAME_H_
#define SRC_VARIABLES_MATCHED_VAR_NAME_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class MatchedVarName : public Variable {
public:
MatchedVarName()
: Variable("MATCHED_VAR_NAME") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableMatchedVarName.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_MATCHED_VAR_NAME_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_MULTIPART_CRLF_LF_LINES_H_
#define SRC_VARIABLES_MULTIPART_CRLF_LF_LINES_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class MultipartCrlfLFLines : public Variable {
public:
MultipartCrlfLFLines()
: Variable("MULTIPART_CRLF_LF_LINES") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableMultipartCrlfLFLines.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_MULTIPART_CRLF_LF_LINES_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_MULTIPART_DATA_AFTER_H_
#define SRC_VARIABLES_MULTIPART_DATA_AFTER_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class MultipartDateAfter : public Variable {
public:
MultipartDateAfter()
: Variable("MULTIPART_DATA_AFTER") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableMultipartDataAfter.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_MULTIPART_DATA_AFTER_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_MULTIPART_FILE_LIMIT_EXCEEDED_H_
#define SRC_VARIABLES_MULTIPART_FILE_LIMIT_EXCEEDED_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class MultipartFileLimitExceeded : public Variable {
public:
MultipartFileLimitExceeded()
: Variable("MULTIPART_FILE_LIMIT_EXCEEDED") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableMultipartFileLimitExceeded.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_MULTIPART_FILE_LIMIT_EXCEEDED_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_MULTIPART_HEADER_FOLDING_H_
#define SRC_VARIABLES_MULTIPART_HEADER_FOLDING_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class MultipartHeaderFolding : public Variable {
public:
MultipartHeaderFolding()
: Variable("MULTIPART_HEADER_FOLDING") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableMultipartHeaderFolding.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_MULTIPART_HEADER_FOLDING_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_MULTIPART_INVALID_HEADER_FOLDING_H_
#define SRC_VARIABLES_MULTIPART_INVALID_HEADER_FOLDING_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class MultipartInvalidHeaderFolding : public Variable {
public:
MultipartInvalidHeaderFolding()
: Variable("MULTIPART_INVALID_HEADER_FOLDING") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableMultipartInvalidHeaderFolding.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_MULTIPART_INVALID_HEADER_FOLDING_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_MULTIPART_INVALID_QUOTING_H_
#define SRC_VARIABLES_MULTIPART_INVALID_QUOTING_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class MultipartInvalidQuoting : public Variable {
public:
MultipartInvalidQuoting()
: Variable("MULTIPART_INVALID_QUOTING") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableMultipartInvalidQuoting.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_MULTIPART_INVALID_QUOTING_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_MULTIPART_STRICT_ERROR_H_
#define SRC_VARIABLES_MULTIPART_STRICT_ERROR_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class MultipartStrictError : public Variable {
public:
MultipartStrictError()
: Variable("MULTIPART_STRICT_ERROR") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableMultipartStrictError.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_MULTIPART_STRICT_ERROR_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_MULTIPART_UNMATCHED_BOUNDARY_H_
#define SRC_VARIABLES_MULTIPART_UNMATCHED_BOUNDARY_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class MultipartUnmatchedBoundary : public Variable {
public:
MultipartUnmatchedBoundary()
: Variable("MULTIPART_UNMATCHED_BOUNDARY") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableMultipartUnmatchedBoundary.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_ARGS_NAMES_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_OUTBOUND_DATA_ERROR_H_
#define SRC_VARIABLES_OUTBOUND_DATA_ERROR_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class OutboundDataError : public Variable {
public:
OutboundDataError()
: Variable("OUTBOUND_DATA_ERROR") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableOutboundDataError.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_OUTBOUND_DATA_ERROR_H_

47
src/variables/path_info.h Normal file
View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_PATH_INFO_H_
#define SRC_VARIABLES_PATH_INFO_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class PathInfo : public Variable {
public:
PathInfo()
: Variable("PATH_INFO") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variablePathInfo.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_PATH_INFO_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_QUERY_STRING_H_
#define SRC_VARIABLES_QUERY_STRING_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class QueryString : public Variable {
public:
QueryString()
: Variable("QUERY_STRING") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableQueryString.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_QUERY_STRING_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REMOTE_ADDR_H_
#define SRC_VARIABLES_REMOTE_ADDR_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class RemoteAddr : public Variable {
public:
RemoteAddr()
: Variable("REMOTE_ADDR") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableRemoteAddr.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REMOTE_ADDR_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REMOTE_HOST_H_
#define SRC_VARIABLES_REMOTE_HOST_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class RemoteHost : public Variable {
public:
RemoteHost()
: Variable("REMOTE_HOST") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableRemoteHost.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REMOTE_HOST_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REMOTE_PORT_H_
#define SRC_VARIABLES_REMOTE_PORT_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class RemotePort : public Variable {
public:
RemotePort()
: Variable("REMOTE_PORT") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableRemotePort.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REMOTE_PORT_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REQBODY_ERROR_H_
#define SRC_VARIABLES_REQBODY_ERROR_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ReqbodyError : public Variable {
public:
ReqbodyError()
: Variable("REQBODY_ERROR") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableReqbodyError.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REQBODY_ERROR_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REQBODY_ERROR_MSG_H_
#define SRC_VARIABLES_REQBODY_ERROR_MSG_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ReqbodyErrorMsg : public Variable {
public:
ReqbodyErrorMsg()
: Variable("REQBODY_ERROR_MSG") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableReqbodyErrorMsg.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REQBODY_ERROR_MSG_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REQBODY_PROCESSOR_H_
#define SRC_VARIABLES_REQBODY_PROCESSOR_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ReqbodyProcessor : public Variable {
public:
ReqbodyProcessor()
: Variable("REQBODY_PROCESSOR") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableReqbodyProcessor.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REQBODY_PROCESSOR_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REQBODY_PROCESSOR_ERROR_H_
#define SRC_VARIABLES_REQBODY_PROCESSOR_ERROR_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ReqbodyProcessorError : public Variable {
public:
ReqbodyProcessorError()
: Variable("REQBODY_PROCESSOR_ERROR") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableReqbodyProcessorError.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REQBODY_PROCESSOR_ERROR_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_PROCESSOR_ERROR_MSG_H_
#define SRC_VARIABLES_PROCESSOR_ERROR_MSG_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ReqbodyProcessorErrorMsg : public Variable {
public:
ReqbodyProcessorErrorMsg()
: Variable("PROCESSOR_ERROR_MSG") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableReqbodyProcessorErrorMsg.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_PROCESSOR_ERROR_MSG_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REQUEST_BASENAME_H_
#define SRC_VARIABLES_REQUEST_BASENAME_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class RequestBasename : public Variable {
public:
RequestBasename()
: Variable("REQUEST_BASENAME") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableRequestBasename.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REQUEST_BASENAME_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REQUEST_BODY_H_
#define SRC_VARIABLES_REQUEST_BODY_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class RequestBody : public Variable {
public:
RequestBody()
: Variable("REQUEST_BODY") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableRequestBody.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REQUEST_BODY_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REQUEST_BODY_LENGTH_H_
#define SRC_VARIABLES_REQUEST_BODY_LENGTH_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class RequestBodyLength : public Variable {
public:
RequestBodyLength()
: Variable("REQUEST_BODY_LENGTH") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableRequestBodyLength.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REQUEST_BODY_LENGTH_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REQUEST_FILENAME_H_
#define SRC_VARIABLES_REQUEST_FILENAME_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class RequestFilename : public Variable {
public:
RequestFilename()
: Variable("REQUEST_FILENAME") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableRequestFilename.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REQUEST_FILENAME_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REQUEST_HEADERS_NAMES_H_
#define SRC_VARIABLES_REQUEST_HEADERS_NAMES_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class RequestHeadersNames : public Variable {
public:
RequestHeadersNames()
: Variable("REQUEST_HEADERS_NAMES") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableRequestHeadersNames.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_TIMEARG_NAMES_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REQUEST_LINE_H_
#define SRC_VARIABLES_REQUEST_LINE_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class RequestLine : public Variable {
public:
RequestLine()
: Variable("REQUEST_LINE") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableRequestLine.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REQUEST_LINE_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REQUEST_METHOD_H_
#define SRC_VARIABLES_REQUEST_METHOD_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class RequestMethod : public Variable {
public:
RequestMethod()
: Variable("REQUEST_METHOD") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableRequestMethod.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REQUEST_METHOD_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REQUEST_PROTOCOL_H_
#define SRC_VARIABLES_REQUEST_PROTOCOL_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class RequestProtocol : public Variable {
public:
RequestProtocol()
: Variable("REQUEST_PROTOCOL") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableRequestProtocol.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REQUEST_PROTOCOL_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REQUEST_URI_H_
#define SRC_VARIABLES_REQUEST_URI_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class RequestURI : public Variable {
public:
RequestURI()
: Variable("REQUEST_URI") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableRequestURI.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REQUEST_URI_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_REQUEST_URI_RAW_H_
#define SRC_VARIABLES_REQUEST_URI_RAW_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class RequestURIRaw : public Variable {
public:
RequestURIRaw()
: Variable("REQUEST_URI_RAW") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableRequestURIRaw.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_REQUEST_URI_RAW_H_

47
src/variables/resources.h Normal file
View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_RESOURCE_H_
#define SRC_VARIABLES_RESOURCE_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class Resource : public Variable {
public:
Resource()
: Variable("RESOURCE") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableResource.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_RESOURCE_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_RESPONSE_BODY_H_
#define SRC_VARIABLES_RESPONSE_BODY_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ResponseBody : public Variable {
public:
ResponseBody()
: Variable("RESPONSE_BODY") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableResponseBody.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_RESPONSE_BODY_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_RESPONSE_CONTENT_LENGTH_H_
#define SRC_VARIABLES_RESPONSE_CONTENT_LENGTH_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ResponseContentLength : public Variable {
public:
ResponseContentLength()
: Variable("RESPONSE_CONTENT_LENGTH") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableResponseContentLength.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_RESPONSE_CONTENT_LENGTH_H_

View File

@ -0,0 +1,46 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_RESPONSE_CONTENT_TYPE_H_
#define SRC_VARIABLES_RESPONSE_CONTENT_TYPE_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ResponseContentType : public Variable {
public:
ResponseContentType()
: Variable("RESPONSE_CONTENT_TYPE") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableResponseContentType.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_RESPONSE_CONTENT_TYPE_H_

View File

@ -0,0 +1,46 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_ARG_NAMES_H_
#define SRC_VARIABLES_ARG_NAMES_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ResponseHeadersNames : public Variable {
public:
ResponseHeadersNames()
: Variable("RESPONSE_HEADERS_NAMES") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableResponseHeadersNames.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_TIMEARG_NAMES_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_RESPONSE_PROTOCOL_H_
#define SRC_VARIABLES_RESPONSE_PROTOCOL_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ResponseProtocol : public Variable {
public:
ResponseProtocol()
: Variable("RESPONSE_PROTOCOL") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableResponseProtocol.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_RESPONSE_PROTOCOL_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_RESPONSE_STATUS_H_
#define SRC_VARIABLES_RESPONSE_STATUS_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ResponseStatus : public Variable {
public:
ResponseStatus()
: Variable("RESPONSE_STATUS") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableResponseStatus.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_RESPONSE_STATUS_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_SERVER_ADDR_H_
#define SRC_VARIABLES_SERVER_ADDR_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ServerAddr : public Variable {
public:
ServerAddr()
: Variable("SERVER_ADDR") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableServerAddr.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_SERVER_ADDR_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_SERVER_NAME_H_
#define SRC_VARIABLES_SERVER_NAME_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ServerName : public Variable {
public:
ServerName()
: Variable("SERVER_NAME") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableServerName.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_SERVER_NAME_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_SERVER_PORT_H_
#define SRC_VARIABLES_SERVER_PORT_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class ServerPort : public Variable {
public:
ServerPort()
: Variable("SERVER_PORT") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableServerPort.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_SERVER_PORT_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_SESSION_ID_H_
#define SRC_VARIABLES_SESSION_ID_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class SessionID : public Variable {
public:
SessionID()
: Variable("SESSIONID") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableSessionID.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_SESSION_ID_H_

47
src/variables/unique_id.h Normal file
View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_UNIQUE_ID_H_
#define SRC_VARIABLES_UNIQUE_ID_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class UniqueID : public Variable {
public:
UniqueID()
: Variable("UNIQUEID") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableUniqueID.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_UNIQUE_ID_H_

View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_URL_ENCODED_ERROR_H_
#define SRC_VARIABLES_URL_ENCODED_ERROR_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class UrlEncodedError : public Variable {
public:
UrlEncodedError()
: Variable("URLENCODED_ERROR") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableUrlEncodedError.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_URL_ENCODED_ERROR_H_

47
src/variables/user_id.h Normal file
View File

@ -0,0 +1,47 @@
/*
* ModSecurity, http://www.modsecurity.org/
* Copyright (c) 2015 Trustwave Holdings, Inc. (http://www.trustwave.com/)
*
* You may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org.
*
*/
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <utility>
#ifndef SRC_VARIABLES_USER_ID_H_
#define SRC_VARIABLES_USER_ID_H_
#include "src/variables/variable.h"
namespace modsecurity {
class Transaction;
namespace Variables {
class UserID : public Variable {
public:
UserID()
: Variable("USERID") { }
void evaluateInternal(Transaction *transaction,
std::vector<const collection::Variable *> *l) {
transaction->m_variableUserID.evaluate(l);
}
};
} // namespace Variables
} // namespace modsecurity
#endif // SRC_VARIABLES_USER_ID_H_