Are failed logins logged?

Forum for questions and support relating to the 1.28.x releases only.
Locked
careycj0219
Posts: 2
Joined: Sun Sep 27, 2015 4:52 pm

Are failed logins logged?

Post by careycj0219 »

Does zoneminder log failed logins anywhere, or is it possible to enable? I've searched around with no luck so far.
User avatar
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: Are failed logins logged?

Post by asker »

Yes this fix was added recently. It is not part of 1.28.1 but is part of development snapshots. It's a tiny patch to a php file. You can add it to 1.28.1 yourself.
https://github.com/knnniggett/ZoneMinde ... 66ab717576
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
careycj0219
Posts: 2
Joined: Sun Sep 27, 2015 4:52 pm

Re: Are failed logins logged?

Post by careycj0219 »

That's just what I was looking for. I ended up expanding just a bit to also log the source ip address, since my goal was to use this with fail2ban.

$remoteAddr = $_SERVER['REMOTE_ADDR'];
Info( "Login successful for user \"$username\" from $remoteAddr" );
Warning( "Login denied for user \"$username\" from $remoteAddr" );

Everything is now working as expected.

Thanks!
Locked