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

Add approval scopes #3559

Closed
klizhentas opened this issue Apr 9, 2020 · 5 comments
Closed

Add approval scopes #3559

klizhentas opened this issue Apr 9, 2020 · 5 comments
Labels
good-to-have Not a blocker for the milestone, but good to have implemented

Comments

@klizhentas
Copy link
Contributor

klizhentas commented Apr 9, 2020

Feature Request

For RBAC in approval workflows, here is a current way to provide user access to grant
access to the access_requests:

kind: role
version: v3
metadata:
  name: access_request_grantor
spec:
  # SSH options used for user sessions 
  options:

  # allow section declares a list of resource/verb combinations that are
  # allowed for the users of this role. by default nothing is allowed.
  allow:
    logins: ['this-login-does-not-exist']

    rules:
    - resources:
      - access_request
         verbs: [list, read, update]


  # the deny section uses the identical format as the 'allow' section.
  # the deny rules always override allow rules.
  deny:
    
    node_labels:
      '*': '*'

Where clause adds ability to limit the scope of approval, but we have to make sure it's supported for this resource in the implementation:

kind: role
version: v3
metadata:
  name: access_request_grantor
spec:
  # SSH options used for user sessions 
  options:

  # allow section declares a list of resource/verb combinations that are
  # allowed for the users of this role. by default nothing is allowed.
  allow:
    logins: ['this-login-does-not-exist']

    rules:
    - resources:
      - access_request
         verbs: [list, read, update]
         where: contains(resource.metadata.labels, "dev")

See implementation and tests for where clause here

@klizhentas klizhentas added the good-to-have Not a blocker for the milestone, but good to have implemented label Apr 9, 2020
@klizhentas klizhentas added this to the Security Improvements milestone Apr 9, 2020
@benarent
Copy link
Contributor

benarent commented Apr 9, 2020

I like this proposal it's a good use and example for using where:, having full CRUD is powerful, but I wonder if we could have an alias for a collection of actions. e.g. verbs: [approver/requestor].. also for a pure approver, Do the need the create verb?

@klizhentas
Copy link
Contributor Author

we don't need create verb, removed it from the example

@benarent benarent added the c-bo label May 15, 2020
@benarent benarent removed this from the Security Improvements milestone May 15, 2020
@travelton
Copy link
Contributor

If I understand this issue, the goal is to scope approval of role escalation to resources that contain a specific tag?

Here's an example:

I have three teams using Teleport; ops, devs, dbas.

devs have the ability to approve access_request from dbas to devs. However, devs should not have the ability to approve an access_request from ops to dbas.

Could we simplify this by defining the config via yaml? So in the following case, an additional approve key under allow would permit the devs role to request dba role and approve access requests for devs role requests only.

kind: role
metadata:
  name: devs
spec:
  options:
    # ...
  allow:
    request:
      roles: ['dba']
    approve:
      roles: ['devs']
    # ...
  deny:
    # ...

@webvictim
Copy link
Contributor

@travelton I think the scope of the issue is slightly different to what you're requesting here.

@klizhentas
Copy link
Contributor Author

dupe of #4749

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-to-have Not a blocker for the milestone, but good to have implemented
Projects
None yet
Development

No branches or pull requests

4 participants