mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Disables skip counter if debug log is disabled
This commit is contained in:
parent
a1b6cceb65
commit
6f92c8914a
2
CHANGES
2
CHANGES
@ -1,6 +1,8 @@
|
|||||||
v3.0.3 - YYYY-MMM-DD (to be released)
|
v3.0.3 - YYYY-MMM-DD (to be released)
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
||||||
|
- Disables skip counter if debug log is disabled
|
||||||
|
[@zimmerle]
|
||||||
- Cosmetics: Represents amount of skipped rules without decimal
|
- Cosmetics: Represents amount of skipped rules without decimal
|
||||||
[Issue #1737 - @p0pr0ck5]
|
[Issue #1737 - @p0pr0ck5]
|
||||||
- Add missing escapeSeqDecode, urlEncode and trimLeft/Right tfns to parser
|
- Add missing escapeSeqDecode, urlEncode and trimLeft/Right tfns to parser
|
||||||
|
@ -47,14 +47,18 @@ class Rules : public RulesProperties {
|
|||||||
Rules()
|
Rules()
|
||||||
: RulesProperties(new DebugLog()),
|
: RulesProperties(new DebugLog()),
|
||||||
unicode_codepage(0),
|
unicode_codepage(0),
|
||||||
m_referenceCount(0),
|
#ifndef NO_LOGS
|
||||||
m_secmarker_skipped(0) { }
|
m_secmarker_skipped(0),
|
||||||
|
#endif
|
||||||
|
m_referenceCount(0) { }
|
||||||
|
|
||||||
explicit Rules(DebugLog *customLog)
|
explicit Rules(DebugLog *customLog)
|
||||||
: RulesProperties(customLog),
|
: RulesProperties(customLog),
|
||||||
unicode_codepage(0),
|
unicode_codepage(0),
|
||||||
m_referenceCount(0),
|
#ifndef NO_LOGS
|
||||||
m_secmarker_skipped(0) { }
|
m_secmarker_skipped(0),
|
||||||
|
#endif
|
||||||
|
m_referenceCount(0) { }
|
||||||
|
|
||||||
~Rules() { }
|
~Rules() { }
|
||||||
|
|
||||||
@ -80,7 +84,9 @@ class Rules : public RulesProperties {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int m_referenceCount;
|
int m_referenceCount;
|
||||||
|
#ifndef NO_LOGS
|
||||||
uint8_t m_secmarker_skipped;
|
uint8_t m_secmarker_skipped;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -180,15 +180,21 @@ int Rules::evaluate(int phase, Transaction *transaction) {
|
|||||||
for (int i = 0; i < rules.size(); i++) {
|
for (int i = 0; i < rules.size(); i++) {
|
||||||
Rule *rule = rules[i];
|
Rule *rule = rules[i];
|
||||||
if (transaction->m_marker.empty() == false) {
|
if (transaction->m_marker.empty() == false) {
|
||||||
|
#ifndef NO_LOGS
|
||||||
debug(9, "Skipped rule id '" + std::to_string(rule->m_ruleId) \
|
debug(9, "Skipped rule id '" + std::to_string(rule->m_ruleId) \
|
||||||
+ "' due to a SecMarker: " + transaction->m_marker);
|
+ "' due to a SecMarker: " + transaction->m_marker);
|
||||||
m_secmarker_skipped++;
|
m_secmarker_skipped++;
|
||||||
debug(9, "Rule: " + rule->m_marker);
|
debug(9, "Rule: " + rule->m_marker);
|
||||||
|
#endif
|
||||||
if (rule->m_secMarker && rule->m_marker == transaction->m_marker) {
|
if (rule->m_secMarker && rule->m_marker == transaction->m_marker) {
|
||||||
|
#ifndef NO_LOGS
|
||||||
debug(4, "Out of a SecMarker after skip " \
|
debug(4, "Out of a SecMarker after skip " \
|
||||||
+ std::to_string(m_secmarker_skipped) + " rules.");
|
+ std::to_string(m_secmarker_skipped) + " rules.");
|
||||||
|
#endif
|
||||||
transaction->m_marker.clear();
|
transaction->m_marker.clear();
|
||||||
|
#ifndef NO_LOGS
|
||||||
m_secmarker_skipped = 0;
|
m_secmarker_skipped = 0;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
} else if (transaction->m_skip_next > 0) {
|
} else if (transaction->m_skip_next > 0) {
|
||||||
transaction->m_skip_next--;
|
transaction->m_skip_next--;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user