gravitational / teleport

The easiest, and most secure way to access and protect all of your infrastructure.
https://goteleport.com
GNU Affero General Public License v3.0
17.4k stars 1.74k forks source link

Database Access Controls #32627

Open smallinsky opened 1 year ago

smallinsky commented 1 year ago

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.

Tener commented 6 months ago

@r0mant @greedy52

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

  1. RFD, approved and implemented: https://github.com/gravitational/teleport/pull/33734
  2. The first version was implemented with Postgres tables in scope. There were several prerequisites:
  3. Finally, the RFD implementation landed in https://github.com/gravitational/teleport/pull/37808
  4. An further extension for label templates was added https://github.com/gravitational/teleport/pull/38630

Next steps:

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

greedy52 commented 6 months ago

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

Tener commented 6 months ago

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 commented 6 months ago

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

greedy52 commented 5 months ago

FYI E2E auto-user provisioning test is added now https://github.com/gravitational/teleport/pull/40065. We should add tests for Database Access Controls at some point.