Problème de démarrage de plusieurs services : fail2ban, postfix et yunohost-firewall

Bonjour,

J’ai plusieurs soucis avec des services qui ne démarre pas, dont un mail reçu de root à propos de fail2ban.

Configuration de mon YunoHost

Matériel: x64 vps
Accès Internet: dans un datacenter
YunoHost version:
yunohost: 3.0.0~beta1.5 (testing)
yunohost-admin: 3.0.0~beta1.1 (testing)
moulinette: 3.0.0~beta1.1 (testing)
ssowat: 3.0.0~beta1 (testing)
As tu modifié ton yunohost avec des configuration spécifiques ou bien utilise tu uniquement la web administration et/ou la ligne de commande yunohost ? modifié
Si modifié, comment: lors de la migration de YunoHost Stable v2 up-to-date Jessie vers YunoHost Testing v3.x Beta j’ai autorisé la reconfiguration des configurations par le script de migration. J’ai ensuite changer le port SSH pour un port exotic comme j’avais avant la migration dans /etc/ssh/sshd.conf avec un service ssh restart

Description de mon problème

J’ai reçu un mail de root à propos de fail2ban

Cron root@monserveur test -x /usr/sbin/anacron || (cd / && run-parts --report /etc/cron.daily)
/etc/cron.daily/logrotate:
ERROR Failed to access socket path:
/var/run/fail2ban/fail2ban.sock. ls fail2ban running?
error: error running non-shares postrotate script for /var/log/fail2ban.log of ‘/var/log/fail2ban.log’
ruin-parts: /etc/cron.daily/logrotate exited with return code 1

Je suis allé jeter un oeil dans le panel web :

  • fail2ban : Status failed
    Un clic sur le bouton “Démarrer” puis sur le bouton “Journal”

Action
GET /services//log
{“locale”:“fr”,“name”:“fail2ban”,“number”:“50”}

Trace
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/moulinette/interfaces/api.py”, line 406, in process
ret = self.actionsmap.process(arguments, timeout=30, route=_route)
File “/usr/lib/python2.7/dist-packages/moulinette/actionsmap.py”, line 498, in process
return func(**arguments)
File “/usr/lib/moulinette/yunohost/service.py”, line 329, in service_log
result[log_path] = _tail(log_path, int(number))
File “/usr/lib/moulinette/yunohost/service.py”, line 712, in _tail
return lines[-to_read]
IndexError: list index out of range

  • postfix : Status exited
    Un clic sur le bouton “Démarrer” puis sur le bouton “Journal”

Action
GET /services//log
{“locale”:“fr”,“name”:“postfix”,“number”:“50”}

Trace
Traceback (most recent call last):
File “/usr/lib/python2.7/dist-packages/moulinette/interfaces/api.py”, line 406, in process
ret = self.actionsmap.process(arguments, timeout=30, route=_route)
File “/usr/lib/python2.7/dist-packages/moulinette/actionsmap.py”, line 498, in process
return func(**arguments)
File “/usr/lib/moulinette/yunohost/service.py”, line 329, in service_log
result[log_path] = _tail(log_path, int(number))
File “/usr/lib/moulinette/yunohost/service.py”, line 712, in _tail
return lines[-to_read]
IndexError: list index out of range

  • yunohost-firewall : Status exited
    Un clic sur le bouton “Démarrer” puis sur le bouton “Journal”

Aucun journal à afficher pour le service « yunohost-firewall »

Il n’y a pas de logs pour postfix et yunohost-firewall dans /var/log/.
Pour fail2ban, les logs sont vides ou en .gz

NB: tu peux utiliser paste.yunohost.org pour communiquer des fichiers, tu peux également copier un diagnostique: Webadmin > Outils -> Diagnostique

Diagnostic
{
“host”: “Debian 9.4”,
“kernel”: “4.9.0-6-amd64”,
“packages”: {
“yunohost”: {
“repo”: “testing”,
“version”: “3.0.0~beta1.5”
},
“yunohost-admin”: {
“repo”: “testing”,
“version”: “3.0.0~beta1.1”
},
“moulinette”: {
“repo”: “testing”,
“version”: “3.0.0~beta1.1”
},
“ssowat”: {
“repo”: “testing”,
“version”: “3.0.0~beta1”
}
},
“backports”: [],
“system”: {
“disks”: {
“sda1”: “Mounted on /, 18.7GiB (9.8GiB free)”
},
“memory”: {
“ram”: “996.5MiB (448.7MiB free)”,
“swap”: “1023.0MiB (1023.0MiB free)”
}
},
“nginx”: [
“nginx: the configuration file /etc/nginx/nginx.conf syntax is ok”,
“nginx: configuration file /etc/nginx/nginx.conf test is successful”
],
“services”: {
“glances”: “running (enabled)”,
“nslcd”: “running (enabled)”,
“metronome”: “running (enabled)”,
“postfix”: “exited (enabled)”,
“rspamd”: “running (enabled)”,
“yunohost-firewall”: “exited (enabled)”,
“nginx”: “running (enabled)”,
“php7.0-fpm”: “running (enabled)”,
“dnsmasq”: “running (enabled)”,
“fail2ban”: “failed (enabled)”,
“yunohost-api”: “running (enabled)”,
“mysql”: “running (enabled)”,
“avahi-daemon”: “running (enabled)”,
“dovecot”: “running (enabled)”,
“redis-server”: “running (enabled)”,
“slapd”: “running (enabled)”,
“ssh”: “running (enabled)”
},
“applications”: {
“wallabag2”: “Wallabag”,
“nextcloud”: “Nextcloud”
},
“private”: {
“public_ip”: {
“IPv4”: “xxx.xxx.xxx.xxx”,
“IPv6”: “xxxx:xxxx:x:xxxx:x:xxxx:xxx:xxxx”
},
“domains”: [
“domain1”,
“domain2”,
“domain3”,
“domain4”
],
“regen_conf”: {
“dnsmasq”: {
“applied”: {
“/etc/resolv.dnsmasq.conf”: {
“status”: “updated”,
“diff”: “@@ -1,13 +0,0 @@\n-nameserver 89.234.141.66\n-nameserver 80.67.169.40\n-nameserver 91.239.100.100\n-nameserver 141.255.128.100\n-nameserver 85.214.20.141\n-nameserver 84.200.70.40\n-nameserver 141.255.128.101\n-nameserver 213.73.91.35\n-nameserver 89.234.186.18\n-nameserver 80.67.169.12\n-nameserver 89.233.43.71\n-nameserver 84.200.69.80\n-nameserver 80.67.188.188”
}
},
“pending”: {}
},
“fail2ban”: {
“applied”: {},
“pending”: {
“/etc/fail2ban/jail.conf”: {
“status”: “modified”,
“diff”: “@@ -1,855 +0,0 @@\n-#\n-# WARNING: heavily refactored in 0.9.0 release. Please review and\n-# customize settings for your setup.\n-#\n-# Changes: in most of the cases you should not modify this\n-# file, but provide customizations in jail.local file,\n-# or separate .conf files under jail.d/ directory, e.g.:\n-#\n-# HOW TO ACTIVATE JAILS:\n-#\n-# YOU SHOULD NOT MODIFY THIS FILE.\n-#\n-# It will probably be overwritten or improved in a distribution update.\n-#\n-# Provide customizations in a jail.local file or a jail.d/customisation.local.\n-# For example to change the default bantime for all jails and to enable the\n-# ssh-iptables jail the following (uncommented) would appear in the .local file.\n-# See man 5 jail.conf for details.\n-#\n-# [DEFAULT]\n-# bantime = 3600\n-#\n-# [sshd]\n-# enabled = true\n-#\n-# See jail.conf(5) man page for more information\n-\n-\n-\n-# Comments: use ‘#’ for comment lines and ‘;’ (following a space) for inline comments\n-\n-\n-[INCLUDES]\n-\n-#before = paths-distro.conf\n-before = paths-debian.conf\n-\n-# The DEFAULT allows a global definition of the options. They can be overridden\n-# in each jail afterwards.\n-\n-[DEFAULT]\n-\n-#\n-# MISCELLANEOUS OPTIONS\n-#\n-\n-# “ignoreip” can be an IP address, a CIDR mask or a DNS host. Fail2ban will not\n-# ban a host which matches an address in this list. Several addresses can be\n-# defined using space (and/or comma) separator.\n-ignoreip = 127.0.0.1/8\n-\n-# External command that will take an tagged arguments to ignore, e.g. ,\n-# and return true if the IP is to be ignored. False otherwise.\n-#\n-# ignorecommand = /path/to/command \n-ignorecommand =\n-\n-# “bantime” is the number of seconds that a host is banned.\n-bantime = 600\n-\n-# A host is banned if it has generated “maxretry” during the last “findtime”\n-# seconds.\n-findtime = 600\n-\n-# “maxretry” is the number of failures before a host get banned.\n-maxretry = 5\n-\n-# “backend” specifies the backend used to get files modification.\n-# Available options are “pyinotify”, “gamin”, “polling”, “systemd” and “auto”.\n-# This option can be overridden in each jail as well.\n-#\n-# pyinotify: requires pyinotify (a file alteration monitor) to be installed.\n-# If pyinotify is not installed, Fail2ban will use auto.\n-# gamin: requires Gamin (a file alteration monitor) to be installed.\n-# If Gamin is not installed, Fail2ban will use auto.\n-# polling: uses a polling algorithm which does not require external libraries.\n-# systemd: uses systemd python library to access the systemd journal.\n-# Specifying “logpath” is not valid for this backend.\n-# See “journalmatch” in the jails associated filter config\n-# auto: will try to use the following backends, in order:\n-# pyinotify, gamin, polling.\n-#\n-# Note: if systemd backend is chosen as the default but you enable a jail\n-# for which logs are present only in its own log files, specify some other\n-# backend for that jail (e.g. polling) and provide empty value for\n-# journalmatch. See https://github.com/fail2ban/fail2ban/issues/959#issuecomment-74901200\n-backend = auto\n-\n-# “usedns” specifies if jails should trust hostnames in logs,\n-# warn when DNS lookups are performed, or ignore all hostnames in logs\n-#\n-# yes: if a hostname is encountered, a DNS lookup will be performed.\n-# warn: if a hostname is encountered, a DNS lookup will be performed,\n-# but it will be logged as a warning.\n-# no: if a hostname is encountered, will not be used for banning,\n-# but it will be logged as info.\n-# raw: use raw value (no hostname), allow use it for no-host filters/actions (example user)\n-usedns = warn\n-\n-# “logencoding” specifies the encoding of the log files handled by the jail\n-# This is used to decode the lines from the log file.\n-# Typical examples: “ascii”, “utf-8”\n-#\n-# auto: will use the system locale setting\n-logencoding = auto\n-\n-# “enabled” enables the jails.\n-# By default all jails are disabled, and it should stay this way.\n-# Enable only relevant to your setup jails in your .local or jail.d/.conf\n-#\n-# true: jail will be enabled and log files will get monitored for changes\n-# false: jail is not enabled\n-enabled = false\n-\n-\n-# “filter” defines the filter to use by the jail.\n-# By default jails have names matching their filter name\n-#\n-filter = %(name)s\n-\n-\n-#\n-# ACTIONS\n-#\n-\n-# Some options used for actions\n-\n-# Destination email address used solely for the interpolations in\n-# jail.{conf,local,d/} configuration files.\n-destemail = xxx@xxx.xxx\n-\n-# Sender email address used solely for some actions\n-sender = root@localhost\n-\n-# E-mail action. Since 0.8.1 Fail2Ban uses sendmail MTA for the\n-# mailing. Change mta configuration parameter to mail if you want to\n-# revert to conventional ‘mail’.\n-mta = sendmail\n-\n-# Default protocol\n-protocol = tcp\n-\n-# Specify chain where jumps would need to be added in iptables-* actions\n-chain = INPUT\n-\n-# Ports to be banned\n-# Usually should be overridden in a particular jail\n-port = 0:65535\n-\n-# Format of user-agent https://tools.ietf.org/html/rfc7231#section-5.5.3\n-fail2ban_agent = Fail2Ban/%(fail2ban_version)s\n-\n-#\n-# Action shortcuts. To be used to define action parameter\n-\n-# Default banning action (e.g. iptables, iptables-new,\n-# iptables-multiport, shorewall, etc) It is used to define\n-# action_* variables. Can be overridden globally or per\n-# section within jail.local file\n-banaction = iptables-multiport\n-banaction_allports = iptables-allports\n-\n-# The simplest action to take: ban only\n-action_ = %(banaction)s[name=%(name)s, bantime=”%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]\n-\n-# ban & send an e-mail with whois report to the destemail.\n-action_mw = %(banaction)s[name=%(name)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]\n- %(mta)s-whois[name=%(name)s, sender="%(sender)s", dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]\n-\n-# ban & send an e-mail with whois report and relevant log lines\n-# to the destemail.\n-action_mwl = %(banaction)s[name=%(name)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]\n- %(mta)s-whois-lines[name=%(name)s, sender="%(sender)s", dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]\n-\n-# See the IMPORTANT note in action.d/xarf-login-attack for when to use this action\n-#\n-# ban & send a xarf e-mail to abuse contact of IP address and include relevant log lines\n-# to the destemail.\n-action_xarf = %(banaction)s[name=%(name)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]\n- xarf-login-attack[service=%(name)s, sender="%(sender)s", logpath=%(logpath)s, port="%(port)s"]\n-\n-# ban IP on CloudFlare & send an e-mail with whois report and relevant log lines\n-# to the destemail.\n-action_cf_mwl = cloudflare[cfuser="%(cfemail)s", cftoken="%(cfapikey)s"]\n- %(mta)s-whois-lines[name=%(name)s, sender="%(sender)s", dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]\n-\n-# Report block via blocklist.de fail2ban reporting service API\n-# \n-# See the IMPORTANT note in action.d/blocklist_de.conf for when to\n-# use this action. Create a file jail.d/blocklist_de.local containing\n-# [Init]\n-# blocklist_de_apikey = {api key from registration]\n-#\n-action_blocklist_de = blocklist_de[email="%(sender)s", service=%(filter)s, apikey="%(blocklist_de_apikey)s", agent="%(fail2ban_agent)s"]\n-\n-# Report ban via badips.com, and use as blacklist\n-#\n-# See BadIPsAction docstring in config/action.d/badips.py for\n-# documentation for this action.\n-#\n-# NOTE: This action relies on banaction being present on start and therefore\n-# should be last action defined for a jail.\n-#\n-action_badips = badips.py[category="%(name)s", banaction="%(banaction)s", agent="%(fail2ban_agent)s"]\n-#\n-# Report ban via badips.com (uses action.d/badips.conf for reporting only)\n-#\n-action_badips_report = badips[category="%(name)s", agent="%(fail2ban_agent)s"]\n-\n-# Choose default action. To change, just override value of ‘action’ with the\n-# interpolation to the chosen action shortcut (e.g. action_mw, action_mwl, etc) in jail.local\n-# globally (section [DEFAULT]) or per specific section\n-action = %(action_mwl)s\n-\n-\n-#\n-# JAILS\n-#\n-\n-#\n-# SSH servers\n-#\n-\n-[sshd]\n-\n-port = ssh,port_exotic\n-logpath = %(sshd_log)s\n-backend = %(sshd_backend)s\n-\n-\n-[sshd-ddos]\n-# This jail corresponds to the standard configuration in Fail2ban.\n-# The mail-whois action send a notification e-mail with a whois request\n-# in the body.\n-port = ssh,port_exotic\n-logpath = %(sshd_log)s\n-backend = %(sshd_backend)s\n-\n-\n-[dropbear]\n-\n-port = ssh,port_exotic\n-logpath = %(dropbear_log)s\n-backend = %(dropbear_backend)s\n-\n-\n-[selinux-ssh]\n-\n-port = ssh,port_exotic\n-logpath = %(auditd_log)s\n-\n-\n-#\n-# HTTP servers\n-#\n-\n-[apache-auth]\n-\n-port = http,https\n-logpath = %(apache_error_log)s\n-\n-\n-[apache-badbots]\n-# Ban hosts which agent identifies spammer robots crawling the web\n-# for email addresses. The mail outputs are buffered.\n-port = http,https\n-logpath = %(apache_access_log)s\n-bantime = 172800\n-maxretry = 1\n-\n-\n-[apache-noscript]\n-\n-port = http,https\n-logpath = %(apache_error_log)s\n-\n-\n-[apache-overflows]\n-\n-port = http,https\n-logpath = %(apache_error_log)s\n-maxretry = 2\n-\n-\n-[apache-nohome]\n-\n-port = http,https\n-logpath = %(apache_error_log)s\n-maxretry = 2\n-\n-\n-[apache-botsearch]\n-\n-port = http,https\n-logpath = %(apache_error_log)s\n-maxretry = 2\n-\n-\n-[apache-fakegooglebot]\n-\n-port = http,https\n-logpath = %(apache_access_log)s\n-maxretry = 1\n-ignorecommand = %(ignorecommands_dir)s/apache-fakegooglebot \n-\n-\n-[apache-modsecurity]\n-\n-port = http,https\n-logpath = %(apache_error_log)s\n-maxretry = 2\n-\n-\n-[apache-shellshock]\n-\n-port = http,https\n-logpath = %(apache_error_log)s\n-maxretry = 1\n-\n-\n-[openhab-auth]\n-\n-filter = openhab\n-action = iptables-allports[name=NoAuthFailures]\n-logpath = /opt/openhab/logs/request.log\n-\n-\n-[nginx-http-auth]\n-\n-port = http,https\n-logpath = %(nginx_error_log)s\n-\n-# To use ‘nginx-limit-req’ jail you should have ngx_http_limit_req_module \n-# and define limit_req and limit_req_zone as described in nginx documentation\n-# http://nginx.org/en/docs/http/ngx_http_limit_req_module.html\n-# or for example see in ‘config/filter.d/nginx-limit-req.conf’\n-[nginx-limit-req]\n-port = http,https\n-logpath = %(nginx_error_log)s\n-\n-[nginx-botsearch]\n-\n-port = http,https\n-logpath = %(nginx_error_log)s\n-maxretry = 2\n-\n-\n-# Ban attackers that try to use PHP’s URL-fopen() functionality\n-# through GET/POST variables. - Experimental, with more than a year\n-# of usage in production environments.\n-\n-[php-url-fopen]\n-\n-port = http,https\n-logpath = %(nginx_access_log)s\n- %(apache_access_log)s\n-\n-\n-[suhosin]\n-\n-port = http,https\n-logpath = %(suhosin_log)s\n-\n-\n-[lighttpd-auth]\n-# Same as above for Apache’s mod_auth\n-# It catches wrong authentifications\n-port = http,https\n-logpath = %(lighttpd_error_log)s\n-\n-\n-#\n-# Webmail and groupware servers\n-#\n-\n-[roundcube-auth]\n-\n-port = http,https\n-logpath = %(roundcube_errors_log)s\n-\n-\n-[openwebmail]\n-\n-port = http,https\n-logpath = /var/log/openwebmail.log\n-\n-\n-[horde]\n-\n-port = http,https\n-logpath = /var/log/horde/horde.log\n-\n-\n-[groupoffice]\n-\n-port = http,https\n-logpath = /home/groupoffice/log/info.log\n-\n-\n-[sogo-auth]\n-# Monitor SOGo groupware server\n-# without proxy this would be:\n-# port = 20000\n-port = http,https\n-logpath = /var/log/sogo/sogo.log\n-\n-\n-[tine20]\n-\n-logpath = /var/log/tine20/tine20.log\n-port = http,https\n-\n-\n-#\n-# Web Applications\n-#\n-#\n-\n-[drupal-auth]\n-\n-port = http,https\n-logpath = %(syslog_daemon)s\n-backend = %(syslog_backend)s\n-\n-[guacamole]\n-\n-port = http,https\n-logpath = /var/log/tomcat*/catalina.out\n-\n-[monit]\n-#Ban clients brute-forcing the monit gui login\n-port = 2812\n-logpath = /var/log/monit\n-\n-\n-[webmin-auth]\n-\n-port = 10000\n-logpath = %(syslog_authpriv)s\n-backend = %(syslog_backend)s\n-\n-\n-[froxlor-auth]\n-\n-port = http,https\n-logpath = %(syslog_authpriv)s\n-backend = %(syslog_backend)s\n-\n-\n-#\n-# HTTP Proxy servers\n-#\n-#\n-\n-[squid]\n-\n-port = 80,443,3128,8080\n-logpath = /var/log/squid/access.log\n-\n-\n-[3proxy]\n-\n-port = 3128\n-logpath = /var/log/3proxy.log\n-\n-\n-#\n-# FTP servers\n-#\n-\n-\n-[proftpd]\n-\n-port = ftp,ftp-data,ftps,ftps-data\n-logpath = %(proftpd_log)s\n-backend = %(proftpd_backend)s\n-\n-\n-[pure-ftpd]\n-\n-port = ftp,ftp-data,ftps,ftps-data\n-logpath = %(pureftpd_log)s\n-backend = %(pureftpd_backend)s\n-\n-\n-[gssftpd]\n-\n-port = ftp,ftp-data,ftps,ftps-data\n-logpath = %(syslog_daemon)s\n-backend = %(syslog_backend)s\n-\n-\n-[wuftpd]\n-\n-port = ftp,ftp-data,ftps,ftps-data\n-logpath = %(wuftpd_log)s\n-backend = %(wuftpd_backend)s\n-\n-\n-[vsftpd]\n-# or overwrite it in jails.local to be\n-# logpath = %(syslog_authpriv)s\n-# if you want to rely on PAM failed login attempts\n-# vsftpd’s failregex should match both of those formats\n-port = ftp,ftp-data,ftps,ftps-data\n-logpath = %(vsftpd_log)s\n-\n-\n-#\n-# Mail servers\n-#\n-\n-# ASSP SMTP Proxy Jail\n-[assp]\n-\n-port = smtp,465,submission\n-logpath = /root/path/to/assp/logs/maillog.txt\n-\n-\n-[courier-smtp]\n-\n-port = smtp,465,submission\n-logpath = %(syslog_mail)s\n-backend = %(syslog_backend)s\n-\n-\n-[postfix]\n-\n-port = smtp,465,submission\n-logpath = %(postfix_log)s\n-backend = %(postfix_backend)s\n-\n-\n-[postfix-rbl]\n-\n-port = smtp,465,submission\n-logpath = %(postfix_log)s\n-backend = %(postfix_backend)s\n-maxretry = 1\n-\n-\n-[sendmail-auth]\n-\n-port = submission,465,smtp\n-logpath = %(syslog_mail)s\n-backend = %(syslog_backend)s\n-\n-\n-[sendmail-reject]\n-\n-port = smtp,465,submission\n-logpath = %(syslog_mail)s\n-backend = %(syslog_backend)s\n-\n-\n-[qmail-rbl]\n-\n-filter = qmail\n-port = smtp,465,submission\n-logpath = /service/qmail/log/main/current\n-\n-\n-# dovecot defaults to logging to the mail syslog facility\n-# but can be set by syslog_facility in the dovecot configuration.\n-[dovecot]\n-\n-port = pop3,pop3s,imap,imaps,submission,465,sieve\n-logpath = %(dovecot_log)s\n-backend = %(dovecot_backend)s\n-\n-\n-[sieve]\n-\n-port = smtp,465,submission\n-logpath = %(dovecot_log)s\n-backend = %(dovecot_backend)s\n-\n-\n-[solid-pop3d]\n-\n-port = pop3,pop3s\n-logpath = %(solidpop3d_log)s\n-\n-\n-[exim]\n-\n-port = smtp,465,submission\n-logpath = %(exim_main_log)s\n-\n-\n-[exim-spam]\n-\n-port = smtp,465,submission\n-logpath = %(exim_main_log)s\n-\n-\n-[kerio]\n-\n-port = imap,smtp,imaps,465\n-logpath = /opt/kerio/mailserver/store/logs/security.log\n-\n-\n-#\n-# Mail servers authenticators: might be used for smtp,ftp,imap servers, so\n-# all relevant ports get banned\n-#\n-\n-[courier-auth]\n-\n-port = smtp,465,submission,imaps,pop3,pop3s\n-logpath = %(syslog_mail)s\n-backend = %(syslog_backend)s\n-\n-\n-[postfix-sasl]\n-\n-port = smtp,465,submission,imap,imaps,pop3,pop3s\n-# You might consider monitoring /var/log/mail.warn instead if you are\n-# running postfix since it would provide the same log lines at the\n-# “warn” level but overall at the smaller filesize.\n-logpath = %(postfix_log)s\n-backend = %(postfix_backend)s\n-\n-\n-[perdition]\n-\n-port = imap,imaps,pop3,pop3s\n-logpath = %(syslog_mail)s\n-backend = %(syslog_backend)s\n-\n-\n-[squirrelmail]\n-\n-port = smtp,465,submission,imap,imap2,imaps,pop3,pop3s,http,https,socks\n-logpath = /var/lib/squirrelmail/prefs/squirrelmail_access_log\n-\n-\n-[cyrus-imap]\n-\n-port = imap,imaps\n-logpath = %(syslog_mail)s\n-backend = %(syslog_backend)s\n-\n-\n-[uwimap-auth]\n-\n-port = imap,imaps\n-logpath = %(syslog_mail)s\n-backend = %(syslog_backend)s\n-\n-\n-#\n-#\n-# DNS servers\n-#\n-\n-\n-# !!! WARNING !!!\n-# Since UDP is connection-less protocol, spoofing of IP and imitation\n-# of illegal actions is way too simple. Thus enabling of this filter\n-# might provide an easy way for implementing a DoS against a chosen\n-# victim. See\n-# http://nion.modprobe.de/blog/archives/690-fail2ban-+-dns-fail.html\n-# Please DO NOT USE this jail unless you know what you are doing.\n-#\n-# IMPORTANT: see filter.d/named-refused for instructions to enable logging\n-# This jail blocks UDP traffic for DNS requests.\n-# [named-refused-udp]\n-#\n-# filter = named-refused\n-# port = domain,953\n-# protocol = udp\n-# logpath = /var/log/named/security.log\n-\n-# IMPORTANT: see filter.d/named-refused for instructions to enable logging\n-# This jail blocks TCP traffic for DNS requests.\n-\n-[named-refused]\n-\n-port = domain,953\n-logpath = /var/log/named/security.log\n-\n-\n-[nsd]\n-\n-port = 53\n-action = %(banaction)s[name=%(name)s-tcp, port="%(port)s", protocol=“tcp”, chain="%(chain)s", actname=%(banaction)s-tcp]\n- %(banaction)s[name=%(name)s-udp, port="%(port)s", protocol=“udp”, chain="%(chain)s", actname=%(banaction)s-udp]\n-logpath = /var/log/nsd.log\n-\n-\n-#\n-# Miscellaneous\n-#\n-\n-[asterisk]\n-\n-port = 5060,5061\n-action = %(banaction)s[name=%(name)s-tcp, port="%(port)s", protocol=“tcp”, chain="%(chain)s", actname=%(banaction)s-tcp]\n- %(banaction)s[name=%(name)s-udp, port="%(port)s", protocol=“udp”, chain="%(chain)s", actname=%(banaction)s-udp]\n- %(mta)s-whois[name=%(name)s, dest="%(destemail)s"]\n-logpath = /var/log/asterisk/messages\n-maxretry = 10\n-\n-\n-[freeswitch]\n-\n-port = 5060,5061\n-action = %(banaction)s[name=%(name)s-tcp, port="%(port)s", protocol=“tcp”, chain="%(chain)s", actname=%(banaction)s-tcp]\n- %(banaction)s[name=%(name)s-udp, port="%(port)s", protocol=“udp”, chain="%(chain)s", actname=%(banaction)s-udp]\n- %(mta)s-whois[name=%(name)s, dest="%(destemail)s"]\n-logpath = /var/log/freeswitch.log\n-maxretry = 10\n-\n-\n-# To log wrong MySQL access attempts add to /etc/my.cnf in [mysqld] or\n-# equivalent section:\n-# log-warning = 2\n-#\n-# for syslog (daemon facility)\n-# [mysqld_safe]\n-# syslog\n-#\n-# for own logfile\n-# [mysqld]\n-# log-error=/var/log/mysqld.log\n-[mysqld-auth]\n-\n-port = 3306\n-logpath = %(mysql_log)s\n-backend = %(mysql_backend)s\n-\n-\n-# Log wrong MongoDB auth (for details see filter ‘filter.d/mongodb-auth.conf’)\n-[mongodb-auth]\n-# change port when running with “–shardsvr” or “–configsvr” runtime operation\n-port = 27017\n-logpath = /var/log/mongodb/mongodb.log\n-\n-\n-# Jail for more extended banning of persistent abusers\n-# !!! WARNINGS !!!\n-# 1. Make sure that your loglevel specified in fail2ban.conf/.local\n-# is not at DEBUG level – which might then cause fail2ban to fall into\n-# an infinite loop constantly feeding itself with non-informative lines\n-# 2. Increase dbpurgeage defined in fail2ban.conf to e.g. 648000 (7.5 days)\n-# to maintain entries for failed logins for sufficient amount of time\n-[recidive]\n-\n-logpath = /var/log/fail2ban.log\n-banaction = %(banaction_allports)s\n-bantime = 604800 ; 1 week\n-findtime = 86400 ; 1 day\n-\n-\n-# Generic filter for PAM. Has to be used with action which bans all\n-# ports such as iptables-allports, shorewall\n-\n-[pam-generic]\n-# pam-generic filter can be customized to monitor specific subset of 'tty’s\n-banaction = %(banaction_allports)s\n-logpath = %(syslog_authpriv)s\n-backend = %(syslog_backend)s\n-\n-\n-[xinetd-fail]\n-\n-banaction = iptables-multiport-log\n-logpath = %(syslog_daemon)s\n-backend = %(syslog_backend)s\n-maxretry = 2\n-\n-\n-# stunnel - need to set port for this\n-[stunnel]\n-\n-logpath = /var/log/stunnel4/stunnel.log\n-\n-\n-[ejabberd-auth]\n-\n-port = 5222\n-logpath = /var/log/ejabberd/ejabberd.log\n-\n-\n-[counter-strike]\n-\n-logpath = /opt/cstrike/logs/L[0-9]*.log\n-# Firewall: http://www.cstrike-planet.com/faq/6\n-tcpport = 27030,27031,27032,27033,27034,27035,27036,27037,27038,27039\n-udpport = 1200,27000,27001,27002,27003,27004,27005,27006,27007,27008,27009,27010,27011,27012,27013,27014,27015\n-action = %(banaction)s[name=%(name)s-tcp, port="%(tcpport)s", protocol=“tcp”, chain="%(chain)s", actname=%(banaction)s-tcp]\n- %(banaction)s[name=%(name)s-udp, port="%(udpport)s", protocol=“udp”, chain="%(chain)s", actname=%(banaction)s-udp]\n-\n-# consider low maxretry and a long bantime\n-# nobody except your own Nagios server should ever probe nrpe\n-[nagios]\n-\n-logpath = %(syslog_daemon)s ; nrpe.cfg may define a different log_facility\n-backend = %(syslog_backend)s\n-maxretry = 1\n-\n-\n-[oracleims]\n-# see “oracleims” filter file for configuration requirement for Oracle IMS v6 and above\n-logpath = /opt/sun/comms/messaging64/log/mail.log_current\n-banaction = %(banaction_allports)s\n-\n-[directadmin]\n-logpath = /var/log/directadmin/login.log\n-port = 2222\n-\n-[portsentry]\n-logpath = /var/lib/portsentry/portsentry.history\n-maxretry = 1\n-\n-[pass2allow-ftp]\n-# this pass2allow example allows FTP traffic after successful HTTP authentication\n-port = ftp,ftp-data,ftps,ftps-data\n-# knocking_url variable must be overridden to some secret value in jail.local\n-knocking_url = /knocking/\n-filter = apache-pass[knocking_url="%(knocking_url)s"]\n-# access log of the website with HTTP auth\n-logpath = %(apache_access_log)s\n-blocktype = RETURN\n-returntype = DROP\n-bantime = 3600\n-maxretry = 1\n-findtime = 1\n-\n-\n-[murmur]\n-# AKA mumble-server\n-port = 64738\n-action = %(banaction)s[name=%(name)s-tcp, port="%(port)s", protocol=tcp, chain="%(chain)s", actname=%(banaction)s-tcp]\n- %(banaction)s[name=%(name)s-udp, port="%(port)s", protocol=udp, chain="%(chain)s", actname=%(banaction)s-udp]\n-logpath = /var/log/mumble-server/mumble-server.log\n-\n-\n-[screensharingd]\n-# For Mac OS Screen Sharing Service (VNC)\n-logpath = /var/log/system.log\n-logencoding = utf-8\n-\n-[haproxy-http-auth]\n-# HAProxy by default doesn’t log to file you’ll need to set it up to forward\n-# logs to a syslog server which would then write them to disk.\n-# See “haproxy-http-auth” filter for a brief cautionary note when setting\n-# maxretry and findtime.\n-logpath = /var/log/haproxy.log\n-\n-[slapd]\n-port = ldap,ldaps\n-filter = slapd\n-logpath = /var/log/slapd.log"
}
}
}
}
},
“security”: {
“CVE-2017-5754”: {
“name”: “meltdown”,
“vulnerable”: false
}
}
}

En passant à la v3 beta de YunoHost, le port SMTP est 587 en STARTTLS, peut-etre faudrait-il ajouter ce port à celui en 465 pour SSL/TLS dans le jail postix ?

ppr

Le problème avec fail2ban a été résolu avec

yunohost service regen-conf fail2ban --force

Les problèmes restent les mêmes avec postfix et yunohost-firewall. Cela malgré

yunohost service regen-conf --force

Aucun retour d’erreur suite à ces commandes.

ppr

Bonne remarque ! Après investigation, c’est normalement déjà le cas et correspond au port “submission” utilisé dans plusieurs jails dont postfix et dovecot

1 Like

À propos de :

il y a un fix dans le pipeline donc ça va bientôt être fixé.

1 Like

Cool :slight_smile: