Skip to content

RBAC Migration Followup #25: Deprecate policy commands in favor of RBAC equivalents #18096

Open

Description

@enj

Add cobra.Command.Deprecated to the following commands:

  1. oc adm policy {add|remove}-{cluster-}role-{to|from}-{user|group} ---> oc {create|edit} {cluster}role{binding}
  2. oc adm policy reconcile-cluster-role-{bindings} ---> oc auth reconcile
  3. oc policy can-i ---> oc auth can-i
  4. oc adm policy remove-{user|group} ---> oc {delete|edit} rolebinding
  5. Update docs https://docs.openshift.org/latest/admin_guide/manage_rbac.html#managing-role-bindings
  6. Update ansible playbooks to use RBAC commands instead

Deprecated should contain a pointer to the RBAC equivalent command. The CLI completions will have to be regenerated since we do not include completions for deprecated commands.

@liggitt @deads2k any others come to mind?

cc @bparees @openshift/sig-security @juanvallejo @fabianofranz

Activity

  1. added this to the milestone on Jan 12, 2018
  2. bparees commented on Jan 12, 2018

    @bparees
    Contributor

    oc adm policy {add|remove|-{cluster-}role-{to|from}-{user|group} ---> oc create {cluster}role{binding}

    I still think this is a bad user experience.

    1. I now need to come up w/ unique names every time i want to give a user a new rolebinding (and remember/determine that name when i want to remove it)
    2. it explodes the number of etcd objects (one binding object per role assignment per user)
  3. bparees commented on Jan 12, 2018

    @bparees
    Contributor

    (my comments only apply to (1) obviously. I have no opinion on (2) and (3))

  4. enj commented on Jan 12, 2018

    @enj
    ContributorAuthor

    I still think this is a bad user experience.

    I do agree that it is less convenient, but I find it significantly easier to understand what is actually happening when you run these commands. For example, add-role-to-user, by default, creates or edits a role binding to a cluster role. This is hard to reason about, especially when you run a bunch of these commands together.

    I now need to come up w/ unique names every time i want to give a user a new rolebinding (and remember/determine that name when i want to remove it)

    Yeah, it forces you to take ownership of the objects you are creating. It is explicit, and also less convenient. You can also edit an existing object, which requires you to understand the objects.

    it explodes the number of etcd objects (one binding object per role assignment per user)

    Kube seems to survive with this. The whole behavior of these commands was built around etcd2's poor scaling with a large number of objects. Let's hope etcd3 is beyond that.

  5. bparees commented on Jan 12, 2018

    @bparees
    Contributor

    Kube seems to survive with this.

    Kube also survives w/ the secrets problem. They don't run the scale we do as I understand it.

  6. simo5 commented on Jan 12, 2018

    @simo5

    @bparees I think this is mitigated by the fact that we do not force the creation of objects as we do for secrets. Asmins that end up creating large amount of objects unnnecessarily can be coached and helped to consolidate those, so at least the size problem is manageable where it makes sense.
    This is to say I do not think size matters should influence this issue.

  7. simo5 commented on Jan 12, 2018

    @simo5

    @enj on point 1, should we instead point to some other command to eidt groups ?
    I am not confortable pointing at a create command from a modify command, some people know what they are doing and they deserve to be pointed at how to modify objects, telling them to create new ones is not helpful or appropriate in all cases.

  8. enj commented on Jan 12, 2018

    @enj
    ContributorAuthor

    Kube also survives w/ the secrets problem. They don't run the scale we do as I understand it.

    Sure but secrets are large (because of the embedded cert) and we have controllers auto create (and recreate if deleted) a bunch of them per namespace. RBAC objects are small, and we only auto create a few for the SAs and admin user when the project is created. Any extra objects are purely user driven.

  9. simo5 commented on Jan 12, 2018

    @simo5

    Point n. 4 doesn't really have equivalents. While the other commands can reasonably transitioned to oc edit rolebindings as generally you are going to edit a specific role/binding, the command in 4 is more complex and removes a user from all namepace roles (even though it doesn't touch cluster rolebindings). I'll leave that one out as I think it falls off the "equivalent" charter for this issue.

  10. 22 remaining items

  11. deads2k commented on Jan 15, 2018

    @deads2k
    Contributor

    What's the pressure to have to do something now for add-*?

    There were complaints about either the add or the remove (I don't recall which), not performing retry on conflicts when fighting with other controllers (I think it was controllers). That brought it to the forefront and the realization that we have two sets of commands, one set I wrote in openshift pre-3.0 and one set I wrote in kube with lessons learned from 3.0.

    Having two sets of commands leads to confusion and cases where the discrete sets don't play nice together. Both sets are internally consistent, but mixing the two makes your head hurt.

    Ultimately, I'm not going to die on the hill for it, but if I had to own it, I wouldn't want to keep responding to issues, feature request, and pulls that take the openshift commands further from the upstream.

  12. simo5 commented on Jan 16, 2018

    @simo5

    @deads2k I am confused now, what are the 2 sets of commands you are referring to ?

    So it seems like there is no consensus on removeing these commands, and most seem to oppose the idea of adding new commands.
    Most also recognize that the way the add-{cluser}role-to-[user|group] command behave is not ok.

    So would it be fair to say that most agree that:

    1. changing these commands to not re-use rolebindings on add is desirable (unless -rolebinding-name is provided) while allowing them to keep removing stuff as they do now is acceptable. This means they woun't be deprecated, only "improved" with a backward compatible change in behavior.

    2. It still seem we should just deprecate remove-[user|group] and eventually remove them.

    @smarterclayton @liggitt ?

  13. simo5 commented on Jan 22, 2018

    @simo5
  14. simo5 commented on Jan 31, 2018

    @simo5

    Ok folks #18102 is all green and implements the above, PTAL
    @deads2k @liggitt @smarterclayton

  15. added a commit that references this issue on Feb 5, 2018
    dc275c5
  16. enj commented on Feb 12, 2018

    @enj
    ContributorAuthor

    Leaving open for future deprecation.

  17. reopened this on Feb 12, 2018
  18. openshift-bot commented on May 13, 2018

    @openshift-bot
    Contributor

    Issues go stale after 90d of inactivity.

    Mark the issue as fresh by commenting /remove-lifecycle stale.
    Stale issues rot after an additional 30d of inactivity and eventually close.
    Exclude this issue from closing by commenting /lifecycle frozen.

    If this issue is safe to close now please do so with /close.

    /lifecycle stale

  19. added
    lifecycle/stale
    on May 13, 2018
  20. added
    lifecycle/frozen
    and removed
    lifecycle/stale
    on May 17, 2018
  21. simo5 commented on Jul 5, 2018

    @simo5

    I do not see us deprecating the policy commands @enj, should we keep this card around ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/documentationarea/securityarea/techdebtlifecycle/frozenpriority/P2sig/security

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions