Skip to content

[v16] Fix database user auto-provisioning#52100

Merged
GavinFrazar merged 1 commit intobranch/v16from
gavinfrazar/v16-fix-db-auto-user-bugs
Feb 13, 2025
Merged

[v16] Fix database user auto-provisioning#52100
GavinFrazar merged 1 commit intobranch/v16from
gavinfrazar/v16-fix-db-auto-user-bugs

Conversation

@GavinFrazar
Copy link
Copy Markdown
Contributor

@GavinFrazar GavinFrazar commented Feb 12, 2025

Changelog: Fixed Postgres database access control privileges auto-provisioning to grant USAGE on schemas as needed for table privileges and fixed an issue that prevented user privileges from being revoked at the end of their session in some cases.

Backports #51945 to branch/v16.

edit: Also backports with the small patch from #52104 to branch/v16.

@github-actions github-actions Bot added backport database-access Database access related issues and PRs size/md labels Feb 12, 2025
* Use a custom query to find user db privileges on tables to avoid the
  "grantor" filter condition in the information_schema.tables_privileges
  view. This fixes the cases where the grantor for a privilege is set to
  the table owner rather than the user (teleport) who issued the grant.
  Most notably, this happens when a superuser grants privileges on a
  table they do not own to a user.
* Grant USAGE on schemas that contain tables where we intend to grant
  table privileges. This is necessary to use the table privileges we
  grant.
* Wrap all remaining plpgsql procedure creation/calls with retries.
* Add a db permissions e2e test for RDS
* Expand e2e tests to test with and without a superuser db admin
* Significantly speed up the RDS e2e tests by wrapping EventuallyWithT
  in a helper func that tries the condition func immediately rather than
  waiting for the first tick duration.
@GavinFrazar GavinFrazar force-pushed the gavinfrazar/v16-fix-db-auto-user-bugs branch from 40da3fe to 4833e0e Compare February 13, 2025 01:26
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from greedy52 February 13, 2025 08:39
@GavinFrazar GavinFrazar added this pull request to the merge queue Feb 13, 2025
Merged via the queue into branch/v16 with commit f7563e3 Feb 13, 2025
@GavinFrazar GavinFrazar deleted the gavinfrazar/v16-fix-db-auto-user-bugs branch February 13, 2025 18:59
@camscale camscale mentioned this pull request Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport database-access Database access related issues and PRs size/md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants