Skip to content

Automatic access request support for tsh db login and tsh db connect and tsh proxy db#39156

Merged
greedy52 merged 6 commits intomasterfrom
STeve/34517_tsh_auto_db_request
Mar 19, 2024
Merged

Automatic access request support for tsh db login and tsh db connect and tsh proxy db#39156
greedy52 merged 6 commits intomasterfrom
STeve/34517_tsh_auto_db_request

Conversation

@greedy52
Copy link
Copy Markdown
Contributor

@greedy52 greedy52 commented Mar 8, 2024

Implements #34517

changelog: added automatic access request support for tsh db login and tsh db connect and tsh proxy db

Sample Test Setup:

  • Enterprise
  • Create a user with requester role, give some db_users and db_names to user traits.
  • Login tsh as the new user
  • tsh db ls should be empty. Find databases with tsh request search --kind=db
  • Connect: tsh db connect --db-user <db-user> <db>
  • Login to your admin user from your browser and approve the request (the tab after Access Management).

@greedy52 greedy52 added tsh tsh - Teleport's command line tool for logging into nodes running Teleport. database-access Database access related issues and PRs labels Mar 8, 2024
@greedy52 greedy52 self-assigned this Mar 8, 2024
@greedy52 greedy52 force-pushed the STeve/34517_tsh_auto_db_request branch from d4f85a1 to 1fa3c7e Compare March 11, 2024 20:20
@greedy52 greedy52 marked this pull request as ready for review March 11, 2024 20:51
Comment thread tool/tsh/common/db.go Outdated
Comment thread tool/tsh/common/tsh.go
proxyDB.Flag("labels", labelHelp).StringVar(&cf.Labels)
proxyDB.Flag("query", queryHelp).StringVar(&cf.PredicateExpression)
proxyDB.Flag("request-reason", "Reason for requesting access").StringVar(&cf.RequestReason)
proxyDB.Flag("disable-access-request", "Disable automatic resource access requests").BoolVar(&cf.disableAccessRequest)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In another PR I suggested a different flow for dealing with automatic access requests.
You can see it here: #39003 (comment)

That PR is not merged yet, but because of another reasons.
However, I think my suggestion applies here.

What do you think about it?

Copy link
Copy Markdown
Contributor Author

@greedy52 greedy52 Mar 13, 2024

Choose a reason for hiding this comment

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

Hi Marco. It's a good suggestion but I think consistency is more important. If it's going out soon, I can switch to request-mode. I can wait a few days and check the progress on that PR.

Otherwise, I would prefer getting this in first and coming back to it and implementing the similer role request for db access after that PR is in (and adding the new mode).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sounds good 👍

@greedy52 greedy52 added this pull request to the merge queue Mar 19, 2024
Merged via the queue into master with commit 48c9611 Mar 19, 2024
@greedy52 greedy52 deleted the STeve/34517_tsh_auto_db_request branch March 19, 2024 17:22
@public-teleport-github-review-bot
Copy link
Copy Markdown

@greedy52 See the table below for backport results.

Branch Result
branch/v15 Create PR

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

Labels

database-access Database access related issues and PRs size/md tsh tsh - Teleport's command line tool for logging into nodes running Teleport.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants