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

Access request locks #9478

Merged
merged 3 commits into from
Jan 24, 2022
Merged

Access request locks #9478

merged 3 commits into from
Jan 24, 2022

Conversation

espadolini
Copy link
Contributor

@espadolini espadolini commented Dec 17, 2021

This adds a way to add a lock on a specific access request; when such a lock is in force, any identity that has used that access request is prevented from interacting with the system - the user can however switch to a less privileged certificate, or log out and log back in again and regain their own regular access.

While it would be sufficient to lock the user out if malicious behavior was suspected, this helps in the case where elevated privileges are requested and granted by mistake; the request can be blocked and the user can then continue working with their own static roles (or with the roles granted by other access requests).

The types.LockTarget type will gain a new AccessRequest field, following the nomenclature of AccessRequests/access_requests already in use in the session.start event.

As locks are currently only supported on the tool side by tctl, the only addition to the UX is a new flag to tctl lock

tctl lock --access-request=261e80c5-357b-4c43-9b67-40a6bc4c6e4d

that matches the field name in types.LockTarget (converted to kebab-case as the other CLI options are).

Such a lock serialized as yaml (as output by tctl get locks or tctl get lock/<lockname>) looks like

kind: lock
metadata:
  id: 1640275041241490000
  name: 7f6d2edc-68cb-4b98-b2d4-859c75284c8a
spec:
  target:
    access_request: 261e80c5-357b-4c43-9b67-40a6bc4c6e4d
version: v2

Fixes TEL-Q321-3.

Docs PR:

lib/auth/auth.go Outdated Show resolved Hide resolved
@espadolini espadolini force-pushed the espadolini/access-request-locks branch from fb06466 to 209be8d Compare December 20, 2021 15:29
@espadolini espadolini changed the base branch from master to espadolini/tls-access-requests December 20, 2021 15:57
@espadolini espadolini force-pushed the espadolini/tls-access-requests branch from 9230a68 to 14b945c Compare December 22, 2021 15:43
@espadolini espadolini force-pushed the espadolini/access-request-locks branch from 209be8d to 6a76765 Compare December 22, 2021 15:43
@espadolini espadolini force-pushed the espadolini/tls-access-requests branch from 14b945c to c3fc400 Compare December 22, 2021 17:08
@espadolini espadolini force-pushed the espadolini/access-request-locks branch from 6a76765 to a2c0cb1 Compare December 22, 2021 17:09
@russjones
Copy link
Contributor

russjones commented Dec 23, 2021

@espadolini Can you update the PR description with details on CLI UX?

Can you also update documentation (you can do that in another ticket) https://goteleport.com/docs/access-controls/guides/locking/

@espadolini espadolini force-pushed the espadolini/tls-access-requests branch from c3fc400 to 85c9b02 Compare December 28, 2021 16:35
@espadolini espadolini force-pushed the espadolini/access-request-locks branch from 89b4fa3 to 84537ee Compare December 28, 2021 17:50
@espadolini espadolini changed the base branch from espadolini/tls-access-requests to master December 28, 2021 17:51
@espadolini espadolini changed the base branch from master to espadolini/tls-access-requests December 28, 2021 19:43
@espadolini espadolini force-pushed the espadolini/tls-access-requests branch 2 times, most recently from fec96d7 to cc3d2a7 Compare December 30, 2021 10:16
@espadolini espadolini force-pushed the espadolini/access-request-locks branch from 84537ee to 42c415e Compare December 30, 2021 10:18
@espadolini espadolini force-pushed the espadolini/tls-access-requests branch from cc3d2a7 to 52ca4fd Compare December 30, 2021 16:44
@espadolini espadolini force-pushed the espadolini/access-request-locks branch from 38b0df5 to 1fde7d7 Compare December 30, 2021 16:44
@espadolini espadolini force-pushed the espadolini/tls-access-requests branch from 52ca4fd to f363105 Compare December 31, 2021 10:32
@espadolini espadolini force-pushed the espadolini/access-request-locks branch from 1fde7d7 to f71e3f5 Compare December 31, 2021 10:34
@espadolini espadolini force-pushed the espadolini/tls-access-requests branch 3 times, most recently from 14170d9 to 696a154 Compare January 3, 2022 11:26
Base automatically changed from espadolini/tls-access-requests to master January 3, 2022 14:22
@espadolini espadolini force-pushed the espadolini/access-request-locks branch from f71e3f5 to 692784d Compare January 3, 2022 14:27
@espadolini espadolini marked this pull request as ready for review January 3, 2022 14:28
@github-actions github-actions bot added documentation tctl tctl - Teleport admin tool labels Jan 3, 2022
@github-actions github-actions bot requested a review from codingllama January 3, 2022 14:28
@espadolini espadolini force-pushed the espadolini/access-request-locks branch from 572dde0 to 5c99384 Compare January 20, 2022 19:04
@espadolini espadolini force-pushed the espadolini/access-request-locks branch from 5c99384 to c8eec54 Compare January 24, 2022 12:26
@espadolini espadolini force-pushed the espadolini/access-request-locks branch from c8eec54 to 42ca5b5 Compare January 24, 2022 18:59
@espadolini espadolini enabled auto-merge (squash) January 24, 2022 19:00
@espadolini espadolini force-pushed the espadolini/access-request-locks branch from 42ca5b5 to b6ea7a2 Compare January 24, 2022 19:18
@espadolini espadolini merged commit 95c53ad into master Jan 24, 2022
@espadolini espadolini deleted the espadolini/access-request-locks branch January 24, 2022 19:40
espadolini added a commit that referenced this pull request Jan 25, 2022
* Add access request locks

This only contains the internal part, no user-visible changes

* Add a `tctl lock` flag to specify an access request ID

* Tests for access request locks
espadolini added a commit that referenced this pull request Jan 25, 2022
* Add access request locks

This only contains the internal part, no user-visible changes

* Add a `tctl lock` flag to specify an access request ID

* Tests for access request locks
espadolini added a commit that referenced this pull request Jan 26, 2022
* Add access request locks

This only contains the internal part, no user-visible changes

* Add a `tctl lock` flag to specify an access request ID

* Tests for access request locks
espadolini added a commit that referenced this pull request Jan 26, 2022
* Add access request locks

This only contains the internal part, no user-visible changes

* Add a `tctl lock` flag to specify an access request ID

* Tests for access request locks
espadolini added a commit that referenced this pull request Jan 27, 2022
* Add access request locks

This only contains the internal part, no user-visible changes

* Add a `tctl lock` flag to specify an access request ID

* Tests for access request locks
espadolini added a commit that referenced this pull request Jan 27, 2022
* Add access request locks

This only contains the internal part, no user-visible changes

* Add a `tctl lock` flag to specify an access request ID

* Tests for access request locks
@webvictim webvictim mentioned this pull request Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tctl tctl - Teleport admin tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants