-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include log marker name in example CRS test rule #64
Comments
The name can be changed with the |
@fzipi Yup, for this example rule the name is also encoded in the |
Correct. @anuraaga do you agree that we can close the issue? |
No sorry if wasn't clear - I think @fzipi's point is that the logmarkerheadername is configurable so the example rule won't work if it's reconfigured. That is already the case though so wouldn't be a reason not to change the example I think. But assuming the default name, currently the example rule doesn't log the name while ftw looks for it. By updating the rule with my suggestion, that possible issue goes away to make it easier to get started - notably when first trying out ftw it was failing with the missing log marker message even though the rule was working, and looking at the code I found the check for the name is there too |
Sorry, I'm still confused. When the rule is triggered with the example rule (which, incidentally is the real rule we use in CRS) the following shows up in the log:
You can see that it contains the header name so there's no need to put it in the message. |
Ah sorry for the confusion @theseion - I am testing Coraza with ftw which doesn't have the Pattern match type of logging. Perhaps this is a point to improve in Coraza - but given the rule spec itself does dictate what is logged in the |
Ah yes, that's a good point. I had just assumed that the log would look the same for all engines. Would you mind opening a pull request with your proposal? |
I noticed that when looking for a log marker, it also checks for the marker name
https://github.com/fzipi/go-ftw/blob/f5f64a16b3d2bebea600ea070ffd5baa7f36213c/waflog/read.go#L114
The example rule for logging the marker doesn't output the name though
https://github.com/fzipi/go-ftw#how-log-parsing-works
Presumably there is some assumption that the log message automatically includes header names - but would the rule be more generic by including the name in it, e.g.
The text was updated successfully, but these errors were encountered: