Re: Possibility to disable `ALTER SYSTEM`

From: walther(at)technowledgy(dot)de
To: Greg Sabino Mullane <htamfids(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Bruce Momjian <bruce(at)momjian(dot)us>, Joel Jacobson <joel(at)compiler(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Gabriele Bartolini <gabriele(dot)bartolini(at)enterprisedb(dot)com>, Magnus Hagander <magnus(dot)hagander(at)redpill-linpro(dot)com>, Maciek Sakrejda <m(dot)sakrejda(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: Possibility to disable `ALTER SYSTEM`
Date: 2024-03-19 20:53:46
Message-ID: da22e8b9-3ea2-403c-a23a-2ce4ddfc73cd@technowledgy.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Sabino Mullane:
> On Tue, Mar 19, 2024 at 12:05 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us
> <mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us>> wrote:
>
> If you aren't willing to build a solution that blocks off mods
> using COPY TO FILE/PROGRAM and other readily-available-to-superusers
> tools (plpythonu for instance), I think you shouldn't bother asking
> for a feature at all.  Just trust your superusers.
>
>
> There is a huge gap between using a well-documented standard tool like
> ALTER SYSTEM and going out of your way to modify the configuration files
> through trickery. I think we need to only solve the former as in "hey,
> please don't do that because your changes will be overwritten"

Recap: The requested feature is not supposed to be a security feature.
It is supposed to prevent the admin from accidentally doing the wrong
thing - but not from willfully doing the same through different means.

This very much sounds like a "warning" - how about turning the feature
into one?

Have a GUC warn_on_alter_system = "<message>", which allows the
kubernetes operator to set it to something like "hey, please don't do
that because your changes will be overwritten. Use xyz operator instead.".

This will hardly be taken as a security feature by anyone, but should
essentially achieve what is asked for.

A more sophisticated way would be to make that GUC throw an error, but
have a syntax for ALTER SYSTEM to override this - i.e. similar to a
--force flag.

Best,

Wolfgang

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2024-03-19 21:06:03 Re: Improving EXPLAIN's display of SubPlan nodes
Previous Message Tomas Vondra 2024-03-19 20:34:53 Re: BitmapHeapScan streaming read user and prelim refactoring