Mail fail2ban

Bonjour.

J’utilise postfix avec dovecot et je voudrais envoyé le mail de fail2ban.
J’ai configuré le /etc/aliases comme il faut et les mails sont bien transféré au root avec certains programme.
Par contre avec fail2ban j’ai des difficulté car je ne c’est pas quoi mettre dans le mta.

Merci de m’indiquer la manip pour envoyé les mails avec postfix avec fail2ban.

Merci

Salut à toi prohand,

voici les fichiers de config fail2ban présent chez moi :

/etc/default/fail2ban /etc/fail2ban /etc/fail2ban/filter.d /etc/fail2ban/filter.d/apache-auth.conf /etc/fail2ban/filter.d/qmail.conf /etc/fail2ban/filter.d/apache-overflows.conf /etc/fail2ban/filter.d/sshd-ddos.conf /etc/fail2ban/filter.d/apache-badbots.conf /etc/fail2ban/filter.d/exim.conf /etc/fail2ban/filter.d/postfix.conf /etc/fail2ban/filter.d/wuftpd.conf /etc/fail2ban/filter.d/webmin-auth.conf /etc/fail2ban/filter.d/sieve.conf /etc/fail2ban/filter.d/vsftpd.conf /etc/fail2ban/filter.d/couriersmtp.conf /etc/fail2ban/filter.d/proftpd.conf /etc/fail2ban/filter.d/pure-ftpd.conf /etc/fail2ban/filter.d/gssftpd.conf /etc/fail2ban/filter.d/cyrus-imap.conf /etc/fail2ban/filter.d/apache-noscript.conf /etc/fail2ban/filter.d/sshd.conf /etc/fail2ban/filter.d/courierlogin.conf /etc/fail2ban/filter.d/common.conf /etc/fail2ban/filter.d/xinetd-fail.conf /etc/fail2ban/filter.d/apache-nohome.conf /etc/fail2ban/filter.d/named-refused.conf /etc/fail2ban/filter.d/pam-generic.conf /etc/fail2ban/filter.d/lighttpd-fastcgi.conf /etc/fail2ban/filter.d/sasl.conf /etc/fail2ban/filter.d/php-url-fopen.conf /etc/fail2ban/action.d /etc/fail2ban/action.d/mail-buffered.conf /etc/fail2ban/action.d/mail.conf /etc/fail2ban/action.d/ipfilter.conf /etc/fail2ban/action.d/hostsdeny.conf /etc/fail2ban/action.d/mynetwatchman.conf /etc/fail2ban/action.d/iptables-allports.conf /etc/fail2ban/action.d/complain.conf /etc/fail2ban/action.d/iptables-multiport-log.conf /etc/fail2ban/action.d/iptables-new.conf /etc/fail2ban/action.d/iptables-multiport.conf /etc/fail2ban/action.d/dshield.conf /etc/fail2ban/action.d/sendmail-whois-lines.conf /etc/fail2ban/action.d/iptables.conf /etc/fail2ban/action.d/mail-whois.conf /etc/fail2ban/action.d/sendmail-buffered.conf /etc/fail2ban/action.d/mail-whois-lines.conf /etc/fail2ban/action.d/shorewall.conf /etc/fail2ban/action.d/sendmail-whois.conf /etc/fail2ban/action.d/ipfw.conf /etc/fail2ban/action.d/sendmail.conf /etc/fail2ban/jail.conf /etc/fail2ban/fail2ban.conf /etc/init.d /etc/init.d/fail2ban /etc/logrotate.d /etc/logrotate.d/fail2ban
A toi de configurer pour la réception mail … :wink:

Merci mais dans le jail.local dans le champ mta je ne c’est pas quoi mettre et je ne c’est pas si dest = root passe.

Merci

Re,

Pour la réception de tes mails c’est ici :

nano -c /etc/fail2ban/jail.conf
en ligne 34 : “destemail = root@localhost” … remplace “root@localhost” par ton adresses mail

[code]# Destination email address used solely for the interpolations in

jail.{conf,local} configuration files.

destemail = prohand@gmail.com

… par exemple > destemail = prohand@gmail.com
[/code]

:wink:

Ok et le mta pour postfix je met mta = postfix ? mail ? sendmail ?

Merci

Re,

sendmail me paraît correct ! … laisse tel que … 8)

[code]# email action. Since 0.8.1 upstream fail2ban uses sendmail

MTA for the mailing. Change mta configuration parameter to mail

if you want to revert to conventional ‘mail’.

mta = sendmail
[/code]

Je viens de tester mais rien dans les logs qui indique qu’un mail est envoyé via fail2ban

Fail2ban a t’il quelque chose à te dire … pas nécessairement … il ne peut inventer une quelconque intrusion relever !

Un peu de lecture … fail2ban.org/wiki/index.php/Main_Page:wink:

Oui je ne suis pas bête a ce point enfin je ne pense pas.
J’ai simulé une attaque via le ssh.
Et pas de mail.

Personne ?

Salut,

je ne pense vraiment pas que ce soit l’envoie de mail qui soit en cause … mais belle et bien tes configurations … à revoir ! … :whistle:

On peut savoir comment et à partir d’où tu as “simulé une attaque” ?

J’ai ouvert une fenêtre putty j’ai mis l’utilisateur root et j’ai appuyé fois sur entrer jusqu’à ce qu’il me dise que je ne peux plus me connecter.

[quote=“loreleil.747”]Salut,

je ne pense vraiment pas que ce soit l’envoie de mail qui soit en cause … mais belle et bien tes configurations … à revoir ! … :whistle:[/quote]

Les configurations je penses elle sont bonne car dans le mta j’ai bien sendmail. J’ai juste changé le destmail par mon mail.

Personne ?

Merci

?

Merci

Personne ?

Merci

Personne ne peux m’aider ?

Aucune idée ?

D’après le HowTo de Fail2ban,

“It will send a notification e-mail. Just replace the dest parameter with your e-mail address. Be aware that the mail script uses the mail command of the system. Ensure this command works on your box.”

essaye de remplacer ton adresse mail par root@localhost.

Toujours pareil.