From 184a0c3f4dc71ffe0ff60415265f457d3a5f59e4 Mon Sep 17 00:00:00 2001 From: JES <37674956+EmsTatay@users.noreply.github.com> Date: Mon, 2 Apr 2018 11:14:39 -0700 Subject: [PATCH 1/2] Create piwik2.conf Sample JAIL for operating fail2ban with the plugin --- piwik2.conf | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 piwik2.conf diff --git a/piwik2.conf b/piwik2.conf new file mode 100644 index 0000000..0ff4b72 --- /dev/null +++ b/piwik2.conf @@ -0,0 +1,19 @@ +# ------------------------------------------------------------------------- +# Fail2Ban jail for piwik - /etc/fail2ban/jail.d/piwik2.conf +# For use with filter /etc/fail2ban/filter.d/piwik-2018A.conf +# ------------------------------------------------------------------------- +# NOTE: The `logpath` parameter, provided below, is a common path, +# However, it *may* not be the correct path on YOUR server setup. +# Adjust accordingly! +# Common Paths: +# - Debian/Ubuntu/FreeBSD /var/log/auth.log +# - Fedora /var/log/secure +# - macOS/OS X /var/log/secure.log +# ------------------------------------------------------------------------- +# +[piwik-2018A] +enabled = true +filter = piwik-2018A +logpath = /full/path/to/your/piwik/installation/tmp/logs/piwik.log +maxretry = 3 +port = http,https From a4dbf02be4b030b7916814cb1a9d03d54feda342 Mon Sep 17 00:00:00 2001 From: JES <37674956+EmsTatay@users.noreply.github.com> Date: Mon, 2 Apr 2018 11:15:43 -0700 Subject: [PATCH 2/2] Update LoginFailLog.php --- LoginFailLog.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LoginFailLog.php b/LoginFailLog.php index 4447f96..31906ff 100644 --- a/LoginFailLog.php +++ b/LoginFailLog.php @@ -28,7 +28,7 @@ public function logFailedLogin($login) { $ip = StaticContainer::get('Piwik\IP'); $logger = StaticContainer::get('Psr\Log\LoggerInterface'); - $logger->warning('Failed login from {ip} with username \'{user}\'.', array( + $logger->warning('Failed PIWIK login from {ip} with username \'{user}\'.', array( 'ip' => $ip->getIpFromHeader(), 'user' => $login ));