Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
becc14f7
Commit
becc14f7
authored
Mar 19, 2020
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix audit event that weren't being created for failed LDAP log-in tries
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
3d0a60e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
1 deletion
+17
-1
changelogs/unreleased/211824-fix-failed-ldap-login-audit.yml
changelogs/unreleased/211824-fix-failed-ldap-login-audit.yml
+5
-0
ee/app/controllers/ee/ldap/omniauth_callbacks_controller.rb
ee/app/controllers/ee/ldap/omniauth_callbacks_controller.rb
+9
-0
ee/spec/controllers/ldap/omniauth_callbacks_controller_spec.rb
...ec/controllers/ldap/omniauth_callbacks_controller_spec.rb
+3
-1
No files found.
changelogs/unreleased/211824-fix-failed-ldap-login-audit.yml
0 → 100644
View file @
becc14f7
---
title
:
Fix audit event that weren't being created for failed LDAP log-in tries
merge_request
:
27608
author
:
type
:
fixed
ee/app/controllers/ee/ldap/omniauth_callbacks_controller.rb
View file @
becc14f7
...
...
@@ -13,6 +13,15 @@ module EE
super
end
override
:fail_login
def
fail_login
(
user
)
# This is the same implementation as EE::OmniauthCallbacksController#fail_login but we need to add it here since
# we're overriding Ldap::OmniauthCallbacksController#fail_login, not EE::OmniauthCallbacksController#fail_login.
log_failed_login
(
user
.
username
,
oauth
[
'provider'
])
super
end
private
def
show_ldap_sync_flash
...
...
ee/spec/controllers/ldap/omniauth_callbacks_controller_spec.rb
View file @
becc14f7
...
...
@@ -22,7 +22,9 @@ describe Ldap::OmniauthCallbacksController do
context
'access denied'
do
let
(
:valid_login?
)
{
false
}
it
'logs a failure event'
do
# This test used to pass on retry only, masking an actual bug. We want to
# make sure it passes on the first try.
it
'logs a failure event'
,
retry:
0
do
stub_licensed_features
(
extended_audit_events:
true
)
expect
{
post
provider
}.
to
change
(
SecurityEvent
,
:count
).
by
(
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment