summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Auth
diff options
context:
space:
mode:
authorDylan Hardison <dylan@mozilla.com>2016-03-15 04:03:49 +0100
committerDylan Hardison <dylan@mozilla.com>2016-03-15 04:04:24 +0100
commitd48aacae6059b53ff1162fc1290231308be3c497 (patch)
tree07e81b2f87a1f17873237dbf2cf189c5bb409761 /Bugzilla/Auth
parentc55400fb5fdef96433e11b492e57a4723892d91a (diff)
downloadbugzilla-d48aacae6059b53ff1162fc1290231308be3c497.tar.gz
bugzilla-d48aacae6059b53ff1162fc1290231308be3c497.tar.xz
Bug 1229834 - extend information we [audit] log to the syslog
Diffstat (limited to 'Bugzilla/Auth')
-rw-r--r--Bugzilla/Auth/Persist/Cookie.pm10
1 files changed, 10 insertions, 0 deletions
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;
}