Show Table of Contents
第21章 PostgreSQL
PostgreSQL は、オブジェクト関係データベース管理システム (DBMS) です[22]。
Red Hat Enterprise Linux では、PostgreSQL は postgresql-server パッケージで提供されます。以下のコマンドを実行して、postgresql-server パッケージがインストールされているか確認してください。
~]# rpm -q postgresql-server
このパッケージがインストールされていない場合は、root で
yum ユーティリティーを使用してインストールします。
~]# yum install postgresql-server21.1. PostgreSQL と SELinux
PostgreSQL を有効にすると、デフォルトで制限のあるサービスとして実行されます。制限のあるプロセスはそれ自体のドメイン内で実行され、他の制限のあるプロセスとは分離されます。制限のあるプロセスが攻撃を受けると、SELinux ポリシー設定に応じて、攻撃側がリソースにアクセスして加えることができる被害は制限されます。以下に、PostgreSQL 自体のドメイン内で実行している PostgreSQL プロセスの例を示します。ここでは postgresql-server パッケージがインストールされていることを前提としています。
getenforceコマンドを実行して、SELinux が enforcing モードで実行していることを確認します。~]$
getenforceEnforcingSELinux が enforcing モードで実行している場合は、Enforcingが返されます。- root ユーザーで以下のコマンドを実行し、
postgresqlを起動します。~]#
systemctl start postgresql.serviceサービスが稼働していることを確認します。出力は以下のようになり、タイムスタンプのみが異なります。~]#
systemctl start postgresql.servicepostgresql.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 - 以下のコマンドを実行して、
postgresqlプロセスを表示します。~]$
ps -eZ | grep postgressystem_u:system_r:postgresql_t:s0 395 ? 00:00:00 postmaster system_u:system_r:postgresql_t:s0 397 ? 00:00:00 postmaster system_u:system_r:postgresql_t:s0 399 ? 00:00:00 postmaster system_u:system_r:postgresql_t:s0 400 ? 00:00:00 postmaster system_u:system_r:postgresql_t:s0 401 ? 00:00:00 postmaster system_u:system_r:postgresql_t:s0 402 ? 00:00:00 postmasterpostgresqlプロセスに関連する SELinux コンテキストはsystem_u:system_r:postgresql_t:s0です。このコンテキストの最後から 2 番目の部分、postgresql_tがタイプになります。タイプは、プロセスのドメインやファイルのタイプを定義します。この例の場合、postgresqlプロセスはpostgresql_tドメイン内で実行しています。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.