Skip to content

[v17] Fix database user auto-provisioning#52047

Merged
GavinFrazar merged 1 commit intobranch/v17from
bot/backport-51945-branch/v17
Feb 12, 2025
Merged

[v17] Fix database user auto-provisioning#52047
GavinFrazar merged 1 commit intobranch/v17from
bot/backport-51945-branch/v17

Conversation

@GavinFrazar
Copy link
Copy Markdown
Contributor

Backport #51945 to branch/v17

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.

* 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.
@github-actions github-actions Bot added backport database-access Database access related issues and PRs size/md labels Feb 12, 2025
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from greedy52 February 12, 2025 14:50
@GavinFrazar GavinFrazar added this pull request to the merge queue Feb 12, 2025
Merged via the queue into branch/v17 with commit 42008fa Feb 12, 2025
@GavinFrazar GavinFrazar deleted the bot/backport-51945-branch/v17 branch February 12, 2025 18:25
@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.

4 participants