extended banmode like spamfilter

These are old archives. They are kept for historic purposes only.
Post Reply

Do you think a per channel spamfilter would be useful?

I'd use it
9
64%
Too difficult to implement
1
7%
Belongs server/network-wide like spamfilter
2
14%
Too risky due to bugs and/or unknowledgeable users.
2
14%
 
Total votes: 14

tabrisnet
Posts: 11
Joined: Sun May 30, 2004 9:45 pm
Location: Michigan, USA

extended banmode like spamfilter

Post by tabrisnet » Mon Jun 07, 2004 6:34 am

I originally posted this idea as a bugreport/feature-request, here: Bug 1829

the idea is spamfilter. per channel.

Obvious uses include blocking badwords per channel, blocking certain script output per channel, etc (iow, all the stuff that channels might want removed, but may be inappropriate to block server-wide).

Yes, there's services badwords. but, that only kicks after the fact, and is, to be honest, merely an annoyance. and not a solution (those with channel access either never get kicked, or get kicked and come right back [/cs invite]. all we get is a join-flood and annoyed users)

I understand there may be problems with a) our TRE regexp library being a bit crash prone b) most users not knowing what a regexp is [heck, I barely do. But I can learn.].

All the same, I believe it to be a worthwhile effort. Might even be merged in eventually to mainline, tho obv not w/o extensive testing as an external module.

Unfortunately, I possess neither the skill nor the time to code such a module. (limit of my coding skillset being to try to hack up other people's code to do what I want. bugfixes etc. [current projects include bugfixing and stabilizing Auspice services, hacking on a perlbot to do various needed things, and working with a friend on a brand new services package that may never get done])[/quote]

Jason
Posts: 570
Joined: Mon Jun 14, 2004 5:09 pm

Post by Jason » Mon Jul 19, 2004 4:48 pm

If its too risky, letting users define their own regexp why not make it a config thing? or a oper only mode?

tabrisnet
Posts: 11
Joined: Sun May 30, 2004 9:45 pm
Location: Michigan, USA

Post by tabrisnet » Mon Jul 19, 2004 8:21 pm

I'd agree on the 'oper only' mode, but that would require a new chanmode instead of using the already existing extended banmode system. But also making it oper only might detract from the point, and that is channel specific blocking. some things are allowed in some channels that are not in others.

but so far no one has felt too interested in coding it it seems.

Jason
Posts: 570
Joined: Mon Jun 14, 2004 5:09 pm

Post by Jason » Mon Jul 19, 2004 8:55 pm

tabrisnet wrote:But also making it oper only might detract from the point

Not really, The user can ask a oper to add a certain regexp. If it makes any sense (opers will need some knowledge of regexp), they can override it onto the channel.


I agree that this appears to have become infeasible
Why the hell can't my signature be empty?
"Your message contains too few characters."

w00t
Posts: 1136
Joined: Thu Mar 25, 2004 3:31 am
Location: Nowra, Australia

Post by w00t » Mon Jul 19, 2004 11:12 pm

And it wouldnt need a new chanmode to be opers only, remember the extbans are subclasses of +b. So just the new extban would be oper only.

(unless I miss something here)
-ChatSpike IRC Network [http://www.chatspike.net]
-Denora Stats [http://denora.nomadirc.net]
-Omerta [http://www.barafranca.com]

tabrisnet
Posts: 11
Joined: Sun May 30, 2004 9:45 pm
Location: Michigan, USA

Post by tabrisnet » Tue Jul 20, 2004 6:15 am

that would seem to assume that there are hooks for permission checking in the extban code (or that no hooks are needed but a simple perm check can be done in the extban code... and that the failure can then be returned up the chain in a meaningful fashion)

Syzop
UnrealIRCd head coder
Posts: 1957
Joined: Sat Mar 06, 2004 8:57 pm
Location: .nl
Contact:

Post by Syzop » Tue Jul 20, 2004 10:56 pm

There is.

Code: Select all

    /** access checking [optional].
     * aClient *: the client
     * aChannel *: the channel
     * para: the ban parameter
     * int: check type (see EXBCHK_*)
     * int: what (MODE_ADD or MODE_DEL)
     * int: what2 (EXBTYPE_BAN or EXBTYPE_EXCEPT)
     * return value: 1=ok, 0=bad
     * NOTE: just set this of NULL if you want only +hoaq to place/remove bans as usual.
     * NOTE2: This has not been tested yet!!
     */
    int         (*is_ok)(aClient *, aChannel *, char *para, int, int, int);
However, if you make this ircop only then IMO it pretty much defeats the purpose and probably decreases usage by like 95%.
Of course,... that's just my opinion...

Stealth
Head of Support
Posts: 2086
Joined: Tue Jun 15, 2004 8:50 pm
Location: Chino Hills, CA, US
Contact:

Post by Stealth » Wed Jul 21, 2004 5:55 am

This would be a nice idea, but rexexp takes alot of memory. I suggested that there be a badword ban type, and thats what i was told. "It would take too much memory to do such a thing."

Jo-W
Posts: 14
Joined: Tue Jun 01, 2004 6:00 pm

Post by Jo-W » Sun Jan 16, 2005 3:29 pm

How about multiple Spamfilter levels per channel,
lvl0 is none, only uses server wide spamfilters (exploits, etc)
lvl1 is low level spam and some swear words
lvl2 is medium level spam and most swear word
etc

then using channel mode '+G <lvl>' where '-G' equals '+G 0'

codemastr
Former UnrealIRCd head coder
Posts: 811
Joined: Sat Mar 06, 2004 8:47 pm
Location: United States
Contact:

Post by codemastr » Sun Jan 16, 2005 6:53 pm

Let me provide some cold hard facts about regex:

less than 20K [of memory is required] for the compiled pattern buffer
- About 20KB is required to store each compiled regex. Even at 10 spamfilters per channel, 200 channels, that's 40000KB, or about 40MB

Backreferences are an NP-Complete problem
- Well, I really don't care to explain what an NP-Complete problem is, but basically, it is a problem for which there is no fast solution. The time it takes to complete is exponential. This means that a user could craft a regex in such a way that it could bring the entire server to a halt for minutes at a time.

These two things alone, imho, are reason enough not to add it. Basically, it would give users the ability to launch DoS attacks very easily. Making it oper-only is a possibility, but we'd still have the huge memory usage. Unless opers realize how much memory a regex takes, I can see us getting tons of "we have 50 users and Unreal is using 500MB of RAM!" complaints.
-- codemastr

McTerry
Posts: 64
Joined: Tue Oct 19, 2004 12:42 am
Location: *.se
Contact:

Post by McTerry » Sun Jan 16, 2005 7:21 pm

It could work if all channels was saved in an editable database where all channels had their own file.
Then you could probably change it for each channel you want.
BOOM!

Syzop
UnrealIRCd head coder
Posts: 1957
Joined: Sat Mar 06, 2004 8:57 pm
Location: .nl
Contact:

Post by Syzop » Sun Jan 16, 2005 9:07 pm

Exactly, slow, eating way too much mem and scary.

This also been suggested again in #2267 btw.

Basically what we concluded is that rather we should experiment with glob matching (simple stuff with * and ?), similar to the way the "simple badwords" (non-regex!) work.. then it doesn't require much memory (only the ban strings [+stack]), it's very fast and match() has been well tested.

I promised in #2267 to take a look at coding a module in the upcoming week, a module that would add a ~G extban for this (eg: +b ~G:*idiot*, or with something like ~G:block:*idiot*, I don't know yet)..

Post Reply