mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Adds verbose logs to audit logs while deciding or not to save a request
This commit is contained in:
parent
77a1dcab9b
commit
362b376acb
@ -228,6 +228,11 @@ bool AuditLog::saveIfRelevant(Transaction *transaction) {
|
||||
bool AuditLog::saveIfRelevant(Transaction *transaction, int parts) {
|
||||
if (this->isRelevant(transaction->m_httpCodeReturned) == false &&
|
||||
transaction->m_toBeSavedInAuditlogs == false) {
|
||||
transaction->debug(5, "Return code `" +
|
||||
std::to_string(transaction->m_httpCodeReturned) + "'" \
|
||||
" is not interesting to audit logs, relevant code(s): `" +
|
||||
m_relevant + "'.");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -237,12 +242,16 @@ bool AuditLog::saveIfRelevant(Transaction *transaction, int parts) {
|
||||
*
|
||||
*/
|
||||
if (transaction->m_toNotBeSavedInAuditLogs == true) {
|
||||
transaction->debug(5, "This request was marked to not " \
|
||||
"be saved in the audit logs.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (parts == -1) {
|
||||
parts = m_parts;
|
||||
}
|
||||
transaction->debug(5, "Saving this request as part " \
|
||||
"of the audit logs.");
|
||||
m_writer->write(transaction, parts);
|
||||
|
||||
return true;
|
||||
|
@ -1213,7 +1213,8 @@ int Transaction::processLogging(int returned_code) {
|
||||
"saved via auditlog action.");
|
||||
}
|
||||
#endif
|
||||
|
||||
debug(8, "Checking if this request is relevant to be " \
|
||||
"part of the audit logs.");
|
||||
bool saved = this->m_rules->audit_log->saveIfRelevant(this, parts);
|
||||
if (saved) {
|
||||
#ifndef NO_LOGS
|
||||
|
Loading…
x
Reference in New Issue
Block a user