V-261884
Crunchy Data Postgres 16 Security Technical Implementation Guide
Title
Database objects (including but not limited to tables, indexes, storage, stored procedures, functions, triggers, links to software external to the DBMS, etc.) must be owned by database/PostgreSQL principals authorized for ownership.
Description
<VulnDiscussion>Within the database, object ownership implies full privileges to the owned object, including the privilege to assign access to the owned objects to other subjects. Database functions and procedures can be coded using definer's rights. This allows anyone who uses the object to perform the actions if they were the owner. If not properly managed, this can lead to privileged actions being taken by unauthorized individuals. Conversely, if critical tables or other objects rely on unau...
Fix Text (Documentation Requirement)
Assign ownership of authorized objects to authorized object owner accounts. #### Schema Owner To create a schema owned by the user "bob", run the following SQL: $ sudo su - postgres $ psql -c "CREATE SCHEMA test AUTHORIZATION bob" To alter the ownership of an existing object to be owned by the user "bob", run the following SQL: $ sudo su - postgres $ psql -c "ALTER SCHEMA test OWNER TO bob"