Conversation
Security definer functions are a potential point of attack and should therefore be managed carefully. This PR - Removes the security definer flag where possible - defines the search_path for security definer functions - revokes create statements on public from PUBLIC
for more information, see https://pre-commit.ci
|
Does anyone know why hstore is not loaded? |
I don't understand how master is fine and your branch is not. Do you need a rebase of your branch? Looks like the hstore extension is not pushed even if it is pushed on other branches like : #528 |
|
The errors stem from me not including |
|
As discussed with @cymed, take a common look with @3nids on TEKSI support to check what is the best approach on that matter, knowing that hstore should probably be removed in favor of jsonb. Other extensions like postgis and uuid-ossp will probably use this search path too. Many applications still provide all their tables in the public schema for simplicity reasons, security can be put at another level (for example avoiding any direct connection to the database from an untrusted network) could be a "physical security". |
3nids
left a comment
There was a problem hiding this comment.
The modifications of the changelogs are fine, good catch.
Regarding the addition of the 99_post_all.sql, I would think this does not belong here, but rather in the role script.
|
Regarding the revokation, I would simply remove this right from the roles we are actually creating. |
As long as CONNECT and CREATE ON SCHEMA public is open to PUBLIC, removing the rights from the roles we are actually creating changes nothing, as everyone is member of PUBLIC and therefore has access |
|
What do you think about revoking connect from PUBLIC per default and granting CONNECT to tww_viewer? |
|
Interesting, I'll try to grab some expertise on the topic and come back. |
|
I suggest GRANTing CREATE ON DATABASE to tww_sysadmin |
This comment was marked as off-topic.
This comment was marked as off-topic.
for more information, see https://pre-commit.ci
This reverts commit 9d91a14.
|
@cymed Is this something that should be included in the next Release? If yes what are the stumbling blocks? |
|
The problem is the CI: Even after granting tww_user to postgres, refreshing the materialized view fails |
…-materialized-views
…-materialized-views
|
did we alter the plugin CI tests @ponceta ? |
|
@ponceta ready for review |
General
Describe your changes
Security definer functions are a potential point of attack and should therefore be managed carefully. When the search_path is not defined, any user that can CREATE on public can gain access to SUPERUSER privileges through them.
This PR
CREATE ON DATABASEfromPUBLICCONNECT ON DATABASEfromPUBLICCONNECT ON DATABASEtotww_viewertww_usertotww_user(for Postgres<=16)totww_user` (for Postgres>=17) see Postgres 17 docsTo-Do
Screenshots
Issue ticket number and link
Checklist before requesting a review
Checklist before merge