Skip to content

Fail2Ban Sample Configuration is Outdated #1177

Closed
@61214577

Description

@61214577

Description

The provided fail2ban configuration is outdated and does not work. The format of the access log has apparently been changed.

This is what an entry on the access log looks like:

Failed login attempt {"remoteAddress":"::ffff:127.0.0.1","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0","timestamp":1573554454}

This does not match with the fail regex provided in the sample fail2ban configuration:

failregex = ^INFO\s+Failed login attempt\s+{\"password\":\"(\\.|[^"])*\",\"remoteAddress\":\"<HOST>\"
datepattern = "timestamp":{EPOCH}}$

I have attempted to modify the fail regex for the new log format but have not been able to get the syntax correct. My regex is the following:

failregex=^Failed login attempt {\"remoteAddress\":\"<HOST>\"
datepattern = "timestamp":{EPOCH}}$

I am unable to get a match when testing with fail2ban-regex.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions