Database security is addressed at several levels:
データベースのセキュリティは幾つかのレベルで行なえます:
Data base file protection. All files stored within the database are protected from reading by any account other than the Postgres superuser account.
データベース・ファイルの保護。データベースの中に保存されたすべて のファイルは、Postgresのスーパユーザ・アカ ウント以外のアカウントからは読まれることのないように保護されています。
Connections from a client to the database server are, by default, allowed only via a local Unix socket, not via TCP/IP sockets. The backend must be started with the -i option to allow non-local clients to connect.
デフォルトでは、クライアントからデータベース・サーバへの接続は、 TCP/IP ソケット経由ではなく、ローカルな Unix ソケット経由のみを許すよ うになっています。ローカルなクライアント以外の接続を許すためには、 -iオプションを付けてバックエンドを走らせなくてはな りません。
Client connections can be restricted by IP address and/or user name via the pg_hba.conf file in PG_DATA.
クライアントからの接続は、PG_DATA にある pg_hba.conf ファイルを経て IP アドレスと、かつ/ま たは、ユーザ名とによって制限することができます。
Client connections may be authenticated vi other external packages.
クライアントからの接続は、他の外部パッケージを経て認証されるかも しれません。
Each user in Postgres is assigned a username and (optionally) a password. By default, users do not have write access to databases they did not create.
Postgresの各ユーザにはユーザ名と(オプ ションで)パスワードが与えられます。デフォルトでは、ユーザは自分で作った データベース以外にはアクセスできなくなっています。
Users may be assigned to groups, and table access may be restricted based on group privileges.
ユーザが、グループ に割り当てられていて、 テーブルへのアクセスはグループの権限に基づいて制限されているかもしれま せん。
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 の 範疇外です。