Skip to content

Commit 877acf2

Browse files
authored
Disable pgaudit when creating users to not expose password (patroni#3175)
pgaudit could be added to shared_preload_libraries, but we don't check for it, because setting a custom GUC works in all cases.
1 parent 8e46086 commit 877acf2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

patroni/postgresql/bootstrap.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,15 @@ def create_or_update_role(self, name: str, password: Optional[str], options: Lis
411411
self._postgresql.query('SET log_min_duration_statement TO -1')
412412
self._postgresql.query("SET log_min_error_statement TO 'log'")
413413
self._postgresql.query("SET pg_stat_statements.track_utility to 'off'")
414+
self._postgresql.query("SET pgaudit.log TO none")
414415
try:
415416
self._postgresql.query(sql)
416417
finally:
417418
self._postgresql.query('RESET log_min_error_statement')
418419
self._postgresql.query('RESET log_min_duration_statement')
419420
self._postgresql.query('RESET log_statement')
420421
self._postgresql.query('RESET pg_stat_statements.track_utility')
422+
self._postgresql.query('RESET pgaudit.log')
421423

422424
def post_bootstrap(self, config: Dict[str, Any], task: CriticalTask) -> Optional[bool]:
423425
try:

0 commit comments

Comments
 (0)