Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the user when there are no matching groups #10634

Merged
merged 1 commit into from Aug 24, 2016

Conversation

jvlcek
Copy link
Member

@jvlcek jvlcek commented Aug 19, 2016

I have confirmed this PR using external auth with IPA/LDPA
Marking as WIP until I am able to confirm with LDAP directly.

Purpose or Intent

The purpose of this PR is to address a situation where:

A valid user with valid MiQ groups had been able to successfully log into MiQ.

After which the LDAP system administrator removed all MiQ groups from the
user with the intent of preventing the user access to MiQ.

However when no valid groups were returned from LDAP the user's group
information was not updated in the DB and the UI would use the stale,
valid records.

This PR simply updates the user's miq_groups to empty when there are
no matching groups. Thereby preventing user authorization.

Steps for Testing/QA

To test this:

1 - configure MiQ to validate using LDAP,
either directly to an LDAP server or to an external authentication server
that supports LDAP (e.g. IPA)

2 - Create a valid user with valid MiQ groups in LDAP

3 - log into MiQ using the valid user, then log off

4 - Remove all valid MiQ groups from the user in LDAP

5 - confirm login attempts into MiQ using the valid user that no longer has
valid MiQ groups in LDAP fails.

Description

When all MiQ groups are removed for a given user
on the "authenticator" the user's DB entry must
be updated to show no matching MiQ groups.

https://bugzilla.redhat.com/show_bug.cgi?id=1342082

@jvlcek
Copy link
Member Author

jvlcek commented Aug 19, 2016

@abellotti and @kbrock Please review

@abellotti
Copy link
Member

@jvlcek until we get a memberof overlay on ApacheDS, you can configure MiqLdap directly to the Ldap of an IPA server and test against that. IPA's openldap implements the memberof overlay.

@jvlcek jvlcek changed the title [WIP] Update the user when there are no matching groups Update the user when there are no matching groups Aug 23, 2016
When all MiQ groups are removed for a given user
on the "authenticator" the user's DB entry must
be updated to show no matching MiQ groups.

https://bugzilla.redhat.com/show_bug.cgi?id=1342082
@miq-bot
Copy link
Member

miq-bot commented Aug 23, 2016

Checked commit jvlcek@7b439c1 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1
2 files checked, 0 offenses detected
Everything looks good. 🍪

@abellotti
Copy link
Member

@jvlcek nice job diving in and getting this PR done. LGTM!!

@gtanzillo
Copy link
Member

👍 LGTM too!

@jvlcek
Copy link
Member Author

jvlcek commented Aug 23, 2016

@gtanzillo and @abellotti Once the travis tests to pass I'll request a final review/merge.

@jvlcek
Copy link
Member Author

jvlcek commented Aug 23, 2016

@abellotti Please take a look.
As you know I tested with both miq_ldap and external auth.

@abellotti
Copy link
Member

I'm good with this. @kbrock can we borrow your 👀 Thanks.

@kbrock
Copy link
Member

kbrock commented Aug 24, 2016

This looks great :shipit:

@kbrock kbrock removed the wip label Aug 24, 2016
@gtanzillo gtanzillo added this to the Sprint 46 Ending Sep 12, 2016 milestone Aug 24, 2016
@gtanzillo gtanzillo merged commit 426e642 into ManageIQ:master Aug 24, 2016
chessbyte pushed a commit that referenced this pull request Aug 24, 2016
Update the user when there are no matching groups
(cherry picked from commit 426e642)
@chessbyte
Copy link
Member

Darga backport details:

$ git cherry-pick -x -m 1  426e642     
[darga bab3149] Merge pull request #10634 from jvlcek/bz_1342082_ext_auth_groups
 Author: Gregg Tanzillo <gtanzill@redhat.com>
 Date: Wed Aug 24 11:43:15 2016 -0400
 2 files changed, 25 insertions(+), 1 deletion(-)

$ git log
commit bab3149e524e31922ef355acb80219572bc00b77
Author: Gregg Tanzillo <gtanzill@redhat.com>
Date:   Wed Aug 24 11:43:15 2016 -0400

    Merge pull request #10634 from jvlcek/bz_1342082_ext_auth_groups

    Update the user when there are no matching groups
    (cherry picked from commit 426e6420e94cb050311ea99992db43dd490992d8)

@jvlcek jvlcek deleted the bz_1342082_ext_auth_groups branch September 7, 2016 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants