You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by Zhijun Sheng <zh...@hotmail.com> on 2009/05/31 21:29:55 UTC
A question about using BlacklistFilter
Hi, Mina Community,
I've been using class BlacklistFilter for a while in this way:
- Start my mina server
- Read from DB those saved bad IPs
- Create an instance of BlacklistFilter and add to it the bad IPs
- Call DefaultIoFilterChainBuilder.addLast() to add the above
filter
- Server continue running .
- When detecting incoming bad requests from bad IPs, server saves
them to DB for use in next time restarting server
I am not sure is the above the recommended/correct way to use
BlacklistFilter. I hope whenever bad IPs is detected, the filter can be
updated and take effect immediately, instead of waiting for next time
restarting server. Is it possible? If yes how?
Thanks a lot in advance!
Zhijun
RE: A question about using BlacklistFilter
Posted by Zhijun Sheng <zh...@hotmail.com>.
I didn't realize there is a method like block(). So if I have a pre-defined
list of blacklist,
- I call setBlacklist() at the time server is launched
- I call block() to immediately block any newly detected bad IP when server
is running
- I save all the new bad IPs together with already known bad IPs to keep my
blacklist updated ...
Thank you so much Ashish!
Zhijun
-----Original Message-----
From: Ashish [mailto:paliwalashish@gmail.com]
Sent: Monday, June 01, 2009 1:55 AM
To: users@mina.apache.org
Subject: Re: A question about using BlacklistFilter
>
> I've been using class BlacklistFilter for a while in this way:
>
>
>
> - Start my mina server
>
> - Read from DB those saved bad IPs
>
> - Create an instance of BlacklistFilter and add to it the bad IPs
>
> - Call DefaultIoFilterChainBuilder.addLast() to add the above
> filter
>
> - Server continue running .
>
> - When detecting incoming bad requests from bad IPs, server saves
> them to DB for use in next time restarting server
> I am not sure is the above the recommended/correct way to use
> BlacklistFilter. I hope whenever bad IPs is detected, the filter can be
> updated and take effect immediately, instead of waiting for next time
> restarting server. Is it possible? If yes how?
You can use them in the same cycle, by adding the same to the
Blacklist filter and then saving to DB.
This off course shall depend upon your business needs.
see the block() API's in BlacklistFilter.java
--
thanks
ashish
Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal
Re: A question about using BlacklistFilter
Posted by Ashish <pa...@gmail.com>.
>
> I've been using class BlacklistFilter for a while in this way:
>
>
>
> - Start my mina server
>
> - Read from DB those saved bad IPs
>
> - Create an instance of BlacklistFilter and add to it the bad IPs
>
> - Call DefaultIoFilterChainBuilder.addLast() to add the above
> filter
>
> - Server continue running .
>
> - When detecting incoming bad requests from bad IPs, server saves
> them to DB for use in next time restarting server
> I am not sure is the above the recommended/correct way to use
> BlacklistFilter. I hope whenever bad IPs is detected, the filter can be
> updated and take effect immediately, instead of waiting for next time
> restarting server. Is it possible? If yes how?
You can use them in the same cycle, by adding the same to the
Blacklist filter and then saving to DB.
This off course shall depend upon your business needs.
see the block() API's in BlacklistFilter.java
--
thanks
ashish
Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal