【问题标题】:fail2ban apachefakegooglebot failregex locationfail2ban apachefakegooglebot 失败正则表达式位置
【发布时间】:2020-01-01 00:10:22
【问题描述】:

fail2ban 中的 failregex 过滤器应该放在哪里? 我把它放在 jail.local 还是其他地方? 我正在运行 ubuntu 18.04

    [apache-fakegooglebot]
enabled=true
filter=apache-fakegooglebot
port=http,https
logpath=%(apache_access_log)s
maxretry=1
banTime=360000
failregex=<whatever>
ignorecommand=%(ignorecommands_dir)s/apache-fakegooglebot <ip>
action_=%(banaction)s[name=%(__name__)s,bantime="%(bantime)s",port="%(port)s",protocol="%(protocol)s",chain="%(chain)s"]

【问题讨论】:

    标签: ubuntu fail2ban


    【解决方案1】:

    您需要在 /etc/fail2ban/filter.d 中创建 apache-fakegooglebot.conf 文件

    # go to filter.d directory
    cd /etc/fail2ban/filter.d
    
    # create filter
    sudo nano apache-fakegooglebot.conf
    
    # add fail & ignore regex into the filter
    failregex=<whatever>
    ignoreregex=<whatever>
    
    

    【讨论】:

    • 它在那里我发现了一个不同的问题
    【解决方案2】:
    /usr/bin/fail2ban-client and fail2ban-server
    

    和

    /usr/bin/share/fail2ban-client and fail2ban-server
    

    正在调用不同版本的 python 我更改了标头

    #!/usr/bin/python
    

    到

    #!/usr/bin/python3
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-24
      相关资源
      最近更新 更多