-
Notifications
You must be signed in to change notification settings - Fork 1k
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
IPv6 triggers Rule 1002 #998
Comments
I'm not sure we can do anything about that. |
Do you have a log sample that generates this alert? The current $BAD_WORDS variable has a space after the word "bad", so I'm not sure why it would match an IPv6 address, unless the word occurred at the very end of the address. We could add another space to the beginning of "bad ", but I'm not sure what the ramifications would be off the top of my head. Either way, there are tons of logs where rule 1002 generates false positives. This is one of those rules you need to tune and suppress as appropriate to your environment. |
The following is an example from an Nginx access log, a few bits altered for anonymity:
I've implemented the following override rule for my own use, but it is pretty clumsy given the limited regex support: <rule id="100041" level="0">
<if_sid>1002</if_sid>
<regex>:\wbad|:bad\w|\wbad:|bad\w:</regex>
<description>Ignore :bad: IPv6</description>
</rule> |
Yep, that's the one fringe case where this would trigger 1002. I would change $BAD_WORDS to use " bad " instead of "bad ". How many times is the word bad going to be surrounded by punctuation or exist at the beginning or end of a string? Even in those cases, what are you really losing out on? Probably not much. I'm certainly not an expert, but I'm of the opinion that modifying $BAD_WORDS is the better approach, because allowing OSSEC to match against rule 1002, then setting the alert to level 0 is going to prevent you from further matching against other rules. If a web attack were present in the log that contains this theoretical IPv6 address, you would want it to match against web_attack rules and alert on it. |
Because
<match>
matches the whole entry, IPv6 addresses that happen to contain"bad"
(e.g. 2222:2222:2222:2222:2222:2222:2222:9bad) result in a false positive alert.The text was updated successfully, but these errors were encountered: