-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Annoying DNS queries with @rbl operator #3111
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
Comments
That would be |
Yes |
Do you happen to know if the apache / ModSec2 docker container has the same problem? |
No, sorry. I only use the Nginx version. |
@ne20002 thanks for the report. Could you provide an example, how can I try the explained behavior?
This means the "vanilla" ModSecurity instance does not do this? |
No, this just means that no other server in my network creates dns requests with the seen postfix. It's just the queries created by the @rbl checks. This is the part in my config:
|
Who can spot the typos here? https://github.com/owasp-modsecurity/ModSecurity/blob/v3/master/src/operators/rbl.h#L70-L76 |
Tip: lines 74 and 76. |
Don't know if it solves this, but it is definitely broken. |
So, not really fixing this, but #3127. |
@ne20002 could you check again with current master branch? |
It might be difficult for @ne20002 if he is using pods for this, as the container is not updated with the new code from master. @airween Maybe we can do a quick build and use the secrule he posted above with a simple curl test? From the source code, debug information is being printed with level 4 or up. |
I can take a look at at the evening. |
Okay, I think I found the root cause. libmodsecurity3 (I haven't checked mod_security2 yet) uses If you have a
then in case of a nonexistent domain response the resolver tries to look up the original query with appending your The possible workaround is that you use FQDN at the secrule:
see the I don't know what would be the nice final solution: append an implicit (I think we have to check that in case of mod_security2 too). Any ideas? |
Just FYI: mod_security2 works as the same as libmodsecurity3. With the rules above it repeats the query, appending a We should decide how we want to solve it: append explicit |
Personally, I'd go with the FQDN approach. If you want to check multiple domains you can write multiple rules, so there shouldn't be an argument for using |
As the problem is solved (by using FQDN name) I'll close the issue. |
Describe the bug
Using a pihole in my network I realized that the rbl queries from Modsecurity are doing additional dns queries with the search domain (from resolv.conf) added.
This happens only for @rbl queries (or maybe modsecurity in general). It does not happen from other containers in the pod nor any other system in my network.
I use the owasp/modsecurity-crs:nginx container from Docker hub.
Expected behavior
The additional queries are not done.
The text was updated successfully, but these errors were encountered: