Skip to content

[v15] Fix database user auto-provisioning#52106

Merged
GavinFrazar merged 1 commit intobranch/v15from
gavinfrazar/v15-fix-db-auto-user-bugs
Feb 16, 2025
Merged

[v15] Fix database user auto-provisioning#52106
GavinFrazar merged 1 commit intobranch/v15from
gavinfrazar/v15-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/v15.

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

@github-actions github-actions Bot added database-access Database access related issues and PRs size/md labels Feb 12, 2025
@GavinFrazar GavinFrazar force-pushed the gavinfrazar/v15-fix-db-auto-user-bugs branch from a90c7c6 to 69144da Compare February 13, 2025 01:32
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from greedy52 February 13, 2025 17:58
@GavinFrazar GavinFrazar force-pushed the gavinfrazar/v15-fix-db-auto-user-bugs branch 2 times, most recently from 7893295 to 7b29328 Compare February 16, 2025 02:42
* 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/v15-fix-db-auto-user-bugs branch from 7b29328 to 49b380b Compare February 16, 2025 02:44
@GavinFrazar GavinFrazar added this pull request to the merge queue Feb 16, 2025
Merged via the queue into branch/v15 with commit 7eb08c7 Feb 16, 2025
@GavinFrazar GavinFrazar deleted the gavinfrazar/v15-fix-db-auto-user-bugs branch February 16, 2025 03:20
@camscale camscale mentioned this pull request Mar 6, 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