fail2ban et roundcube : Différence entre versions

De Vulgum Techus
Aller à : Navigation, rechercher
(Articles Vulgum Techus)
Ligne 1 : Ligne 1 :
  '''[[Lien court]]''' vers cette page : http://vt.cx/f2br
+
<!-- Links checked 05/04/19 -->
  '''[[QR code]]''' vers cette page : http://vt.cx/f2br.qr
+
[[Catégorie:Linux]]
 
+
[[Catégorie:Sécurité]]
 +
  '''[[Lien court]]''' vers cette page : https://vt.cx/f2br
 +
  '''[[QR code]]''' vers cette page : https://vt.cx/f2br.qr
 
<html>
 
<html>
<script type="text/javascript"><!--
+
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
google_ad_client = "ca-pub-3341840374417340";
+
<!-- VT2 -->
/* VT2 */
+
<ins class="adsbygoogle"
google_ad_slot = "6349432125";
+
    style="display:inline-block;width:468px;height:60px"
google_ad_width = 468;
+
    data-ad-client="ca-pub-3341840374417340"
google_ad_height = 60;
+
    data-ad-slot="6349432125"></ins>
//-->
+
<script>
</script>
+
(adsbygoogle = window.adsbygoogle || []).push({});
<script type="text/javascript"
+
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+
 
</script>
 
</script>
 
</html>
 
</html>
<br/>
 
  
 
= Présentation =
 
= Présentation =

Version du 5 avril 2019 à 23:06

Lien court vers cette page : https://vt.cx/f2br
QR code vers cette page : https://vt.cx/f2br.qr

Présentation

Par défaut, fail2ban ne surveille pas les accès à la messagerie roundcube et impose une configuration ad hoc pour y parvenir. Le présent article explique ce qu'il convient de faire selon que l'on utilise Plesk ou non.

Procédure

Ajouter à :

/etc/fail2ban/jail.local

le code suivant (choisir l'une des 2 lignes logpath selon le cas) :

[roundcube]
enabled  = true
port     = http,https
filter   = roundcube
action   = iptables-multiport[name=roundcube, port="http,https"]
           sendmail-whois[name=Roundcube, dest=root, sender=fail2ban@domain.tld] # ligne utile si l'on souhaite recevoir un mail à chaque blocage. Sinon la supprimer
logpath  = /var/log/plesk-roundcube/errors # Avec Plesk
ou logpath  = <dossier d'installation de Roundcube>/logs/errors # Sans Plesk

Créer

/etc/fail2ban/filter.d/roundcube.conf

avec le contenu suivant :

[Definition]
failregex = Login failed for .* from <HOST>
ignoreregex =

Créer le commande de rotation du fichier log dans :

/etc/logrotate.d/roundcube

avec le contenu suivant :

/var/log/plesk-roundcube/errors {
        missingok 
        rotate 8
        compress
        notifempty
        weekly
}

Modifier (Plesk uniquement)

/usr/share/psa-roundcube/config/main.inc.php

comme suit :

// Log successful logins to <log_dir>/userlogins or to syslog
$rcmail_config['log_logins'] = true;
// Log session authentication errors to <log_dir>/session or to syslog
$rcmail_config['log_session'] = true;

Relancer fail2ban par :

service fail2ban restart

Articles Vulgum Techus

Commentaires

blog comments powered by Disqus