Skip to content

Commit 1deb6f2

Browse files
staaldraadsoedirgo
andauthored
feat: update supautils (#1879)
* feat: update supautils Bumps supautils to allow disabling `copy ... program` utility * fix: set supautils.disable_program guc * Apply suggestion from @soedirgo --------- Co-authored-by: Bobbie Soedirgo <31685197+soedirgo@users.noreply.github.com>
1 parent 8ac1c90 commit 1deb6f2

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

ansible/files/postgresql_config/supautils.conf.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ supautils.privileged_role = 'postgres'
1313
supautils.privileged_role_allowed_configs = 'auto_explain.*, log_lock_waits, log_min_duration_statement, log_min_messages, 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_io_timing, wal_compression'
1414
supautils.reserved_memberships = 'pg_read_server_files, pg_write_server_files, pg_execute_server_program, supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, supabase_etl_admin, dashboard_user, pgbouncer, authenticator'
1515
supautils.reserved_roles = 'supabase_admin, supabase_auth_admin, supabase_storage_admin, supabase_read_only_user, supabase_realtime_admin, supabase_replication_admin, supabase_etl_admin, dashboard_user, pgbouncer, service_role*, authenticator*, authenticated*, anon*'
16+
supautils.disable_program = 'true'

ansible/vars.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ postgres_major:
1010

1111
# Full version strings for each major version
1212
postgres_release:
13-
postgresorioledb-17: "17.5.1.055-orioledb"
14-
postgres17: "17.6.1.034"
15-
postgres15: "15.14.1.034"
13+
postgresorioledb-17: "17.5.1.056-orioledb"
14+
postgres17: "17.6.1.035"
15+
postgres15: "15.14.1.035"
1616

1717
# Non Postgres Extensions
1818
pgbouncer_release: 1.19.0

nix/ext/supautils.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77

88
stdenv.mkDerivation rec {
99
pname = "supautils";
10-
version = "3.0.0";
10+
version = "3.0.2";
1111

1212
buildInputs = [ postgresql ];
1313

1414
src = fetchFromGitHub {
1515
owner = "supabase";
1616
repo = pname;
1717
rev = "refs/tags/v${version}";
18-
hash = "sha256-EKKjNZQf7HwP/MxpHoPtbEtwXk+wO241GoXVcXpDMFs=";
18+
hash = "sha256-WTLZShBFVgb18vVi15TSZvtJrNUFgQa6mBkavvRSoUE=";
1919
};
2020

2121
installPhase = ''

nix/tests/expected/security.out

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ order by 1,2;
3131
vault | update_secret
3232
(20 rows)
3333

34+
-- supautils disables copy ... program
35+
copy (select '') to program 'id';
36+
ERROR: COPY TO/FROM PROGRAM not allowed
37+
DETAIL: The copy to/from program utility statement is disabled

nix/tests/sql/security.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ from pg_catalog.pg_proc p
77
where p.proowner = (select oid from pg_catalog.pg_roles where rolname = 'supabase_admin')
88
and p.prosecdef = true
99
order by 1,2;
10+
11+
-- supautils disables copy ... program
12+
copy (select '') to program 'id';

0 commit comments

Comments
 (0)