mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Added matching rules to audit log data. See #93.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
* write to Breach Security, Inc. at support@breach.com.
|
||||
*
|
||||
*/
|
||||
#include "re.h"
|
||||
#include "msc_logging.h"
|
||||
#include "httpd.h"
|
||||
#include "apr_strings.h"
|
||||
@@ -362,6 +363,7 @@ void sec_audit_logger(modsec_rec *msr) {
|
||||
const apr_array_header_t *arr = NULL;
|
||||
apr_table_entry_t *te = NULL;
|
||||
char *str1 = NULL, *str2 = NULL, *text = NULL;
|
||||
const msre_rule *rule = NULL;
|
||||
apr_size_t nbytes, nbytes_written;
|
||||
unsigned char md5hash[APR_MD5_DIGESTSIZE];
|
||||
int was_limited = 0;
|
||||
@@ -732,6 +734,13 @@ void sec_audit_logger(modsec_rec *msr) {
|
||||
sec_auditlog_write(msr, text, strlen(text));
|
||||
}
|
||||
|
||||
/* Matched Rules */
|
||||
for(i = 0; i < msr->matched_rules->nelts; i++) {
|
||||
rule = ((msre_rule **)msr->matched_rules->elts)[i];
|
||||
text = apr_psprintf(msr->mp, "MatchedRule: %s\n", rule->unparsed);
|
||||
sec_auditlog_write(msr, text, strlen(text));
|
||||
}
|
||||
|
||||
/* Apache error messages */
|
||||
for(i = 0; i < msr->error_messages->nelts; i++) {
|
||||
error_message *em = (((error_message**)msr->error_messages->elts)[i]);
|
||||
|
Reference in New Issue
Block a user