What type of hardware are you using: Old laptop or computer What YunoHost version are you running: 12.0.10 (stable) How are you able to access your server: SSH Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: I changed the sshd bantime before going into Bookworm
Describe your issue
Hi,
I wanted to update you that I can now send multiple requests to the SSO without being banned, whereas previously I would get banned after a few failed attempts. I performed a few tests, and I didnāt encounter any issues.
To ensure everything is working as expected, I checked the logs using:
sudo grep āBanā /var/log/fail2ban.log
I found no recent ban entries related to the SSO, which indicates that the bans are no longer being triggered.
I also reviewed the /etc/fail2ban/jail.d/yunohost-jails.conf file, and everything seems to be in place:
I confirmed that the wildcard in the logpath should cover the access logs properly, and everything appears to be integrated correctly. Given that Iām able to send multiple requests without being banned, I wanted to ask if this behavior is normal or if I should modify any of the jail settings to enforce stricter banning rules?
After searching in the /etc/fail2ban folder I found that the jail yunohost-portal was not created because i edited my files previoulsy.
I just had to create the jail everything work like previously.
If anyone is interested:
[yunohost-portal]
enabled = true
port = http,https
protocol = tcp
filter = yunohost-portal
logpath = /var/log/nginx/*error.log
/var/log/nginx/*access.log
bantime = whetever you wan
maxretry = whatever
Donāt modify your yunohost files or they wonāt be update. You can use a jail-perso.conf with your modification. Or a hook if you absolutely want to change the yunohost-jails.conf file.
You can add your ssh-perso jail in the personal config file. Whatās your hardened sshd jail?
The easiest way is to post your modify yunohost-jails.conf file to see if you can do your hardening in another file.
If you really want modify the original file, you can read this tuto If you donāt understand, you can send me a P.M. :
Well to be honest the only thing that I did was to put the max retry at 3 and the ban time at 1day for ssh (with my modified port). I also upped the ban from recidive to 1 week.
Fail2ban read first the /etc/fail2ban/jail.conf file
After that, it read the /etc/fail2ban/jail.d/whatever.conf in alphabetical order. The last file conf overwrite the other if there is already the same configuration in another file
example:
2 bantime for sshd in test.conf and yunohost.conf, the configuration for this option is the one in yunohost.conf.
2 bantime for sshd in zoro.conf and yunohost.conf, the configuration for this option is the one in zoro.conf.
The .local files are read after the .conf files and avoid erase conf.file but itās not useful here. Use only .conf file, itās enough.
The sshd from yunohost is not erase (it is the last file). If you want erase it, you must name your conf file with a name after yunohost in alphabetical order. And if you donāt use the same option in 2 differents files, they are cumulative.
Example you have a bantime in test.conf and a maxretry in yunohost.conf is the same to have the 2 options in test.conf or yunohost.conf.