Skip to content

Update privileged role allowed configs in supautils.conf.j2#2174

Open
TheOtherBrian1 wants to merge 2 commits into
developfrom
TheOtherBrian1-patch-3
Open

Update privileged role allowed configs in supautils.conf.j2#2174
TheOtherBrian1 wants to merge 2 commits into
developfrom
TheOtherBrian1-patch-3

Conversation

@TheOtherBrian1
Copy link
Copy Markdown
Contributor

@TheOtherBrian1 TheOtherBrian1 commented May 27, 2026

Allows users to change the following superuser configs at the role level:

  • log_connections
  • log_disconnections
  • log_duration
  • log_min_error_statement

What kind of change does this PR introduce?

Exposes log settings that do not interfere with security. Although some of these logs may be expensive, there are imminent plans to force users to pay for log pricing:

As a result, exposing these logs does not pose a long-term cost issue.

What is the current behavior?

Users cannot change these configs via supatutils

What is the new behavior?

Users can change these configs via supautils

Additional context

A Linear issue: "Allow users to change log settings via the MGMT API" seeks to expose certain log configs. It seemed odd not to also expose them at the role level, too, so I added the supautils compatible settings to the list

Allows users to change the following superuser configs at the role level:

- log_disconnections
- log_duration
- log_min_error_statement
- log_recovery_conflict_waits
@TheOtherBrian1 TheOtherBrian1 requested review from a team as code owners May 27, 2026 20:42
supautils.privileged_extensions_superuser = 'supabase_admin'
supautils.privileged_role = 'supabase_privileged_role'
supautils.privileged_role_allowed_configs = 'auto_explain.*, deadlock_timeout, log_lock_waits, log_min_duration_statement, log_min_messages, log_parameter_max_length, log_replication_commands, log_statement, log_temp_files, pg_net.batch_size, pg_net.ttl, pg_stat_statements.*, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_functions, track_io_timing, wal_compression'
supautils.privileged_role_allowed_configs = 'auto_explain.*, deadlock_timeout, log_connections, log_disconnections, log_duration, log_lock_waits, log_min_duration_statement, log_min_error_statement, log_min_messages, log_parameter_max_length, log_replication_commands, log_statement, log_temp_files, pg_net.batch_size, pg_net.ttl, pg_stat_statements.*, pgaudit.log, pgaudit.log_catalog, pgaudit.log_client, pgaudit.log_level, pgaudit.log_relation, pgaudit.log_rows, pgaudit.log_statement, pgaudit.log_statement_once, pgaudit.role, pgrst.*, plan_filter.*, safeupdate.enabled, session_replication_role, track_functions, track_io_timing, wal_compression'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think log_connections and log_disconnections we need to support in your Mgmt API PR. I tested on my own project and it doesn't work via supautils. It seems only superuser GUCs make sense to be in supautils.privileged_role_allowed_configs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used to think that only sighup+ commands were incompatible with supautils. Apparently superuser-backend is incompatible indirectly. It can't be changed in an active session, which functionally means it must be updated directly in the postgres.conf file. I'll remove the log_connections settings from the PR

@soedirgo
Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants