Bug 1303011 - [RFE] LDAP sync via API
[RFE] LDAP sync via API
Status: NEW
Product: OpenShift Container Platform
Classification: Red Hat
Component: RFE (Show other bugs)
3.1.0
Unspecified Unspecified
unspecified Severity low
: ---
: ---
Assigned To: Michal Fojtik
Johnny Liu
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-29 04:57 EST by Evgheni Dereveanchin
Modified: 2017-06-22 17:23 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Evgheni Dereveanchin 2016-01-29 04:57:10 EST
Description of request:
Currently it's only possible to do an LDAP sync from the Master using the oadm tool. THis request is to expose this functionality via the API to make it possible to specify a group list to sync. This may be useful for large LDAP trees  or other situations where it's not optimal to log into the Master each time groups have to be sync'ed and doing this for the whole LDAP tree can take a long time.
Comment 1 Clayton Coleman 2016-02-07 14:20:36 EST
Can you detail the situations under which an API is required?

The long term vision for this sort of function is sync would be run inside a ScheduledJob on the cluster inside of a container containing the openshift binaries and whatever sync tools an admin wanted.

    oc new-build gitrepository_containing_sync_defaults openshift/origin --name ldapsync
    oc run --image ldapsync --every=4hr ldapsync-job

We are only likely to build APIs that enable a wide range of integrations, vs making it easier for a local admin to synchronize their specific LDAP groups.  We also generally do not create APIs that front very long running operations, since there are better ways to model those operations (as the above mentioned "job").
Comment 2 Mangirdas 2016-02-09 10:12:40 EST
(In reply to Clayton Coleman from comment #1)
> Can you detail the situations under which an API is required?
> 
> The long term vision for this sort of function is sync would be run inside a
> ScheduledJob on the cluster inside of a container containing the openshift
> binaries and whatever sync tools an admin wanted.
> 
>     oc new-build gitrepository_containing_sync_defaults openshift/origin
> --name ldapsync
>     oc run --image ldapsync --every=4hr ldapsync-job
> 
> We are only likely to build APIs that enable a wide range of integrations,
> vs making it easier for a local admin to synchronize their specific LDAP
> groups.  We also generally do not create APIs that front very long running
> operations, since there are better ways to model those operations (as the
> above mentioned "job").

Our Organisation AD is very big. 

So to synchronize ALL AD groups to Openshift is not an option and overkill from resource point of view.

So on each team/project onboard to the platform they provide AD groups as a pre-requisite to our central orchestration/management portal. 

Portal itself goes and queries Openshift to create projects and provision all accesses for the team. In this case because we don't do all AD synchronization, groups does not exist in openshift to provision/rolebind access to. 

In this case flow would be:
Central orchestration portal does:
1. Creates project on Openshift.
2. Execute ldapsync for particular project/team ad groups to enable them in Openshift. 
3. executes Rolebinding for groups on project.
4. Set quotas on projects. 

After all this we will execute ldap sych for existing groups as a scheduled task.

But initialy we need to be able to say to "say" to openshift: "Please sync this group only from this AD only, and this is group DN". (We have more than 2 AD to sync with too)
Comment 3 Steve Kuznetsov 2016-02-22 11:21:04 EST
Syncing individual groups is already supported by the LDAP sync mechanism, Is it not acceptable to create specific LDAP sync configurations and run the `oadm groups sync` command in order to sync the specific groups you require?
Comment 4 Evgheni Dereveanchin 2016-03-16 07:20:29 EDT
The request here is to be able to so LDAP sync without the "oadm" tool so that this can be done, say, from a dedicated pod serving some custom workflow.
Comment 5 Steve Kuznetsov 2016-03-16 08:34:49 EDT
Using one of the provided Docker images containing the OpenShift client tools, this can already be done. 

If a namespace is created for which the service account has permissions to alter groups, a pod in that namespace with the OpenShift client tools could run the sync as you describe. 

The namespace would have to be protected, as anyone with edit permission on the namespace would have escalation powers by leveraging the service account's permissions.

A scheduled job could be set up to run this pod at a predetermined interval, etc. 

I will try to build an example system that does this in order to demonstrate the concept.

Note You need to log in before you can comment on or make changes to this bug.