mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Adds partial support to UpdateActionById
This commit is contained in:
@@ -41,7 +41,7 @@ bool DetectSQLi::evaluate(Transaction *t, Rule *rule,
|
||||
input + "'");
|
||||
#endif
|
||||
if (rule && t
|
||||
&& rule->getActionsByName("capture").size() > 0) {
|
||||
&& rule->getActionsByName("capture", t).size() > 0) {
|
||||
t->m_collections.m_tx_collection->storeOrUpdateFirst(
|
||||
"0", std::string(fingerprint));
|
||||
#ifndef NO_LOGS
|
||||
|
@@ -37,7 +37,7 @@ bool DetectXSS::evaluate(Transaction *t, Rule *rule,
|
||||
t->debug(5, "detected XSS using libinjection.");
|
||||
#endif
|
||||
if (rule && t
|
||||
&& rule->getActionsByName("capture").size() > 0) {
|
||||
&& rule->getActionsByName("capture", t).size() > 0) {
|
||||
t->m_collections.m_tx_collection->storeOrUpdateFirst(
|
||||
"0", std::string(input));
|
||||
#ifndef NO_LOGS
|
||||
|
@@ -96,7 +96,8 @@ bool Pm::evaluate(Transaction *transaction, Rule *rule,
|
||||
#ifdef MODSEC_MUTEX_ON_PM
|
||||
pthread_mutex_unlock(&m_lock);
|
||||
#endif
|
||||
bool capture = rule && rule->getActionsByName("capture").size() > 0;
|
||||
bool capture = rule && rule->getActionsByName("capture",
|
||||
transaction).size() > 0;
|
||||
|
||||
if (rc > 0 && transaction) {
|
||||
std::string match_(match);
|
||||
|
@@ -223,7 +223,7 @@ bool Rbl::evaluate(Transaction *t, Rule *rule,
|
||||
|
||||
freeaddrinfo(info);
|
||||
if (rule && t
|
||||
&& rule->getActionsByName("capture").size() > 0) {
|
||||
&& rule->getActionsByName("capture", t).size() > 0) {
|
||||
t->m_collections.m_tx_collection->storeOrUpdateFirst(
|
||||
"0", std::string(ipStr));
|
||||
#ifndef NO_LOGS
|
||||
|
@@ -54,7 +54,8 @@ bool Rx::evaluate(Transaction *transaction, Rule *rule,
|
||||
}
|
||||
|
||||
matches = re->searchAll(input);
|
||||
if (rule && rule->getActionsByName("capture").size() > 0 && transaction) {
|
||||
if (rule && rule->getActionsByName("capture",
|
||||
transaction).size() > 0 && transaction) {
|
||||
int i = 0;
|
||||
matches.reverse();
|
||||
for (const SMatch& a : matches) {
|
||||
|
@@ -143,7 +143,7 @@ bool VerifyCC::evaluate(Transaction *t, Rule *rule,
|
||||
if (is_cc) {
|
||||
if (t) {
|
||||
if (rule && t
|
||||
&& rule->getActionsByName("capture").size() > 0) {
|
||||
&& rule->getActionsByName("capture", t).size() > 0) {
|
||||
t->m_collections.m_tx_collection->storeOrUpdateFirst(
|
||||
"0", std::string(match));
|
||||
#ifndef NO_LOGS
|
||||
|
@@ -134,7 +134,7 @@ bool VerifyCPF::evaluate(Transaction *t, Rule *rule,
|
||||
if (is_cpf) {
|
||||
logOffset(ruleMessage, i.m_offset, i.m_length);
|
||||
if (rule && t
|
||||
&& rule->getActionsByName("capture").size() > 0) {
|
||||
&& rule->getActionsByName("capture", t).size() > 0) {
|
||||
t->m_collections.m_tx_collection->storeOrUpdateFirst(
|
||||
"0", std::string(i.match));
|
||||
#ifndef NO_LOGS
|
||||
|
@@ -125,7 +125,7 @@ bool VerifySSN::evaluate(Transaction *t, Rule *rule,
|
||||
if (is_ssn) {
|
||||
logOffset(ruleMessage, i.m_offset, i.m_length);
|
||||
if (rule && t
|
||||
&& rule->getActionsByName("capture").size() > 0) {
|
||||
&& rule->getActionsByName("capture", t).size() > 0) {
|
||||
t->m_collections.m_tx_collection->storeOrUpdateFirst(
|
||||
"0", std::string(i.match));
|
||||
#ifndef NO_LOGS
|
||||
|
Reference in New Issue
Block a user