mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 11:16:33 +03:00
Added matching rules to audit log data. See #93.
This commit is contained in:
@@ -1214,6 +1214,7 @@ msre_rule *msre_rule_create(msre_ruleset *ruleset,
|
||||
rule->ruleset = ruleset;
|
||||
rule->targets = apr_array_make(ruleset->mp, 10, sizeof(const msre_var *));
|
||||
rule->p1 = apr_pstrdup(ruleset->mp, targets);
|
||||
rule->unparsed = apr_pstrcat(ruleset->mp, ((strcmp(SECACTION_TARGETS, targets) || strcmp(SECACTION_TARGETS, args)) ? "SecRule" : "SecAction"), " ", targets, " ", args, " ", actions, NULL);
|
||||
rule->filename = apr_pstrdup(ruleset->mp, fn);
|
||||
rule->line_num = line;
|
||||
|
||||
@@ -1424,6 +1425,9 @@ static int execute_operator(msre_var *var, msre_rule *rule, modsec_rec *msr,
|
||||
log_escape(msr->mp, full_varname));
|
||||
}
|
||||
|
||||
/* Save the rules that match */
|
||||
*(const msre_rule **)apr_array_push(msr->matched_rules) = rule;
|
||||
|
||||
/* Save the last matched var data */
|
||||
msr->matched_var->name = apr_pstrdup(msr->mp, var->name);
|
||||
msr->matched_var->name_len = strlen(msr->matched_var->name);
|
||||
|
Reference in New Issue
Block a user