-
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
Problem with negated Cidr in ossec-2.9 #1065
Comments
I can reproduce this:
I'm not sure negation or CIDR search work though. Is that a legal rule entry? |
Ran into this same issue recently where a negated CIDR generated an invalid pointer message in 2.9. My negated CIDR was in a srcip element. This is CentOS 7.3 + OSSEC 2.9.0 According to the documentation, negated CIDR values are legal: http://ossec.github.io/docs/syntax/head_rules.html#element-srcip
|
This is still a problem in 2.9.1 |
Problem exists in 2.9.2 too |
It doesn't appear to just be CIDR addresses. I get a crash with non-CIDR addresses as well. |
Hi, runned into the same bug in 2.9.2 and master (did not tested 2.9.1) From my point of view, the bug triggers when negating an IP on a CIDR, in Quickly looking at the code, the bug might be at https://github.com/ossec/ossec-hids/blob/master/src/shared/validate_op.c#L263;
|
@ddpbsd I suggest the following fix; if (*ip_address == '!') {
- ip_address++;
+ os_strdup(in_address+1, ip_address);
} |
Thanks @calve This was next on my list of things to look at. I'll give that a try and make a pull request if it works for me. |
@calve provided the fix, os_strdup the ip address instead of just ++ing it.
the daily report emails. As @calve pointed out in PR ossec#1065 it's a bad idea to use a static servername. This seems to have been fixed in maild already.
Hey, i updated to ossec 2.9.0 and got errors when i tested the rules.
I searched which rule makes the problem. The problem caused by negation of the cidr in the following rule.
The text was updated successfully, but these errors were encountered: