Commit Graph
12 Commits
Author SHA1 Message Date
Gavin Frazar 0bcabee6b4 Fix database user auto-provisioning (#51945)
* 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.
2025-02-12 02:51:33 +00:00
Gabriel Corado 0daeb99f90 Use pg_temp to store PostgreSQL auto provisioning procedures (#44255)
* refactor(postgres): use pg_temp to store auto user procedures

* refactor(postgres): code review suggestions

* test(postgres): replace logrus with slog

* chore(postgres): move switch statement to a map

* test(postgres): with wrong slog call

* test(postgres): use slog context functions
2024-07-18 18:29:29 +00:00
Gavin Frazar f2c2e42f19 fix redshift auto user deadlocking (#43335) 2024-07-02 01:04:41 +00:00
Krzysztof Skrzętnicki 26736198a5 Properly coalesce null table list into empty array. (#42961) 2024-06-20 13:41:26 +00:00
Gavin Frazar 54d2e903d5 add RDS MariaDB e2e tests (#40066)
* add AWS RDS MariaDB e2e tests

* fix spurious teardown error logs

* if a role or user doesn't exist, that is not an error nor is it worth
  logging during auto user teardown.

* check for admin option

* add some extra secret fetching checkings

* only drop redshift user if the user exists
2024-04-08 21:46:17 +00:00
Krzysztof Skrzętnicki d6915c8dea Implement granular db permissions for Postgres (RFD 151) (#37808)
* Implement granular db permissions for Postgres (RFD 151)

* docs, whitespace

* Make sure query is closed, even in case of errors along the way

* fix imports
2024-03-04 19:28:22 +00:00
Krzysztof Skrzętnicki 2f069ed51b Fix corner case of NULL/empty arrays comparison for roles (#38429) 2024-02-22 13:53:25 +00:00
Krzysztof Skrzętnicki 469f3bd3ab Qualify oid colum fixing Postgres v16 incompatibility (#38428) 2024-02-22 11:53:24 +00:00
STeve (Xin) Huang 3a6d10fa01 Fix an issue AWS Redshift auto-provisioned user not deleted in drop mode (#36828)
* Fix an issue AWS Redshift auto-provisioned user not deleted in drop mode

* update comment with link
2024-01-22 17:28:15 +00:00
Gabriel Corado df2bb63da6 feat(postgres): support auto-provisioned user deletion Redshift (#34006) 2023-11-01 17:06:27 +00:00
STeve (Xin) Huang 9da436281e Fix an issue auto-provisioned PostgreSQL user may keep old roles indefinitely (#33969)
* Fix an issue auto-provisioned PostgreSQL user may keep old roles indefinitely

* upper case the sql scripts
2023-11-01 16:48:57 +00:00
STeve (Xin) Huang 4dce835487 Database Automatic User Provisioning support for Redshift (#33307)
* Database Automatic User Provisioning support for Redshift

* capitalize sql script

* DeleteUser to fallback to deactivate.

* add TPxxx code to RAISE messages

* fix missing space in scripts
2023-10-23 18:44:38 +00:00