• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved Fail2Ban Cannot Access Log File Inside a Domain

canadamcpherson

New Pleskian
Hi,

I created a custom filter and jail in Plesk. The logfile is not inside /var/log/. It is inside the /var/www/vhosts/mydomain.com/httpdocs/logs/entries.log. Therefore, the log path is "/var/www/vhosts/*/httpdocs/logs/entries.log"

This is causing the following permission error: f2bmng failed: 2021-04-07 09:30:25,891 fail2ban [2222]: ERROR NOK: (13, 'Permission denied')

I know the issue is about permission because when I copy the entries.log. file into /var/log/, the error disappears and I can enable the jail.

It seems that fail2ban does not have permission to read files inside a domain. How can I resolve this permission issue without compromising the security?

Sincerely,

McPherson
 
Last edited:
Out of curiosity, you placed the log file in a publicly accessible web directory?
Not in a publicly accessible web directory. Also, it's not I placed it. The program I am using has a special directory for logs. I am not a newbie, so I hope I will receive more focused replies.
 
Maybe go from the other side and in the settings of the software used, change the log files' location to the one in which the fail2ban works correctly?
 
Maybe go from the other side and in the settings of the software used, change the log files' location to the one in which the fail2ban works correctly?
Thank you, Igor for your suggestion. It is the most logical way of dealing with the issue. I was actually successful in changing the location of the log file.

Now problem is that the logs are useless. For example, “remoteAddr”:"" instead of showing any IP address. I am waiting to receive a reply from the software's developer.

HOWEVER, in this case, it would be better to resolve the access of the fail2ban because the logs inside my domain directory are just perfect, but inaccessible to fail2ban.
 
Maybe its not the existing logs that give permission denied, but the fact that some logs/paths don't exist

/var/www/vhosts/*/httpdocs/logs/entries.log will also try to open

/var/www/vhosts/system/httpdocs/logs/entries.log
/var/www/vhosts/default/httpdocs/logs/entries.log
/var/www/vhosts/fs/ttpdocs/logs/entries.log
/var/www/vhosts/fs-passwd/ttpdocs/logs/entries.log
/var/www/vhosts/chroot/ttpdocs/logs/entries.log


none of these maps have a httpdocs map in them.

What happens if you change the path to

/var/www/vhosts/*.*/httpdocs/logs/entries.log ? maybe it even needs to be /var/www/vhosts/*\.*/httpdocs/logs/entries.log im not sure if fail2ban needs to be excaped

That wil only open path with a point in it.

regards
Jan
 
Hi Jan,

Thanks for trying to help. It is a permission issue, and it finds the file. It just cannot read the content. Otherwise, I would receive a "no files found" message. That said, I still tried your suggestion with some hopes and the result was no files found instead of permission denied. So it is a step backward. This a strange issue or maybe a strange wish.
 
Last edited:
Back
Top