# PostgreSQL設定のプロパティ

{% hint style="info" %}
本ページに記載のプロパティは、PostgreSQL認証を使用している場合にのみ適用されます。PostgreSQL認証のサポートは、[`kcm-guacamole-auth-jdbc-postgresql`パッケージを使用してインストール](https://github.com/Keeper-Security/gitbook-jp-kcm/blob/main/advanced-configuration/guacamole.properties/broken-reference/README.md)します。[keeper/guacamoleのDockerイメージ](https://docs.keeper.io/keeper-connection-manager/installation/docker-compose-install/keeper-guacamole)を使用する場合、PostgreSQL認証のサポートは、環境変数を使用して設定します。
{% endhint %}

* [TCP接続情報](#id-.postgresqlconfigurationpropertiesv2.x-tcpconnectioninformation)
* [データベース名とクレデンシャル](#id-.postgresqlconfigurationpropertiesv2.x-databasenameandcredentials)
* [データベースのパスワードポリシー](#id-.postgresqlconfigurationpropertiesv2.x-databasepasswordpolicies)
  * パスワードの最小長と複雑さ
  * パスワードの最小/最大有効期間
  * パスワードの使い回しの防止
* [データベース同時接続数の制限](#id-.postgresqlconfigurationpropertiesv2.x-databaseconcurrentconnectionlimits)
  * 同時接続の一般的な制限
  * ユーザーあたりの同時接続の制限
  * 絶対的な同時接続の制限
* [データベースのユーザーアカウントの要件](#id-.postgresqlconfigurationpropertiesv2.x-require-userdatabaseuseraccountrequirements)

### TCP接続情報 <a href="#id-.postgresqlconfigurationpropertiesv2.x-tcpconnectioninformation" id="id-.postgresqlconfigurationpropertiesv2.x-tcpconnectioninformation"></a>

PostgreSQLデータベースのTCP接続の詳細情報。

| プロパティ名                | デフォルト値    | 説明                                    |
| --------------------- | --------- | ------------------------------------- |
| `postgresql-hostname` | localhost | データベースサーバーのホスト名。                      |
| `postgresql-port`     | 5432      | データベースサーバーで実行されているPostgreSQLサービスのポート。 |

### データベース名とクレデンシャル <a href="#id-.postgresqlconfigurationpropertiesv2.x-databasenameandcredentials" id="id-.postgresqlconfigurationpropertiesv2.x-databasenameandcredentials"></a>

使用するデータベースの名前と、データベースに接続するときに使用するクレデンシャルです。データベースのいずれかの認証拡張機能を使用する場合は、**これらのプロパティが必要**です。

| プロパティ名                | 説明                                      |
| --------------------- | --------------------------------------- |
| `postgresql-database` | Guacamoleがクエリを実行する対象のデータベース名。           |
| `postgresql-username` | Guacamoleがデータベースに接続するために使用するユーザーのユーザー名。 |
| `postgresql-password` | データベースでの認証時にGuacamoleが指定するパスワード。        |

### データベースのパスワードポリシー <a href="#id-.postgresqlconfigurationpropertiesv2.x-databasepasswordpolicies" id="id-.postgresqlconfigurationpropertiesv2.x-databasepasswordpolicies"></a>

パスワードの複雑さ、長さ、変更頻度、使い回しに関して、すべてのデータベースユーザーに適用すべき制限です。

{% hint style="danger" %}
これらのプロパティは、データベースの外部で定義されたユーザーには適用されません。
{% endhint %}

#### パスワードの最小長と複雑度 <a href="#id-.postgresqlconfigurationpropertiesv2.x-minimumpasswordlengthandcomplexity" id="id-.postgresqlconfigurationpropertiesv2.x-minimumpasswordlengthandcomplexity"></a>

| プロパティ名                                           | デフォルト値 | 説明                                                                                                       |
| ------------------------------------------------ | ------ | -------------------------------------------------------------------------------------------------------- |
| `postgresql-user-password-min-length`            | 0      | 各パスワードの最小長 (文字単位)。指定した場合、ユーザーはパスワードをこの長さ未満の値に変更できなくなります。デフォルトでは、最小長は強制されません。空のパスワードは許可されません。             |
| `postgresql-user-password-require-multiple-case` | false  | 「true」に設定した場合、すべてのパスワードが少なくとも1つの大文字と1つの小文字を使用する必要があります。デフォルトでは、パスワードに大文字と小文字を混在させる必要はありません。              |
| `postgresql-user-password-require-symbol`        | false  | 「true」に設定した場合、すべてのパスワードが少なくとも1つの記号を使用する必要があります（「記号」とは英数字以外の任意の文字）。デフォルトでは、パスワードに記号を使用する必要はありません。         |
| `postgresql-user-password-require-digit`         | false  | 「true」に設定した場合、すべてのパスワードが少なくとも1つの数字を使用する必要があります (「数字」とは任意の数を表わす文字)。デフォルトでは、パスワードに数字を使用する必要はありません。         |
| `postgresql-user-password-prohibit-username`     | false  | 「true」に設定した場合、大文字と小文字に関係なく、パスワードにユーザー自身のユーザー名を使用することが禁止されます。デフォルトでは、パスワードにユーザー自身のユーザー名を使用することは禁止されていません。 |

#### パスワードの最小/最大有効期間 <a href="#id-.postgresqlconfigurationpropertiesv2.x-minimum-maximumpasswordage" id="id-.postgresqlconfigurationpropertiesv2.x-minimum-maximumpasswordage"></a>

| プロパティ名                             | 説明                                                                                                     |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------ |
| `postgresql-user-password-min-age` | パスワードを変更するまでに経過する必要のある最小日数 (ユーザーがパスワードを頻繁に変更しすぎないようにし、パスワードの流用を無効にするための保護)。デフォルトでは、パスワード変更頻度に制限はありません。 |
| `postgresql-user-password-max-age` | ユーザーがパスワードの変更を求められるまでの最大経過日数。デフォルトでは、ユーザーのパスワードは自動的には失効しません。                                           |

#### パスワード使い回しの防止 <a href="#id-.postgresqlconfigurationpropertiesv2.x-passwordreuseprevention" id="id-.postgresqlconfigurationpropertiesv2.x-passwordreuseprevention"></a>

| プロパティ名                                  | 説明                                                                                             |
| --------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `postgresql-user-password-history-size` | ユーザーごとに記憶する必要のある過去のパスワードの数。指定した場合、ユーザーはこれらのパスワードを使い回しできなくなります。デフォルトでは、過去のパスワードの使い回しは禁止されていません。 |

### データベース同時接続数の制限 <a href="#id-.postgresqlconfigurationpropertiesv2.x-databaseconcurrentconnectionlimits" id="id-.postgresqlconfigurationpropertiesv2.x-databaseconcurrentconnectionlimits"></a>

接続全体でデフォルトとして適用される同時使用制限です。ただし、絶対的な同時接続制限を除き、これらの制限は管理者が各接続を編集することで、接続単位で上書きすることが可能です。

#### 同時接続の一般的な制限 <a href="#id-.postgresqlconfigurationpropertiesv2.x-generalconnectionconcurrencylimits" id="id-.postgresqlconfigurationpropertiesv2.x-generalconnectionconcurrencylimits"></a>

| プロパティ名                                     | デフォルト値 | 説明                                                                              |
| ------------------------------------------ | ------ | ------------------------------------------------------------------------------- |
| `postgresql-default-max-connections`       | 0      | 特定の接続に許可する同時接続の最大数。ここで、「0」は無制限を意味します。デフォルトでは、接続に対して同時接続総数の制限は適用されません。           |
| `postgresql-default-max-group-connections` | 0      | 特定の分散接続グループに許可する同時接続の最大数。ここで、「0」は無制限を意味します。デフォルトでは、接続グループに対して同時接続総数の制限は適用されません。 |

#### ユーザーあたりの同時接続の制限 <a href="#id-.postgresqlconfigurationpropertiesv2.x-per-userconcurrencylimits" id="id-.postgresqlconfigurationpropertiesv2.x-per-userconcurrencylimits"></a>

| プロパティ名                                              | デフォルト値 | 説明                                                                                                                                               |
| --------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `postgresql-default-max-connections-per-user`       | 0      | 接続を確立する個々のユーザーに許可する同時接続の最大数。ここで、「0」は無制限を意味します。デフォルトでは、接続に対してユーザーあたりの同時接続の制限は適用されません。                                                             |
| `postgresql-default-max-group-connections-per-user` | 1      | 負荷分散接続グループへの接続を確立する個々のユーザーに許可する同時接続の最大数。ここで、「0」は無制限を意味します。デフォルトでは、1人のユーザーがそのグループ内で使用可能な接続を使い果たさないように、各負荷分散接続グループに対するユーザーごとの接続を1つだけに制限することはありません。 |

#### 絶対的な同時接続の制限 <a href="#id-.postgresqlconfigurationpropertiesv2.x-absoluteconcurrencylimits" id="id-.postgresqlconfigurationpropertiesv2.x-absoluteconcurrencylimits"></a>

| プロパティ名                                | デフォルト値 | 説明                                                                                                                           |
| ------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
| `postgresql-absolute-max-connections` | 0      | Guacamoleサーバー全体に許可する同時接続の絶対的な最大数。どのユーザーが接続を確立しているか、どの接続またはグループがアクセスされているかは考慮しません。ここで、「0」は無制限を意味します。デフォルトでは、絶対的な同時制限は適用されません。 |

### データベースのユーザーアカウントの要件 <a href="#id-.postgresqlconfigurationpropertiesv2.x-require-userdatabaseuseraccountrequirements" id="id-.postgresqlconfigurationpropertiesv2.x-require-userdatabaseuseraccountrequirements"></a>

PostgreSQLデータベース内に存在しないユーザーに対して、他の拡張機能による認証を許可するか否か。「true」に設定すると、認証されたユーザーがデータベース内で定義されていない限り、認証の試行は拒否されます。

| プロパティ名                     | デフォルト値 | 説明                                                                                                                                                                                                           |
| -------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `postgresql-user-required` | false  | 「true」に設定した場合、成功した認証の試行をすべて、PostgreSQL内で定義されたユーザーに関連付ける必要があります。他のメカニズム（LDAPなど）を使用してユーザー認証に成功しても、対応するPostgreSQLユーザーが存在しない場合は、その認証は拒否されます。デフォルトでは、そのユーザーのアカウントがPostgreSQL内に存在するか否かに関係なく、認証の試行が成功すれば、成功と見なされます。 |
