Content-type: text/html
Security-Enhanced Linux secures the postgresql processes via flexible mandatory access control.
If you want to allow postgresql to use ssh and rsync for point-in-time recovery, you must turn on the postgresql_can_rsync boolean.
setsebool -P postgresql_can_rsync 1
If you want to allow unprivileged users to execute DDL statement, you must turn on the postgresql_selinux_users_ddl boolean.
setsebool -P postgresql_selinux_users_ddl 1
If you want to allow database admins to execute DML statement, you must turn on the postgresql_selinux_unconfined_dbadm boolean.
setsebool -P postgresql_selinux_unconfined_dbadm 1
If you want to allow users to connect to PostgreSQL, you must turn on the selinuxuser_postgresql_connect_enabled boolean.
setsebool -P selinuxuser_postgresql_connect_enabled 1
If you want to allow transmit client label to foreign database, you must turn on the postgresql_selinux_transmit_client_label boolean.
setsebool -P postgresql_selinux_transmit_client_label 1
If you want to allow users to resolve user passwd entries directly from ldap rather then using a sssd serve for the postgresql_t, you must turn on the authlogin_nsswitch_use_ldap boolean.
setsebool -P authlogin_nsswitch_use_ldap 1
If you want to allow confined applications to run with kerberos for the postgresql_t, you must turn on the kerberos_enabled boolean.
setsebool -P kerberos_enabled 1
You can see the context of a file using the -Z option to lsP Policy governs the access confined processes have to these files. SELinux postgresql policy is very flexible allowing users to setup their postgresql processes in as secure a method as possible.
The following file types are defined for postgresql:
postgresql_db_t
- Set files with the postgresql_db_t type, if you want to treat the files as postgresql database content.
postgresql_etc_t
- Set files with the postgresql_etc_t type, if you want to store postgresql files in the /etc directories.
postgresql_exec_t
- Set files with the postgresql_exec_t type, if you want to transition an executable to the postgresql_t domain.
postgresql_initrc_exec_t
- Set files with the postgresql_initrc_exec_t type, if you want to transition an executable to the postgresql_initrc_t domain.
postgresql_lock_t
- Set files with the postgresql_lock_t type, if you want to treat the files as postgresql lock data, stored under the /var/lock directory
postgresql_log_t
- Set files with the postgresql_log_t type, if you want to treat the data as postgresql log data, usually stored under the /var/log directory.
postgresql_tmp_t
- Set files with the postgresql_tmp_t type, if you want to store postgresql temporary files in the /tmp directories.