Chapter 8. セキュリティ

Table of Contents
ユーザ認証
ユーザ名とグループ
アクセス制御
関数とルール

Database security is addressed at several levels:

データベースのセキュリティは幾つかのレベルで行なえます:

ユーザ認証

Authentication is the process by which the backend server and postmaster ensure that the user requesting access to data is in fact who he/she claims to be. All users who invoke Postgres are checked against the contents of the pg_user class to ensure that they are authorized to do so. However, verification of the user's actual identity is performed in a variety of ways:

認証は、バックエンド・サーバと postmasterが、ユーザのリクエストしているデー タへのアクセスが、実際にそのユーザに対して許されているかどうかを確かめる プロセスです。 Postgresを起動するすべてのユーザは、 pg_user クラスの内容と照合され、ユーザがそれぞれ行 なおうとしていることが承認されていることを確認されます。しかし、そのユー ザの実際の身元の証明は色々な方法で行なわれます:

ユーザシェルから

A backend server started from a user shell notes the user's (effective) user-id before performing a setuid to the user-id of user postgres. The effective user-id is used as the basis for access control checks. No other authentication is conducted.

ユーザシェルから走らされるバックエンドサーバは、ユーザ postgres のユーザ-id へ setuidする前に、ユーザの(有効な)ユーザ-id を控 えておきます。有効なユーザ-id はアクセス制御の確認の基として使われます。 それ以外の認証は行なわれません。

ネットワークから

If the Postgres system is built as distributed, access to the Internet TCP port of the postmaster process is available to anyone. The DBA configures the pg_hba.conf file in the PGDATA directory to specify what authentication system is to be used according to the host making the connection and which database it is connecting to. See pg_hba.conf(5) for a description of the authentication systems available. Of course, host-based authentication is not fool-proof in Unix, either. It is possible for determined intruders to also masquerade the origination host. Those security issues are beyond the scope of Postgres.

もし、その Postgres システムが分散 利用できるように構築されていれば、誰でも postmaster プロセスのインターネット TCP ポー トへアクセスできます。そこで DBA は、 PGDATA ディレクトリの pg_hba.conf ファイルに構成を記述して、接続を行なうホストと接続するデータベータベー ス毎に、どの認証システムを使うかを指定します。 利用できる認証システムについては pg_hba.conf(5) を参照して下さい。もちろん、Unixにおけるホストベースの認証はいずれも完璧 ではありません。確信をもった侵入者がべつのホストに成り済ますことが出来ます。 これらのセキュリティの問題は Postgres の 範疇外です。