在joomla上配置fail2ban

时间:2017-09-29 06:21:33

标签: regex centos fail2ban vesta

大家好我正在尝试用fail2ban配置joomla,所以我创建了 文件 $builder ->add('picture', FileType::class, [ 'label' => $trans('user.picture.name'), 'required' => true, 'constraints' => [ // new Image(['mimeTypes' => ['image/jpeg']]), new File(['maxSize' => '2M', 'mimeTypes' => ['image/jpeg']]), ], ]); function onPreSubmit(FormEvent $event) { $form = $event->getForm(); $data = $event->getData(); list(, $data['imagebase64']) = explode(',', $data['imagebase64']); $filePath = tempnam(sys_get_temp_dir(), 'hijob'); $image = base64_decode($data['imagebase64']); file_put_contents($filePath, $image); $photo = new UploadedFile( $filePath, 'photo.jpeg', 'image/jpeg' ); $data['picture'] = $photo; $event->setData($data); }

并添加了failregex,如下所示:

/etc/fail2ban/filter.d/joomla-error.conf

将此代码添加到failregex = [[]client <HOST>[]] user .* authentication failure.*

jail.conf

logpath是正确的但每次我尝试重新加载fail2ban服务时我都会

[joomla-error]
enabled = true
port = http,https
filter = joomla-error
logpath = /var/log/httpd/domains/jayjezz.com.error.log
maxretry = 5
bantime = 30

我觉得我的正则表达式有问题,有人可以为我提供正确的正则表达式

ERROR  NOK: ("No 'host' group in '[[]client <HOST>[]] user .* authentication failure.*'",)

谢谢

1 个答案:

答案 0 :(得分:0)

通过添加脚本来更改joomla网站内的文件权限来修复此问题。现在当我无法在没有首先启动脚本的情况下登录/管理员