运行cron作业时出现以下错误,我不太确定如何解决问题。 这是在Ubuntu 12.04 LTS上。 test -x /usr/sbin/anacron || ( cd / && run-parts –report /etc/cron.daily ) /etc/cron.daily/logrotate: error: error running non-shared postrotate script for /var/log/fail2ban.log of '/var/log/fail2ban.log ' run-parts: /etc/cron.daily/logrotate exited with return code 1 这里是/etc/logrotate.d/fail2ban的内容 /var/log/fail2ban.log { weekly rotate 4 compress delaycompress missingok postrotate fail2ban-client set logtarget /var/log/fail2ban.log >/dev/null endscript # If fail2ban runs […]
这个问题是几乎相同的问题,像我的,但接受的答案并不能解决我的问题 在Fail2Ban中,如何更改SSH端口号? 在端口22上的SSH一切都很好。 经过5次尝试fail2ban从日志中读取,并禁止我的ip 600秒。 这里是fail2ban日志 2013-07-10 11:54:08,522 fail2ban.actions: WARNING [ssh-iptables] Ban 192.168.162.191 2013-07-10 12:04:09,348 fail2ban.actions: WARNING [ssh-iptables] Unban 192.168.162.191 我的iptables,fail2ban有22端口 Chain INPUT (policy ACCEPT 1591 packets, 165K bytes) pkts bytes target prot opt in out source destination 44 5292 fail2ban-SSH tcp — * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 Chain FORWARD (policy ACCEPT 0 packets, […]
我只是试图添加一个新的fail2ban规则,该规则应该扫描Apache2错误日志以进行可疑的文件访问尝试(试图访问三个不存在的常见loginURL的用户通常没有良好的意图)。 为此,我在jail.local文件中添加了一条新规则: [apache-suspiciousfiles] enabled = true port = http,https filter = apache-suspiciousfiles banaction = iptables-allports action = %(action_mwl)s logpath = /var/log/apache2/error*.log maxretry = 3 但是 – 在我的日志中给了我一个意想不到的错误消息: 2014-02-10 13:28:51,450 fail2ban.jail : INFO Jail 'apache-suspiciousfiles' started 2014-02-10 13:28:51,690 fail2ban.actions.action: ERROR iptables -N fail2ban-apache-suspiciousfiles iptables -A fail2ban-apache-suspiciousfiles -j RETURN iptables -I INPUT -p tcp -j fail2ban-apache-suspiciousfiles returned […]
使用fail2ban来保护DigitalOcean上的Ubuntu 12.04 x64服务器,同时编辑/etc/fail2ban/jail.local还有这个部分: [DEFAULT] # "ignoreip" can be an IP address, a CIDR mask or a DNS host ignoreip = 127.0.0.1/8 这是pipe理员将连接的IP,但如果pipe理员有一个dynamic的IP有没有解决scheme? 或者这只是打败了目的?
我如何在Nginx服务器上使用fail2ban? jails.conf中的规则是什么?
我在fail2ban中使用一个自定义filter来search自己的日志,并禁止从任何常规filter5禁令后的IP。 我使用iptables-allports作为此操作。 所有其他的filter都configuration了iptables-multiport 。 这是jail.conf的特定configuration [fail2ban] enabled = true filter = fail2ban action = iptables-allports[name=fail2ban] logpath = /var/log/fail2ban.log maxretry = 5 findtime = 604800 bantime = 2592000 我的filterfail2ban.conf看起来像这样(删除了多余的注释) [Definition] # Count all bans in the logfile failregex = fail2ban.actions: WARNING \[(.*)\] Ban <HOST> # Ignore our own bans, to keep our counts exact. ignoreregex = […]
Fail2ban 0.9引入了数据库存储以在重新启动时保存禁止。 但是我找不到工作的实际机制。 有控制旧禁止寿命的dbpurgeage参数,默认为24小时。 正如我从代码研究中看到的,fail2ban使用timeofban等于禁止保存的时刻将禁止保存到数据库。 然后,每个dbpurgeage时间段都会使用timeofban < MyTime.time() – self._purgeAge删除所有禁令,换句话说,将删除所有禁止已经存储超过24小时。 但是,如果一个IP被禁止了这个月呢? 这是否意味着在24小时内重新启动后, dbpurgeage = 86400 ,我将失去超过24小时的所有禁令? 我只是希望所有的永久禁令都会被保留下来。
我一整天都在砸我的脑袋,试图将我的正则expression式筛选器与我的access.log匹配,但没有运气。 我已经在gentoo服务器上安装了fail2ban,运行良好(我手动放了我自己的IP,它工作),但fail2ban正则expression式失败,并返回0结果filter,甚至我的网站有重载攻击现在和最近几天。 顺便说一下,我不使用iptables软件在我的服务器(我需要安装一个为了fail2ban工作?)我猜fail2ban不能读取我的logformat或我的时间格式,我试图调整一切,但没有运气,任何帮助是非常非常感激 这是我的jail.local [INCLUDES] before = paths-common.conf [DEFAULT] action=%(action_mwl)s ignoreip = 127.0.0.1/8 192.168.99.25 ignorecommand = bantime = 86400 findtime = 300 backend = gamin [wp-login] enabled = true filter = wp-login banaction=iptables-allports logpath = /var/log/nginx/localhost*access_log bantime = 7200 maxretry = 1 [nginx-nohome] enabled=true port=http,https filter=nginx-nohome logpath=/var/log/nginx/localhost.error.log bantime=86400 maxretry=2 [nginx-dos] enabled = true port = […]
我正在为fail2ban写一套规则,让任何试图强行进入我的系统的人都变得更有趣。 绝大多数尝试都倾向于通过我的web服务器进入phpinfo(),如下所示 GET //pma/config/config.inc.php?p=phpinfo(); HTTP/1.1 GET //admin/config/config.inc.php?p=phpinfo(); HTTP/1.1 GET //dbadmin/config/config.inc.php?p=phpinfo(); HTTP/1.1 GET //mysql/config/config.inc.php?p=phpinfo(); HTTP/1.1 我想知道是否有一个用户试图通过Apache访问phpinfo()的任何有效的理由,因为如果不是,我可以简单地使用,或更具体的正则expression式 GET //[^>]+=phpinfo\(\) 作为消除这些攻击的filter
我正在使用fail2ban来阻止networking漏洞扫描器。 如果CloudFlare被绕过,它在访问站点时工作正常,但用户仍然可以通过它访问它。 我已经安装了mod_cloudflare 。 使用Cloudflare时,是否可以使用IPtables阻止用户? Ubuntu Server 12.04 32位 access.log的: 112.64.89.231 – – [29/Aug/2012:19:16:01 -0500] "GET /muieblackcat HTTP/1.1" 404 469 "-" "-" Jail.conf [apache-probe] enabled = true port = http,https filter = apache-probe logpath = /var/log/apache2/access.log action = iptables-multiport[name=apache-probe, port="http,https", protocol=tcp] maxretry = 1 bantime = 30 # Test Apache的probe.conf [Definition] failregex = ^<HOST>.*"GET \/muieblackcat […]