-
-
Notifications
You must be signed in to change notification settings - Fork 402
Create RBL plugin #2501
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
FYI: I have begun working on this and will update this issue about the progress. |
It looks like the responses to the RBL queries can differ quite a bit, some even requiring an API access key whereas others do not. Also, the rules would have to statically list the targeted API. I think it would be best to have separate plugins for the different RBL API providers. What do you think? The previous implementation in CRS only made use of dnsbl.httpbl.org so I would start whit a plugin specifically for this RBL. |
Can you make it configurable in the same plugin? |
The problem is that for dnsbl.httpbl.org you get a response that is quite different than for other generic RBLs. There is additional threat data like a threat score and freshness information with this RBL that is not there for other RBLs. The RBL zen.spamhaus.org responds with multiple responses though, I do not see any way to make use of the additional information in ModSecurity but the response differs from the generic response for other RBLs. Here are a few examples where the actual values have been changed:
There are also differences in behaviour when the IP is not in the blacklist. Generally, the lookup rule does not match but for dnshttpbl.org the rule does match and the message informs about the error, so we have to do additional checks:
Making this configurable would result in a fairly complex construct. Then there is also another problem. We cannot make the target of the lookup configurable via variables. We would have to list all available RBLs and skip the undesired ones. On the other hand, this would allow you to have multiple RBLs active at the same time. All in all I am not convinced it would be better to only have one plugin but certainly not set on separate plugins either. |
Thinking about this some more, I think we could simply split the plugin into separate files but ship them together as a single plugin. |
I do not like the idea of separate plugins and I think we ought to explore the complexer combined option. How about this construct:
This way, only enabled resolvers are accessed. The response is written into a message variable and a separate set of rules will then examine said responses, each resolver's response covered with a separate rule or group of rules that are tailored to the specifics of the resolver. |
To me this seems overly complicated especially, because we already have to use multiple chained to begin with in order to check if the lookup was successful and what it said about the IP:
This could probably be simplified a bit but it would likely remain a complicated construct. Adding more conditions would make this even more complicated. |
This would belong into the handling block in my proposal above. The handling block is apparently complicated, but that's why you hide it all into a separate plugin in CRS is not really affected. And the handling would have to be specific for every RBL provider, so it's simply a question of putting it all in the same file / plugin or in separate files / plugins. What I did not get is your above proposal of single-plugin, but with multiple files.
And then you can deploy those files that you like and they would be implicitly activated? I can see how this could work. But please be aware that the plugin activation / deactivation has to be present in all of these files. So we would separate them nicely, but we would also have to do separate plugin ac 8000 tivation in the files ... |
This issue has been open 120 days with no activity. Remove the stale label or comment, or this will be closed in 14 days |
@coreruleset/core-developers who wants to take this one? |
Note that when I was working on this, I was having issues getting reliable results from the DNS lookups. It looked like ModSecurity was not doing the DNS lookups properly, misinterpreting the results, or having issues with error handling of some sort. I am wondering now, if these issues were related to something like owasp-modsecurity/ModSecurity#3111. |
We should consider sunsetting this, unless there is anyone with a strong desire to develop and then maintain this as a new plugin? |
That was the whole idea behind it, right? Moving it out from the core, but keep it as plugin. |
No, I mean sunsetting it for good. If there is no one who wants to a.) develop this and then b.) actively maintain such a plugin then we should sunset it. It looks like it's been 2 years and nobody has stepped up, so interest in this functionality is limited. If there's a group or integrator/sponsor who wants or needs this functionality then they could always either sponsor its development or, ideally, pick it up themselves. Simply: if there is no one who will do the work then the work will not be done. |
I'd actually be willing to implement this but we would have to get things straightened out in the engine first. It might take a few weeks for me to get around to this but I can try to reproduce the issues within ModSec and file an issue over at https://github.com/owasp-modsecurity/ModSecurity. |
Just FYI: owasp-modsecurity/ModSecurity#3131 |
Oh, I see, thanks for the info. So, am I following correctly that there were three distinct problems or pitfalls with RBL lookups that we know of,
|
yes, this is a knowing issue - the fix is not hard (I added the "good first issue" label)
this one is already merged (but not released yet)
yes, I asked that question, the mentioned workaround is enough and place it to the documentation or should we fix that in the code? So I don't know is it a problem or not. |
What's next here? Do we want to followup on this one or we just close? |
Motivation
The reputation rules have been removed from the core.
The RBL check is now gone.
Proposed solution
For the users of
@rbl
we can bring it back as a plugin.The text was updated successfully, but these errors were encountered: