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

Database Access Controls #32627

Closed
smallinsky opened this issue Sep 27, 2023 · 7 comments
Closed

Database Access Controls #32627

smallinsky opened this issue Sep 27, 2023 · 7 comments
Assignees
Labels
database-access Database access related issues and PRs feature-request Used for new features in Teleport, improvements to current should be #enhancements

Comments

@smallinsky
Copy link
Contributor

What Would You Like Teleport to Do?

We'd like Teleport to provide the capability to configure database user permissions directly from within Teleport. At present, when a new database user is added, the sole method to grant that user database permissions is through the database's internal permission model. This involves logging into the database and assigning specific permissions, creating redundancy with Teleport's RBAC Permission model.

With the introduction of Database Auto User Provisioning, Teleport now possesses the ability to auto-configure users and grant predetermined permissions by assigning them to the appropriate database groups.

Investigate into transitioning the database permission model to one where Teleport can automatically manage user permissions based on Teleport's internal Permission model. This functionality should be configurable through Teleport's RBAC and Access Graph features.

@smallinsky smallinsky added feature-request Used for new features in Teleport, improvements to current should be #enhancements database-access Database access related issues and PRs labels Sep 27, 2023
@Tener Tener changed the title Manage Teleport Database Permission Model Managed Teleport Database Permission Model Sep 29, 2023
@Tener Tener changed the title Managed Teleport Database Permission Model Database Access Controls Mar 21, 2024
@Tener
Copy link
Contributor

Tener commented Mar 21, 2024

@r0mant @greedy52

Here is the current status of this project along with the upcoming tasks.

  1. RFD, approved and implemented: RFD 151: Database Permission Management #33734
  2. The first version was implemented with Postgres tables in scope. There were several prerequisites:
  1. Finally, the RFD implementation landed in Implement granular db permissions for Postgres (RFD 151) #37808
  2. An further extension for label templates was added Implement label templates for db objects #38630

Next steps:

The TAG integration is the next phase, currently split into following implementation tasks:

  • Implement persistence for database_object resource #39756
  • Store imported database objects on tsh db connect
  • Cache database_object_import_rule resources.
  • Periodically import all database objects from all databases.
  • Export database objects to TAG (Teleport side)
  • Import database objects from Teleport (TAG side):
    • Dispatch from stream
    • Implement db permissions RBAC
    • Store new nodes and edges in the database
  • Update TAG UI to show database objects

@greedy52
Copy link
Contributor

greedy52 commented Mar 26, 2024

Roman has brought up the idea of passing labels from db_server to db objects. What are your thoughts on it?

@Tener
Copy link
Contributor

Tener commented Mar 26, 2024

Roman has brought up the idea of passing labels from db_server to db objects. What are your thoughts on it?

This sounds vaguely useful, but I'm not sure what the exact use case would be.

I'm wary of copying all labels as is; this feels like a fragile setup. Instead, we could extend the templates to allow another variable, say: {{ db.environment }}. This way the user has full control of what is copied from the db_server.

@r0mant
Copy link
Collaborator

r0mant commented Mar 26, 2024

@greedy52 @Tener Let's not worry about this for now.

@greedy52
Copy link
Contributor

greedy52 commented Apr 3, 2024

FYI E2E auto-user provisioning test is added now #40065. We should add tests for Database Access Controls at some point.

@zmb3
Copy link
Collaborator

zmb3 commented Sep 30, 2024

Anything left to do here or can this be closed?

@Tener
Copy link
Contributor

Tener commented Oct 1, 2024

I think we can close. There is always more work to do, but the scope #32627 (comment) is covered.

@Tener Tener closed this as completed Oct 1, 2024
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 feature-request Used for new features in Teleport, improvements to current should be #enhancements
Projects
None yet
Development

No branches or pull requests

5 participants