Este conteúdo não está disponível no idioma selecionado.
Chapter 21. PostgreSQL
PostgreSQL is an Object-Relational database management system (DBMS).[19]
In Red Hat Enterprise Linux, the postgresql-server package provides PostgreSQL. Enter the following command to see if the postgresql-server package is installed:
rpm -q postgresql-server
~]# rpm -q postgresql-server
If it is not installed, use the
yum utility as root to install it:
yum install postgresql-server
~]# yum install postgresql-server
21.1. PostgreSQL and SELinux Copiar o linkLink copiado para a área de transferência!
Copiar o linkLink copiado para a área de transferência!
When PostgreSQL is enabled, it runs confined by default. Confined processes run in their own domains, and are separated from other confined processes. If a confined process is compromised by an attacker, depending on SELinux policy configuration, an attacker's access to resources and the possible damage they can do is limited. The following example demonstrates the PostgreSQL processes running in their own domain. This example assumes the postgresql-server package is installed:
- Run the
getenforcecommand to confirm SELinux is running in enforcing mode:getenforce Enforcing
~]$ getenforce EnforcingCopy to Clipboard Copied! Toggle word wrap Toggle overflow The command returnsEnforcingwhen SELinux is running in enforcing mode. - Enter the following command as the root user to start
postgresql:systemctl start postgresql.service
~]# systemctl start postgresql.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that the service is running. The output should include the information below (only the time stamp will differ):systemctl start postgresql.service postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled) Active: active (running) since Mon 2013-08-05 14:57:49 CEST; 12s
~]# systemctl start postgresql.service postgresql.service - PostgreSQL database server Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled) Active: active (running) since Mon 2013-08-05 14:57:49 CEST; 12sCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Enter the following command to view the
postgresqlprocesses:Copy to Clipboard Copied! Toggle word wrap Toggle overflow The SELinux context associated with thepostgresqlprocesses issystem_u:system_r:postgresql_t:s0. The second last part of the context,postgresql_t, is the type. A type defines a domain for processes and a type for files. In this case, thepostgresqlprocesses are running in thepostgresql_tdomain.