Skip to content

Conversation

ikalnytskyi
Copy link
Owner

@ikalnytskyi ikalnytskyi commented Jan 2, 2023

The 'setup-postgres' action used to create a superuser that hasn't been
exposed to users via 'connection-uri' output. The superuser has been
named after GitHub Action's system user (i.e. 'runner'), had no password
and could have been used via PostgreSQL client applications [1] or when
using manually constructed connection URI with no user set.

The user set via action's input parameters used to be unprivileged with
escalated permissions to create databases on-demand. I don't remember
why I made things this way, maybe I got confused somewhere along the
way, but I don't think having both private superuser and public
unprivileged user is a good idea. It's quite common in tests to
dynamically create databases and/or users for applications under test,
thus superuser permissions are required.

This patch removes a private superuser named after the GitHub Action's
system user (i.e. 'runner') in favor of granting superuser permissions
to a user set via action's input parameters. Those who explicitly relied
on 'runner' user might got affected as the user WON'T exist anymore.

[1] https://www.postgresql.org/docs/15/reference-client.html

@ikalnytskyi ikalnytskyi force-pushed the superuser branch 23 times, most recently from a3b3d77 to 0e6e33f Compare January 3, 2023 14:07
The 'setup-postgres' action used to create a superuser that hasn't been
exposed to users via 'connection-uri' output. The superuser has been
named after GitHub Action's system user (i.e. 'runner'), had no password
and could have been used via PostgreSQL client applications [1] or when
using manually constructed connection URI with no user set.

The user set via action's input parameters used to be unprivileged with
escalated permissions to create databases on-demand. I don't remember
why I made things this way, maybe I got confused somewhere along the
way, but I don't think having both private superuser and public
unprivileged user is a good idea. It's quite common in tests to
dynamically create databases and/or users for applications under test,
thus superuser permissions are required.

This patch removes a private superuser named after the GitHub Action's
system user (i.e. 'runner') in favor of granting superuser permissions
to a user set via action's input parameters. Those who explicitly relied
on 'runner' user might got affected as the user WON'T exist anymore.

[1] https://www.postgresql.org/docs/15/reference-client.html
@ikalnytskyi ikalnytskyi changed the title Create superuser by default BREAKING CHANGE: create superuser Jan 3, 2023
@ikalnytskyi ikalnytskyi merged commit ae2fb38 into master Jan 3, 2023
@ikalnytskyi ikalnytskyi deleted the superuser branch January 3, 2023 14:42
@ikalnytskyi ikalnytskyi linked an issue Jan 3, 2023 that may be closed by this pull request
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.

New user has no rights, and cannot be changed when default
1 participant