From d48aacae6059b53ff1162fc1290231308be3c497 Mon Sep 17 00:00:00 2001 From: Dylan Hardison Date: Mon, 14 Mar 2016 23:03:49 -0400 Subject: Bug 1229834 - extend information we [audit] log to the syslog --- Bugzilla/Auth/Persist/Cookie.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Bugzilla') diff --git a/Bugzilla/Auth/Persist/Cookie.pm b/Bugzilla/Auth/Persist/Cookie.pm index fd910b118..06661101b 100644 --- a/Bugzilla/Auth/Persist/Cookie.pm +++ b/Bugzilla/Auth/Persist/Cookie.pm @@ -37,6 +37,7 @@ use Bugzilla::Util; use Bugzilla::Token; use List::Util qw(first); +use List::MoreUtils qw(any); sub new { my ($class) = @_; @@ -99,6 +100,15 @@ sub persist_login { -value => $login_cookie, %cookieargs); + my $securemail_groups = Bugzilla->can('securemail_groups') ? Bugzilla->securemail_groups : [ 'admin' ]; + + if (any { $user->in_group($_) } 'mozilla-employee-confidential', @$securemail_groups) { + my $auth_method = eval { ref($user->authorizer->successful_info_getter) } // 'unknown'; + + Bugzilla->audit(sprintf "successful login of %s from %s using \"%s\", authenticated by %s", + $user->login, $ip_addr, $cgi->user_agent // '', $auth_method); + } + return $login_cookie; } -- cgit v1.2.3-24-g4f1b