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

docs: include a separate page for OSS access requests #22613

Merged
merged 1 commit into from
Mar 11, 2023

Conversation

zmb3
Copy link
Collaborator

@zmb3 zmb3 commented Mar 3, 2023

OSS Teleport supports access requests in a very limited fashion. Make this clear by adding a separate page that covers the supported OSS features.

Also fix a number of other small requests and issues with the docs while we're here, and add screenshots for the web UI workflows.

Closes #4818
Closes #13175
Closes #14889
Closes #15979
Closes #22587

## Requesting Access

While Teleport Enterprise supports the same CLI-based workflows for requesting
access to roles, most users will prefer to request access via the web UI.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to reviewers: I didn't cover the tsh flow for requesting access from the command line. Wasn't sure if I should duplicate a bunch of that info here or link to that page in some way, so I just briefly mentioned it here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the tsh flow is what you're referencing with "the same CLI-based workflow", then we need to mention it somehow. That "the same" isn't referencing anything previously discussed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's previously discussed in the admonition 5-10 lines above?

Comment on lines 105 to 137
In OSS Teleport, Access Requests must be reviewed by a cluster administrator
with the ability to run `tctl` on the Auth Server.

Administrators can list requests with `tctl requests ls`, and view the details
of a particular request with `tctl requests get`.

To quickly approve or deny a request, use `tctl requests review`.

For example, to approve a request:

```code
$ tctl requests review --approve --author=bob bc8ca931-fec9-4b15-9a6f-20c13c5641a9
```
Copy link
Contributor

@nklaassen nklaassen Mar 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, my bad, I was misremembering the requirements for this when we chatted earlier

It is not necessary to run tctl on the auth server necessarily, you just need update permissions for access_request resources in one of your roles. So you could have a reviewer role like this and use tctl remotely:

kind: role
version: v6
metadata:
  name: reviewer
spec:
  allow:
    rules:
      - resources:
        - access_request
        verbs:
        - update

Also, I believe tctl requests review will not work in OSS. This is because whatever user you give for the --author flag, they will not be allowed to review requests, because non of their roles can have spec.allow.review_requests in OSS.

So, only tctl request approve or tctl request deny should work in OSS.

This comment was marked as outdated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, should have actually tried that, I was missing the rules block in the yaml, I've updated the yaml in the original comment to a role I just tested

Copy link
Contributor

@alexfornuto alexfornuto Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I added the required lines to my reviewer role:

kind: role
metadata:
  id: BLAH
  name: reviewer
spec:
  allow:
    ...
    ...
    rules:
    - resources:
      - access_request
      verbs:
      - update
    ...
    ...

Then I logged out and in as a user with that role:

> Profile URL:        https://myhomelabdomain
  Logged in as:       alex
  Cluster:            myhomelabdomain
  Roles:              access, auditor, dba, editor, reviewer, sp-manager

But I still don't see requests:

❯ tctl requests ls
Token Requestor Metadata Resources Created At (UTC) Request TTL Session TTL Status Request Reason Resolve Reason 
----- --------- -------- --------- ---------------- ----------- ----------- ------ -------------- -------------- 


❯

Edit: PS I was still able to approve, but in this scenario the requester has to provide the request ID manually to the reviewer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right, in order to view them you will need the read and list verbs, I should have included those

Copy link
Collaborator Author

@zmb3 zmb3 Mar 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you could have a reviewer role like this and use tctl remotely:

I'm not sure we should even mention this. If you can't use tctl locally, then you're probably on Cloud, which means you can use tsh.

Adding these allow rules is a slippery slope because you can accidentally give yourself too many permissions and break the security of the access request system. What do you think about not mentioning it in the docs, even though it does work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can't use tctl locally, then you're probably on Cloud

Or you're a security tech with admin rights in Teleport, but not given direct access to the host running the auth service.
Or you can access it, but it's difficult enough to access a shell in that environment. In my case, the auth service is in a container on a server, so I need to SSH then docker exec a shell or tctl command. Or what about a k8s cluster?

Just my 2¢, do as you will.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay @nklaassen @alexfornuto it seems this is our unresolved item.

I am hesitant to even mention how to configure RBAC to run tctl remotely here, as these rules allow you to modify any access request, including those of your own or of others. If this is done in an enterprise environment it could result in privilege escalation attacks.

Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we should not recommend to include update rules for access requests, it gives too much power to the reviewer. Technically running tctl directly on Auth gives you even more power that could be abused, but I think it makes it clear that this should only be possible for cluster admins and avoids us publishing a dangerous config that people could copy and use without realizing it.

Copy link
Contributor

@alexfornuto alexfornuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't completed this review, got as far as I could before the existing instructions failed.

docs/pages/access-controls/access-requests.mdx Outdated Show resolved Hide resolved
docs/config.json Outdated Show resolved Hide resolved
docs/pages/access-controls/access-requests.mdx Outdated Show resolved Hide resolved
docs/config.json Show resolved Hide resolved
Comment on lines 105 to 137
In OSS Teleport, Access Requests must be reviewed by a cluster administrator
with the ability to run `tctl` on the Auth Server.

Administrators can list requests with `tctl requests ls`, and view the details
of a particular request with `tctl requests get`.

To quickly approve or deny a request, use `tctl requests review`.

For example, to approve a request:

```code
$ tctl requests review --approve --author=bob bc8ca931-fec9-4b15-9a6f-20c13c5641a9
```

This comment was marked as outdated.

@alexfornuto alexfornuto self-requested a review March 7, 2023 20:27
```code
$ tctl request approve \
--roles="db-support" \
--reason="approved access to db-support, dba is not necessary"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the ID is part of the command.

Suggested change
--reason="approved access to db-support, dba is not necessary"
--reason="approved access to db-support, dba is not necessary" \

## Requesting Access

While Teleport Enterprise supports the same CLI-based workflows for requesting
access to roles, most users will prefer to request access via the web UI.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the tsh flow is what you're referencing with "the same CLI-based workflow", then we need to mention it somehow. That "the same" isn't referencing anything previously discussed.

OSS Teleport supports access requests in a very limited fashion.
Make this clear by adding a separate page that covers the supported OSS
features.

Closes #4818
Closes #13175
Closes #14889
Closes #15979
Closes #22587
@zmb3 zmb3 force-pushed the zmb3/access-request-docs branch from 952c9c3 to 0f04f26 Compare March 10, 2023 23:44
@zmb3 zmb3 enabled auto-merge March 11, 2023 00:05
@zmb3 zmb3 added this pull request to the merge queue Mar 11, 2023
Merged via the queue into master with commit b8bf90b Mar 11, 2023
@public-teleport-github-review-bot

@zmb3 See the table below for backport results.

Branch Result
branch/v10 Failed
branch/v11 Create PR
branch/v12 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants