Adds support to custom operator's message in case of a match

This commit is contained in:
Felipe Zimmerle
2016-09-12 15:40:03 -03:00
parent ad61838118
commit 0a22f880dd
6 changed files with 34 additions and 22 deletions

View File

@@ -129,12 +129,8 @@ class RuleMessage {
std::string msg;
msg.append("[client " + std::string(trans->m_clientIpAddress) + "]");
msg.append(" ModSecurity: Warning.");
msg.append(" Matched \"" + m_match + "\"");
if (trans->m_collections.resolveFirst("MATCHED_VAR_NAME")) {
msg.append(" at "
+ *trans->m_collections.resolveFirst("MATCHED_VAR_NAME"));
}
msg.append(" ModSecurity: Warning. ");
msg.append(m_match);
msg.append(" [file \"" + std::string(m_ruleFile) + "\"]");
msg.append(" [line \"" + std::to_string(m_ruleLine) + "\"]");
msg.append(" [id \"" + std::to_string(m_ruleId) + "\"]");