Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 228597 - net-analyzer/fail2ban-0.8.0-r2 needs additional dependencies for whois and mail commands
Summary: net-analyzer/fail2ban-0.8.0-r2 needs additional dependencies for whois and ma...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-20 17:23 UTC by Guido Winkelmann
Modified: 2008-08-08 22:57 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Winkelmann 2008-06-20 17:23:58 UTC
The default configuration of fail2ban will try to mail the system administrator about every time an IP address has been banned, including the whois info about the IP in question. To that end, it uses the mail and whois commands, and simply assumes that these are available.

Because of this, the ebuild ought to depend on net-misc/whois plus some package or virtual that provides a "mail" command. (Apparently postfix doesn't.)

Reproducible: Always

Steps to Reproduce:
1. Install fail2ban on a fresh system
2. Change /etc/fail2ban/jail.conf to enable the ssh-iptables jail (and change the mail address in there to your own)
3. Start the fail2ban server.
4. Trigger the autobanning by making a few failed login attempts from some IP that you don't mind banning.

Actual Results:  
The following is found in /var/log/fail2ban.log:
====
2008-06-20 11:29:57,102 fail2ban.actions.action: ERROR  echo -en "Hi,\n
The IP 121.140.91.106 has just been banned by Fail2Ban after
5 attempts against SSH.\n\n
Here are more information about 121.140.91.106:\n
`whois 121.140.91.106`\n
Regards,\n
Fail2Ban"|mail -s "[Fail2Ban] SSH: banned 121.140.91.106" xxxxx@xxxxxxxx.xx returned 7f00
====

Expected Results:  
An email should be sent to the address configured in /etc/fail2ban/jail.conf

# emerge --info
Portage 2.1.4.4 (default/linux/sparc/2008.0, gcc-4.1.2, glibc-2.6.1-r0, 2.6.23-gentoo-r9 sparc64)
=================================================================
System uname: 2.6.23-gentoo-r9 sparc64 sun4u
Timestamp of tree: Tue, 10 Jun 2008 17:15:01 +0000
app-shells/bash:     3.2_p33
dev-lang/python:     2.4.4-r13
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.61-r1
sys-devel/automake:  1.7.9-r1, 1.10.1
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.24
ACCEPT_KEYWORDS="sparc"
CBUILD="sparc-unknown-linux-gnu"
CFLAGS="-O2 -mcpu=ultrasparc -pipe"
CHOST="sparc-unknown-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -mcpu=ultrasparc -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="ftp://gentoo.tiscali.nl/pub/mirror/gentoo/ http://gentoo.tiscali.nl/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="acl apache2 bash-completion berkdb bzip2 cli cracklib crypt ctype cups dri fortran gcc64 gd gdbm gpm iconv isdnlog midi mudflap multilib ncurses nls nptl nptlonly openmp pam pcre perl postgres pppd python readline reflection sasl session sparc spl ssl subversion svnserve tcpd unicode xorg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint mach64 mga r128 radeon sunbw2 suncg14 suncg3 suncg6 sunffb sunleo tdfx voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Steve Moerk 2008-07-30 18:06:30 UTC
(In reply to comment #0)
> The default configuration of fail2ban will try to mail the system administrator
(snip)
> 2. Change /etc/fail2ban/jail.conf to enable the ssh-iptables jail (and change
> the mail address in there to your own)

Just my $0.02, but the default configuration makes no assumptions about the presence of any helper programs. You enabled a jail that required mail, whois, and iptables. I might only use a jail that requires none of these programs to be installed. There are any number of programs that fail2ban MIGHT call if the corresponding jail is enabled, and IMHO it would be bad to depend on all of them.
Comment 2 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2008-08-08 22:57:13 UTC
i fully agree with latest comment. Argue if you disagree. Closing without activity on that bug.