Chapter 8
- It is, although it is not natively enabled. SEPostgreSQL is offered through one of the additionally supplied modules within PostgreSQL called
sepgsql
. As such, it is part of the default technology, but not enabled by default. - As the
sepgsql
module requires a session context, the PostgreSQL database needs to either only be accessed from the local system (using the Unix domain sockets), or labeled networking needs to be enabled and set up in the network.Without labeled networking, any remote connection to the database will fail to provide any context information, and
sepgsql
will refuse the connection. - When a database object is created in PostgreSQL, it will automatically receive an SELinux label. Administrators or database owners can change the labels using the
SECURITY LABEL
statement in PostgreSQL:db_test=# SECURITY LABEL ON COLUMN tb_users.phash IS 'system_u:object_r:sepgsql_secret_table_t:s0';
To query the current label, consult the
pg_seclabels
table...