Koozali.org: home of the SME Server

Dovecot - Protection contre la force brute ?

Offline gieres

  • *
  • 213
  • +0/-0
Dovecot - Protection contre la force brute ?
« on: September 02, 2023, 04:45:36 PM »
Bonjour,
Depuis quelques jours, il y a des attaques (?) de dovecot de ce type :
Code: [Select]
--------------------- pam_unix Begin ------------------------

 dovecot:
    Authentication Failures:
       admin-help: 428 Time(s)
       postmaster-relay: 399 Time(s)
       som: 336 Time(s)
       anonymous: 326 Time(s)
       casa: 323 Time(s)
       0: 318 Time(s)
       sacha: 305 Time(s)
       root: 36 Time(s)
       abuse: 35 Time(s)
       admin: 32 Time(s)
       postmaster: 29 Time(s)
       mailer-daemon: 28 Time(s)
       alice: 3 Time(s)
       broad: 3 Time(s)
       comet2: 3 Time(s)
       infoserv: 3 Time(s)
       jb: 3 Time(s)
       maxpayne: 3 Time(s)
       mon2: 3 Time(s)
       silent: 3 Time(s)
       u2: 3 Time(s)
       whatever43: 3 Time(s)
       youth: 3 Time(s)
       263: 2 Time(s)
       3201: 2 Time(s)
       AD: 2 Time(s)
       Acrostichum: 2 Time(s)
       Assets: 2 Time(s)
       LoginForm: 2 Time(s)
       Reflector: 2 Time(s)
       abramov: 2 Time(s)
       accepted: 2 Time(s)
       ail: 2 Time(s)
       antares: 2 Time(s)
       anton1: 2 Time(s)
       apriline: 2 Time(s)
       area: 2 Time(s)
       arny: 2 Time(s)
       asd: 2 Time(s)
       asdfg123: 2 Time(s)
       baan: 2 Time(s)
       bans: 2 Time(s)
       basildonian: 2 Time(s)
       basin: 2 Time(s)
       behrmann: 2 Time(s)
       benjamin: 2 Time(s)
       bianca: 2 Time(s)
       bilder: 2 Time(s)
       bit: 2 Time(s)
       blackbird-amsterdam: 2 Time(s)
       bradfield: 2 Time(s)
       brighton: 2 Time(s)
       broken: 2 Time(s)
       cai: 2 Time(s)
       cecelia: 2 Time(s)
       chaoping: 2 Time(s)
       chris1: 2 Time(s)
       chu-tin: 2 Time(s)
       collab: 2 Time(s)
       collect: 2 Time(s)
       compaq: 2 Time(s)
       console: 2 Time(s)
       constanza: 2 Time(s)
       corvair: 2 Time(s)
       cpanel.demo: 2 Time(s)
       ctf: 2 Time(s)
       ctm: 2 Time(s)
       current: 2 Time(s)
       darklord: 2 Time(s)
       dc2: 2 Time(s)
       diah: 2 Time(s)
       doit: 2 Time(s)
       dori: 2 Time(s)
       drweb: 2 Time(s)
       dse: 2 Time(s)
       dude: 2 Time(s)
       duo: 2 Time(s)
       econ: 2 Time(s)
       elefante: 2 Time(s)
       elektro: 2 Time(s)
       elvis: 2 Time(s)
       encounter: 2 Time(s)
       eva: 2 Time(s)
       fabian: 2 Time(s)
       feng: 2 Time(s)
       form: 2 Time(s)
       forthcome: 2 Time(s)
       gib: 2 Time(s)
       gimli: 2 Time(s)
       gloriam: 2 Time(s)
       granite: 2 Time(s)
       grt: 2 Time(s)
       gus: 2 Time(s)
       harada: 2 Time(s)
       harish: 2 Time(s)
       hc: 2 Time(s)
       helga: 2 Time(s)
       hoo: 2 Time(s)
       iam: 2 Time(s)
       informix: 2 Time(s)
       install: 2 Time(s)
       ipcam: 2 Time(s)
       jimu: 2 Time(s)
       jjh: 2 Time(s)
       jsanchez: 2 Time(s)
       kayako: 2 Time(s)
       kibana: 2 Time(s)
       kisskiss: 2 Time(s)
       kolokol: 2 Time(s)
       kops: 2 Time(s)
       lavinia: 2 Time(s)
       letters: 2 Time(s)
       levi: 2 Time(s)
       linksrv: 2 Time(s)
       literacy: 2 Time(s)
       luiza: 2 Time(s)
       luping: 2 Time(s)
       lyn: 2 Time(s)
       lyncdiscover: 2 Time(s)
       malcolm: 2 Time(s)
       mariam: 2 Time(s)
       marylou: 2 Time(s)
       massage: 2 Time(s)
       mc1: 2 Time(s)
       mccarthy: 2 Time(s)
       medved: 2 Time(s)
       mirko: 2 Time(s)
       monali: 2 Time(s)
       mtm: 2 Time(s)
       mtz: 2 Time(s)
       mx25: 2 Time(s)
       nadya: 2 Time(s)
       nataly: 2 Time(s)
       nec: 2 Time(s)
       news2: 2 Time(s)
       nine: 2 Time(s)
       oaadmin: 2 Time(s)
       offerte: 2 Time(s)
       ogawa: 2 Time(s)
       oh: 2 Time(s)
       oj: 2 Time(s)
       oki: 2 Time(s)
       opennms: 2 Time(s)
       p3: 2 Time(s)
       pasta: 2 Time(s)
       pav: 2 Time(s)
       pearl1: 2 Time(s)
       pegas: 2 Time(s)
       pit: 2 Time(s)
       pluton: 2 Time(s)
       postmasters: 2 Time(s)
       privacy: 2 Time(s)
       ps3: 2 Time(s)
       pz: 2 Time(s)
       qazwsx123: 2 Time(s)
       queen: 2 Time(s)
       rdavila: 2 Time(s)
       registro: 2 Time(s)
       reinaldo: 2 Time(s)
       remarks: 2 Time(s)
       renamefile: 2 Time(s)
       requestcompression: 2 Time(s)
       richter: 2 Time(s)
       s3cret: 2 Time(s)
       sheri: 2 Time(s)
       siteadmin: 2 Time(s)
       skinny: 2 Time(s)
       smtpmax: 2 Time(s)
       sobranie: 2 Time(s)
       society: 2 Time(s)
       sp1: 2 Time(s)
       srodriguez: 2 Time(s)
       srvc22: 2 Time(s)
       sweety2: 2 Time(s)
       swf: 2 Time(s)
       sztz: 2 Time(s)
       teams: 2 Time(s)
       test19: 2 Time(s)
       test9: 2 Time(s)
       tiffany: 2 Time(s)
       timothy: 2 Time(s)
       tome: 2 Time(s)
       trigger: 2 Time(s)
       tuyensinh: 2 Time(s)
       ua2: 2 Time(s)
       valentin: 2 Time(s)
       vandal: 2 Time(s)
       vianney: 2 Time(s)
       volta: 2 Time(s)
       webteam: 2 Time(s)
       weidong: 2 Time(s)
       wong: 2 Time(s)
       wuge: 2 Time(s)
       yusuf: 2 Time(s)
       zbigniew: 2 Time(s)
       zip: 2 Time(s)
       000: 1 Time(s)
       0000: 1 Time(s)
       008: 1 Time(s)
       1: 1 Time(s)
       100: 1 Time(s)
       1007238: 1 Time(s)
       109: 1 Time(s)
       111111111: 1 Time(s)
       112061: 1 Time(s)
       12121946: 1 Time(s)
       123123: 1 Time(s)
       123555: 1 Time(s)
       123qwe: 1 Time(s)
       14: 1 Time(s)
       158: 1 Time(s)
       186: 1 Time(s)
       19721972: 1 Time(s)
       1ab: 1 Time(s)
       1qa2ws: 1 Time(s)
       200: 1 Time(s)
       2112: 1 Time(s)
       219: 1 Time(s)
       2232: 1 Time(s)
       2252: 1 Time(s)
       33: 1 Time(s)
       350: 1 Time(s)
       44444: 1 Time(s)
       5065: 1 Time(s)
       ALEX: 1 Time(s)
       ATLAS: 1 Time(s)
       Aaterfinns: 1 Time(s)
       Adela: 1 Time(s)
       Admin: 1 Time(s)
       Administrators: 1 Time(s)
       Ahepatokla: 1 Time(s)
       Aileen: 1 Time(s)
       Amelie: 1 Time(s)
       Amphinesian: 1 Time(s)
       Ana: 1 Time(s)
       Apocynum: 1 Time(s)
       Apoio: 1 Time(s)
       AttachmentName: 1 Time(s)
       AuthChildForm: 1 Time(s)
       BACKUP: 1 Time(s)
       BD: 1 Time(s)
       Boff: 1 Time(s)
       Bykkonen: 1 Time(s)
       CHIEF: 1 Time(s)
       Charles: 1 Time(s)
       Collation: 1 Time(s)
       Computer: 1 Time(s)
       Dragon: 1 Time(s)
       ER: 1 Time(s)
       EXPORTTABLE: 1 Time(s)
       Email: 1 Time(s)
       Engineer1: 1 Time(s)
       FaysaL: 1 Time(s)
       Filename: 1 Time(s)
       Georgebuck: 1 Time(s)
       Graphics: 1 Time(s)
       HOST: 1 Time(s)
       Hallucinations: 1 Time(s)
       INDEXCOLUMNLIST: 1 Time(s)
       Jackson: 1 Time(s)
       Jincheng: 1 Time(s)
       KOY: 1 Time(s)
       Katowice: 1 Time(s)
       LLL: 1 Time(s)
       Labor: 1 Time(s)
       Lixin: 1 Time(s)
       MCCAA: 1 Time(s)
       MESLER: 1 Time(s)
       Monitor: 1 Time(s)
       ODS: 1 Time(s)
       Olaussen: 1 Time(s)
       Oncology: 1 Time(s)
       Other: 1 Time(s)
       P: 1 Time(s)
       PDP: 1 Time(s)
       Patches: 1 Time(s)
       Peters: 1 Time(s)
       Portal: 1 Time(s)
       Postgres: 1 Time(s)
       ROLLE: 1 Time(s)
       RegisterForm: 1 Time(s)
       Relay: 1 Time(s)
       Richard: 1 Time(s)
       Rimslut: 1 Time(s)
       Rita: 1 Time(s)
       SAMLResponse: 1 Time(s)
       SANDBOX_README: 1 Time(s)
       SERGEI: 1 Time(s)
       SQLServer: 1 Time(s)
       Save: 1 Time(s)
       School: 1 Time(s)
       Sender: 1 Time(s)
       Senna: 1 Time(s)
       Shooter: 1 Time(s)
       SpamCheck: 1 Time(s)
       Status: 1 Time(s)
       Stephen: 1 Time(s)
       Strickland: 1 Time(s)
       SunShine: 1 Time(s)
       Sunshine: 1 Time(s)
       TEST5: 1 Time(s)
       TTTT: 1 Time(s)
       Thorstein: 1 Time(s)
       VIVI: 1 Time(s)
       VMAIL: 1 Time(s)
       WEBADMIN: 1 Time(s)
       Widget: 1 Time(s)
       Yezi: 1 Time(s)
       _savedok_x: 1 Time(s)
       _savedokview_x: 1 Time(s)
       aaaa: 1 Time(s)
       aabbcc: 1 Time(s)
       aarancibia: 1 Time(s)
       aarp: 1 Time(s)
       aavila: 1 Time(s)
       abababab: 1 Time(s)
       abas: 1 Time(s)
       abc1234: 1 Time(s)
       abc12345: 1 Time(s)
       abcde: 1 Time(s)
       abdulnasir: 1 Time(s)
       aben: 1 Time(s)
       abena1: 1 Time(s)
       abhay: 1 Time(s)
       abhishek: 1 Time(s)
       abp: 1 Time(s)
       abrt: 1 Time(s)
       aca: 1 Time(s)
       academics: 1 Time(s)
       accelerator: 1 Time(s)
       account_newsletters: 1 Time(s)
       accountid: 1 Time(s)
       accreditation: 1 Time(s)
       acessoainformacao: 1 Time(s)
       acp: 1 Time(s)
       act: 1 Time(s)
       activity: 1 Time(s)
       ad3: 1 Time(s)
       adad: 1 Time(s)
       adams: 1 Time(s)
       aday: 1 Time(s)
       added: 1 Time(s)
       addmeta: 1 Time(s)
       address1: 1 Time(s)
       ade: 1 Time(s)
       adela: 1 Time(s)
       adit: 1 Time(s)
       aditya: 1 Time(s)
       adm2: 1 Time(s)
       admin_test: 1 Time(s)
       admina: 1 Time(s)
       admissions: 1 Time(s)
       adriana: 1 Time(s)
       adriel: 1 Time(s)
       adrienne: 1 Time(s)
       adscriptitius: 1 Time(s)
       adwords: 1 Time(s)
       adx: 1 Time(s)
       affiliates: 1 Time(s)
       afiliado: 1 Time(s)
       afiliados: 1 Time(s)
       aftermarket-robotech: 1 Time(s)
       agatin: 1 Time(s)
       agencia: 1 Time(s)
       agglutinative: 1 Time(s)
       agile: 1 Time(s)
       agreement: 1 Time(s)
       agri: 1 Time(s)
       agronomia: 1 Time(s)
       agung: 1 Time(s)
       ahctv: 1 Time(s)
       ahudson: 1 Time(s)
       aide: 1 Time(s)
       aileen: 1 Time(s)
       aimee: 1 Time(s)
       aimi: 1 Time(s)
       aims: 1 Time(s)
       ainsleigh: 1 Time(s)
       aion: 1 Time(s)
       ais: 1 Time(s)
       aistest: 1 Time(s)
       aito: 1 Time(s)
       aitor: 1 Time(s)
       ajohnson: 1 Time(s)
       ajones: 1 Time(s)
       ajxaction: 1 Time(s)
       akane: 1 Time(s)
       akashi: 1 Time(s)
       ala: 1 Time(s)
       alain2: 1 Time(s)
       albany: 1 Time(s)
       albertine: 1 Time(s)
       aleksandr: 1 Time(s)
       aleksey: 1 Time(s)
       alexhot: 1 Time(s)
       alexina: 1 Time(s)
       alfa: 1 Time(s)
       algarve: 1 Time(s)
       algy: 1 Time(s)
       alimentacion: 1 Time(s)
       alive: 1 Time(s)
       alk: 1 Time(s)
       allan: 1 Time(s)
       allianora: 1 Time(s)
       allo: 1 Time(s)
       allusers: 1 Time(s)
       almoxarifado: 1 Time(s)
       alnan: 1 Time(s)
       aloha: 1 Time(s)
       alumno: 1 Time(s)
       amado: 1 Time(s)
       amalia: 1 Time(s)
       aman: 1 Time(s)
       amano: 1 Time(s)
       amar: 1 Time(s)
       amms: 1 Time(s)
       amp: 1 Time(s)
       amp-scanner: 1 Time(s)
       anamaria: 1 Time(s)
       anand: 1 Time(s)
       andante: 1 Time(s)
       andie: 1 Time(s)
       andina: 1 Time(s)
       andre123: 1 Time(s)
       andrew: 1 Time(s)
       anet: 1 Time(s)
       angela: 1 Time(s)
       angelica: 1 Time(s)
       anime: 1 Time(s)
       ankang: 1 Time(s)
       anna123: 1 Time(s)
       annacc: 1 Time(s)
       annaruth: 1 Time(s)
       annualreport: 1 Time(s)
       ant: 1 Time(s)
       antaiva: 1 Time(s)
       antanas: 1 Time(s)
       anthony: 1 Time(s)
       antony: 1 Time(s)
       anu: 1 Time(s)
       anucha: 1 Time(s)
       anzen: 1 Time(s)
       ap2: 1 Time(s)
       ap3: 1 Time(s)
       apa: 1 Time(s)
       apc1: 1 Time(s)
       apiv3-dev: 1 Time(s)
       apm: 1 Time(s)
       apofis: 1 Time(s)
       apparel-de: 1 Time(s)
       apple12: 1 Time(s)
       appleid: 1 Time(s)
       application: 1 Time(s)
       appmail: 1 Time(s)
       approved: 1 Time(s)
       apptest: 1 Time(s)
       april: 1 Time(s)
       ara: 1 Time(s)
       aragon: 1 Time(s)
       arbeit: 1 Time(s)
       arch: 1 Time(s)
       archi: 1 Time(s)
       archiv: 1 Time(s)
       archiver: 1 Time(s)
       arduino: 1 Time(s)
       areaclienti: 1 Time(s)
       argos: 1 Time(s)
       arihant: 1 Time(s)
       ark: 1 Time(s)
       arkansas: 1 Time(s)
       arnold: 1 Time(s)
       arsenal: 1 Time(s)
       art2: 1 Time(s)
       articles: 1 Time(s)
       artist: 1 Time(s)
       artists: 1 Time(s)
       asa: 1 Time(s)
       asdf1234: 1 Time(s)
       asgard: 1 Time(s)
       asha: 1 Time(s)
       ashley: 1 Time(s)
       ashwin: 1 Time(s)
       asia: 1 Time(s)
       asp: 1 Time(s)
       aspire: 1 Time(s)
       asset: 1 Time(s)
       assis: 1 Time(s)
       association: 1 Time(s)
       ast: 1 Time(s)
       astrakhan: 1 Time(s)
       astrix: 1 Time(s)
       ata: 1 Time(s)
       att: 1 Time(s)
       attendance: 1 Time(s)
       atusi: 1 Time(s)
       auftrag: 1 Time(s)
       august: 1 Time(s)
       austin: 1 Time(s)
       authkey: 1 Time(s)
       authors: 1 Time(s)
       authtype: 1 Time(s)
       autodiscover.demo: 1 Time(s)
       automail: 1 Time(s)
       automation: 1 Time(s)
       autossh: 1 Time(s)
       autumn: 1 Time(s)
       auxiliary: 1 Time(s)
       ava: 1 Time(s)
       avahi-autoipd: 1 Time(s)
       avid: 1 Time(s)
       avin: 1 Time(s)
       avira: 1 Time(s)
       avis: 1 Time(s)
       awadhi: 1 Time(s)
       awesome: 1 Time(s)
       awhite: 1 Time(s)
       aws-cache: 1 Time(s)
       axelle: 1 Time(s)
       azhar: 1 Time(s)
       azurecom: 1 Time(s)
       b10: 1 Time(s)
       bac: 1 Time(s)
       bacchus: 1 Time(s)
       backends: 1 Time(s)
       bahir: 1 Time(s)
       baijialeyingqianfa: 1 Time(s)
       balay: 1 Time(s)
       balazs: 1 Time(s)
       bamboo: 1 Time(s)
       banger: 1 Time(s)
       banners: 1 Time(s)
       bannerweb: 1 Time(s)
       bansubmit: 1 Time(s)
       barcal: 1 Time(s)
       barney: 1 Time(s)
       barracuda: 1 Time(s)
       barry: 1 Time(s)
       bars: 1 Time(s)
       bart: 1 Time(s)
       ...
       zhaopin: 1 Time(s)
       zhidao: 1 Time(s)
       zhongshansijiazhentan: 1 Time(s)
       zhoujing: 1 Time(s)
       ziad: 1 Time(s)
       zizzo: 1 Time(s)
       zliu: 1 Time(s)
       zmail: 1 Time(s)
       zon1: 1 Time(s)
       zuli: 1 Time(s)
       zxcvb: 1 Time(s)
    Invalid Users:
       Unknown Account: 4723 Time(s)

Est-ce qu'il faut s'en soucier ?
Si oui, que faut-il mettre en oeuvre ?
D'avance merci.

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #1 on: September 02, 2023, 10:15:26 PM »
This is likely due to the recently updated smeserver-qpsmtpd package.

We moved from using cvm-unix authentication to imap authentication to fix this issue (that you reported....!)

https://forums.koozali.org/index.php/topic,54890.msg288782.html#msg288782
https://forums.koozali.org/index.php/topic,54571.msg286036.html#msg286036

Bug 12193 (it is a potential security bug so may not be visible)

So now you have lots of authentication failures, and no segfaults :-)

I would suggest you check for old accounts, and consider things like XT Geoip to cut down some of the noise.

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Jean-Philippe Pialasse

  • *
  • 2,765
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Dovecot - Protection contre la force brute ?
« Reply #2 on: September 03, 2023, 05:39:36 AM »
xt geoip peut reduire grandement le nombre de tentatives en diminuant le pool d’ip ayant acces au service.

fail2ban peut permettre de banir les ip tentant un bruteforce sur le service.  a condition que cela ne soit pas distribué.

globalememt tu as pu effectivement voir une augmentation sur imap car maintenant le service sert aussi bien pour imap que pour qpsmtpd

Offline gieres

  • *
  • 213
  • +0/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #3 on: September 04, 2023, 07:41:53 PM »
Bonjour,
@ReetP
We moved from using cvm-unix authentication to imap authentication to fix this issue (that you reported....!)
https://forums.koozali.org/index.php/topic,54890.msg288782.html#msg288782
You have a good memory !
GeoIP installed. Wait and see to-morrow report to adjust settings...

@JPP
a condition que cela ne soit pas distribué.
Je n'ai pas compris cette condition de non distribution.

@mab974
Superbe contribution ! J'en ai profité pour faire la page en français.
- L'entrée de GeoIP dans le menu Sécurité du gestionnaire du serveur n'est pas traduite. Je ne sais pas comment on fait ça.
- dans les réglages de GeoIP, parie « Filtrage par service pour Xtables GeoIP », il doit manquer des mots dans la phrase du bas : « Cliquer ici pour avoir une nouvelle services parmi une liste des services disponibles ».

Bonne journée.
« Last Edit: September 04, 2023, 09:04:17 PM by gieres »

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #4 on: September 05, 2023, 02:47:38 AM »
Bonjour,
@ReetPYou have a good memory !

No I don't. I just used the search button ;-)

But I did write the patch!!

Code: [Select]
GeoIP installed. Wait and see tomorrow report to adjust settings...
That should save you many headaches. Enjoy.

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline lurey

  • *
  • 78
  • +0/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #5 on: October 19, 2023, 07:02:18 PM »
Bonjour,
 . . . . Vous êtes formidables !
Je venais d'essayer de préparer une présentation du problème face auquel mon incompréhension (par ignorance) et mon incapacité à bloquer ce que je lisais comme une attaque massive m'amenaient à une inquiétude extrême, scrutant anxieusement des séries de logs que je ne lis que rarement d'habitude - du fait que je n'en comprends pas la moitié...
Je prends mon courage à deux mains pour venir plaider mon incompétence et quémander quelque aide de base, et...
 Voilà que "mon" problème est déjà débusqué, expliqué, qu'il n'est apparemment pas nouveau, simplement plus visible qu'avant, et que je ne suis donc pas dans une situation critique ou désespérée comme je l'ai cru - au point de déconnecter mon serveur du Net pendant 24 heures.
Et en plus de ça, vous donnez des idées de riposte !

Je viens de découvrir GeoIP et Fail2ban, d'essayer de comprendre au mieux, d'installer...
Certains de mes agresseurs sont déjà "en prison"  :lol:, mes logs désenflent...
Me voila un peu rassuré ! (...et peut-être un peu moins ignorant)

Merci !!
Bricoleur informatique, qui speak très mal english... merci de votre indulgence !

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #6 on: October 19, 2023, 07:27:32 PM »
:-)

 :hammer:    :pint:   !!

Thank you for searching and reading first!!
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline gieres

  • *
  • 213
  • +0/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #7 on: October 19, 2023, 10:22:44 PM »
@lurey
Pour info, il y a 200 adresses IP bloquées par fail2ban pour un mois, pas mal de pays qui sont bloqués par xtgeoip mais le nombre de tentatives de connexions à dovecot par pam_unix peut rester important : 9 279 lors du dernier rapport de Logwatch avec des noms d'utilisateurs de type force brute : tout le dictionnaire y passe.
Bonne soirée.

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #8 on: October 20, 2023, 01:51:40 AM »
Keep a track of the offending countries a d block anything not required.

One of my servers even has:

!=EN,FR,ES

:lol:

If you don't get mail from say CN,SG,RO,RU then just ban them entirely.

It saves a lot of work for fail2ban.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline lurey

  • *
  • 78
  • +0/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #9 on: October 20, 2023, 11:55:40 AM »
bonjour,

Avant-hier j'étais à plus de 10000 tentatives de "Unknown Account", hier redescendu à un peu plus de 4000 avec mise en place dans l'après-midi de GeoIP et Fail2ban...
2 adresses bloquées "Recidive" (adresses inconnues par GeoIP), trois en simple (qpsmtpd) depuis hier soir.
> en repérant les IP, j'avais bloqué au fur et à mesure :
(BadCountries) BR,CN,CR,DZ,IL,IN,KR,LT,MZ,MX,NA,PE,PL,RU,TW,UY
Un pays Nordique apparait, mais... j'ai des raisons de ne pouvoir bloquer par là ! j'espère que Fail2ban coincera progressivement ces adresses qui bombardent...

Si j'ai bien compris, GeoIP bloque avant, et du coup il n'y a pas de bannissement par Fail2ban des adresses en "BadContries" ?

Une question : Gieres disait
Quote
(...)
- L'entrée de GeoIP dans le menu Sécurité du gestionnaire du serveur n'est pas traduite.

Est-ce que je devrais avoir une entrée (non traduite) pour GeoIP dans le menu de la page d'administration (server-manager) ?
 (J'en ai bien une pour Fail2ban, mais pas pour GeoIP)
Bricoleur informatique, qui speak très mal english... merci de votre indulgence !

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #10 on: October 20, 2023, 12:26:43 PM »
bonjour,

Avant-hier j'étais à plus de 10000 tentatives de "Unknown Account", hier redescendu à un peu plus de 4000 avec mise en place dans l'après-midi de GeoIP et Fail2ban...

Excellent! Check the logs:

Code: [Select]
grep GeoIP /var/log/iptables/denylog.log
I believe XT_Geoip is more efficient/lower overhead than Fail2Ban.

Quote
2 adresses bloquées "Recidive" (adresses inconnues par GeoIP), trois en simple (qpsmtpd) depuis hier soir.
> en repérant les IP, j'avais bloqué au fur et à mesure :
(BadCountries) BR,CN,CR,DZ,IL,IN,KR,LT,MZ,MX,NA,PE,PL,RU,TW,UY
Un pays Nordique apparait, mais... j'ai des raisons de ne pouvoir bloquer par là ! j'espère que Fail2ban coincera progressivement ces adresses qui bombardent...

I also have SG and RO, but the ban lists will be your best guide.

Yes, Fail2Ban should pick up the remainder for you.

Quote
Si j'ai bien compris, GeoIP bloque avant, et du coup il n'y a pas de bannissement par Fail2ban des adresses en "BadContries" ?

Une question : Gieres disait
Est-ce que je devrais avoir une entrée (non traduite) pour GeoIP dans le menu de la page d'administration (server-manager) ?
 (J'en ai bien une pour Fail2ban, mais pas pour GeoIP)

GeoIP does not have a translation yet as far as I am aware so it is in English only (I think)
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline lurey

  • *
  • 78
  • +0/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #11 on: October 20, 2023, 01:01:48 PM »
Hello ReetP
Quote
Check the logs: /var/log/iptables/denylog.log
I went to see   :shock:...13 177 lines/entries since 3 a.m.!

No GeoIP configuration page appears in my server-manager. Is it just because there is no translation? (is there one in English, and shouldn't it appear in English, by default?)
have a good day !

---------- (a bit later added)-------

I just see, you talk of XT-GeoIP, there is apparently 2 "Geoip" :
> sme-geoip - that Y installed , see https://wiki.koozali.org/GeoIP
> sme-xt-geoip , see https://wiki.koozali.org/Xt_geoip
Is "XT" better ? (and... with a server-manager page, even if it has no translation ?
« Last Edit: October 20, 2023, 01:33:51 PM by lurey »
Bricoleur informatique, qui speak très mal english... merci de votre indulgence !

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #12 on: October 20, 2023, 03:28:47 PM »
Hello ReetP

I went to see   :shock:...13 177 lines/entries since 3 a.m.!

Indeed..... At least it is working :-)

Quote
No GeoIP configuration page appears in my server-manager. Is it just because there is no translation? (is there one in English, and shouldn't it appear in English, by default?)
have a good day !

---------- (a bit later added)-------

I just see, you talk of XT-GeoIP, there is apparently 2 "Geoip" :
> sme-geoip - that Y installed , see https://wiki.koozali.org/GeoIP
> sme-xt-geoip , see https://wiki.koozali.org/Xt_geoip
Is "XT" better ? (and... with a server-manager page, even if it has no translation ?

Well, XT blocks for all ports, not just mail.

If you are getting hammered I would use it and block the countries that are just hackers and you have no contact with.

So for example you can block all countries accessing SSH except say FR with something like:

!=FR

It is pretty powerful, though it probably needs some more refinement and options. See

https://bugs.koozali.org/show_bug.cgi?id=12418

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline lurey

  • *
  • 78
  • +0/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #13 on: October 20, 2023, 04:53:46 PM »
OK, thanks for explanations...
I'll see about changing in the few next days.
I hope I can uninstall my "GeoIP" and replace with Xt-GeoIP  without negative interference between them
Merci !
Bricoleur informatique, qui speak très mal english... merci de votre indulgence !

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #14 on: October 20, 2023, 06:20:47 PM »
I think they co-exist so you will be fine.It should tell you if they clash.

You do not need to uninstall anything.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline Jean-Philippe Pialasse

  • *
  • 2,765
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: Dovecot - Protection contre la force brute ?
« Reply #15 on: October 20, 2023, 06:39:51 PM »
tu as besoin de configurer geoip pour que xt_geoip puisse fonctionner car ce dernier a besoin des bases de données de maxmind dans un format specifique.

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #16 on: October 21, 2023, 02:15:01 AM »
^^^^^^^^^

What he said :lol:

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline lurey

  • *
  • 78
  • +0/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #17 on: October 21, 2023, 01:34:35 PM »
…actuellement, c'es donc GeIP qui tourne sur mon serveur, installé et configuré selon les indications du wiki correspondant, à savoir (après avoir ouvert un compte Maxmind:
Quote
[root@serveur]# yum install smeserver-geoip --enablerepo=smecontribs
[root@serveur]# db configuration setprop geoip LicenseKey [mon n° de licence] AccountID [mon ID]
[root@serveur]# expand-template  /etc/GeoIP.conf
[root@serveur]# signal-event geoip-update
[root@serveur]# config setprop qpsmtpd BadCountries BR,CN,CR,DZ,IL,IN,JP,KR,LT,MZ,MX,NA,PE,PL,RU,TW,UY
( > pour ajouter un pays, il faut remettre toute la liste à la suite de cette commande)
[root@serveur]# signal-event email-update
Je crois comprendre que le moteur est le même pour XT-GeoIP, un peu comme si XT- mettait une "couche supplémentaire" à GeIP ? ...excusez-moi si mes approximations sont absurdes, c'est pour moi une manière d'interpréter la logique de
I think they co-exist so you will be fine.It should tell you if they clash.
You do not need to uninstall anything.

Est-ce à dire que les éléments rentrés en db vont être repris lors de l'install de XT- … ou vont être écrasés ?
Et donc à cette indication :
tu as besoin de configurer geoip pour que xt_geoip puisse fonctionner car ce dernier a besoin des bases de données de maxmind dans un format specifique.
Ma question est : quoi de plus (ou de différent) de ce qui est déjà fait à l'install de la version (simple) de GeoIP ?

Merci de votre soutien !
Bricoleur informatique, qui speak très mal english... merci de votre indulgence !

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #18 on: October 21, 2023, 02:22:17 PM »
Standard GeoIP adds the Maxmind DBs and enables geoip support directly in qpsmtpd via a qpsmtpd plugin.

Xt_geoip adds a kernel module and blocks countries via iptables and service port so it can block other servicees beyond just mail eg ssh, imap etc.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline lurey

  • *
  • 78
  • +0/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #19 on: October 21, 2023, 03:28:57 PM »
OK,
So if xt- is installed, it can block several services - including those that the standard version can block (mail)
? Then, if I install xt-geoip, standard-geoip becomes useless  ...Or How is it interesting that they coexist?
( Possibly to stay protected while installing and configuring xt-geoip ? but in that case, could afterwards-uninstalling (standard-)geoip corrupt Xt-geoip's installation?
...
And I don't know how to understand JPh.Pialasse's "you need to configure geoip for xt-geoip to work because the latter needs maxmind databases in a specific format."...
- I imagine that I'll use the same account at Maxmind.
- in Xt-geoip wiki, Key and ID are registred with the same command I made for (standard)geoip :
Quote
# db configuration setprop geoip LicenseKey [mon n° de licence] AccountID [mon ID]
(...and I already have:)
# config show geoip
geoip=service
   AccountID=my ID
   LicenseKey=my licence n°
   status=enabled
Will installing Xt-geoip overwrite this? or use this command differently...?

...sorry for my bad-google-english (...and clumsy attempts to understand despite little skills! )
Bricoleur informatique, qui speak très mal english... merci de votre indulgence !

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #20 on: October 21, 2023, 04:01:31 PM »
Your Franglish is fine :-)

Mejor que mi Frances....  ;-)

smeserver-geoip will handle the Maxmind DBs which xt needs to use.

They can coexist as they do things differently.

As I said, Geoip works via a qpsmtpd plugin.

Xt_Geoip works via a kernel module + iptables. It uses the GeoIP key information.

If you run xt then the qpsmtpd plugin will just do less work!!

Both use the same Maxmind database.

So don't panic and have them both. It's fine.

Do yourself a favour, get the CVS code for the contribs and look at it to see what they do.

It will help you to understand.

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline lurey

  • *
  • 78
  • +0/-0
Re: Dovecot - Protection contre la force brute ?
« Reply #21 on: October 21, 2023, 06:27:43 PM »
(...)So don't panic and have them both. It's fine.
I just followed your advice, and did install Xt-Geoip !

No error message.
Maxmind registration stayed.
BadContries for qpsmtp stayed.

> I just had to add BadContries for services other than qpsmtp. (easy to do with Geoip page in the server-manager, / Merci Gieres pour les traductions fr ! )
I still need to explore the different possibilities and configuration parameters
Quote
Do yourself a favour, get the CVS code for the contribs and look at it to see what they do.
It will help you to understand.
I did'nt... at that time.
I first started by looking for the meaning of "CVS"  :oops:, found a link to the page https://viewvc.koozali.org/smecontribs/rpms/, saw "sme-geoip/contribs10" (but no Xt-geoip)...
but I haven't figured out how to use your good and friendly advice yet...
I will try again with more free time, especially since the language is still a handicap for me, already to understand how to use the  offered tools(even when for you, it appears obvious because you use them regularly).
...and, I fear that I lack too much basic knowledge for trying to read and understand codes and links between program elements !

Have a good evening
« Last Edit: October 21, 2023, 06:29:51 PM by lurey »
Bricoleur informatique, qui speak très mal english... merci de votre indulgence !