Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/aiven_gatekeeper.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ static bool BUG_01 = true;
static bool
allowed_guc_change_check_hook(bool *newval, void **extra, GucSource source)
{
// Allow the change during early startup
if (!IsUnderPostmaster) {
return true;
}

/* don't allow setting the config value from an elevated context
* otherwise a combination of ALTER SYSTEM SET aiven.pg_security_agent TO off;
* SELECT pg_reload_conf(); could be used in a two step attack to disable
Expand All @@ -119,6 +124,11 @@ allowed_guc_change_check_hook(bool *newval, void **extra, GucSource source)
static bool
allowed_guc_change_allowed_superusers(char **newval, void **extra, GucSource source)
{
// Allow the change during early startup
if (!IsUnderPostmaster) {
return true;
}

/* same as with the boolean version */
return !(pg_security_agent_strict || creating_extension || is_security_restricted() || is_elevated());
}
Expand Down