server.xml でパスワードを暗号化する

Confluence インスタンスのセキュリティを強化するために、Tomcat の server.xmlファイルでコネクタの設定に使用するパスワードを暗号化できます。

はじめる前に

This solution requires you to use a protocol supporting the productEncryptionKey property, and encrypted passwords, which may not guarantee complete security, as the configuration in Tomcat's server.xml file will contain all the necessary information to decrypt the password. There are additional security measures you can take to mitigate the worst-case scenario of an attacker potentially impersonating Confluence to gain access to the password. We therefore recommend you safeguard the server where Confluence and the productEncryptionKey file are located.

On this page:

パスワード暗号化のサポートによって Tomcat プロトコルを拡張する次のプロトコルが Confluence には用意されています。テーブルが完全に表示されていない場合は、右にスクロールして内容を確認してください。

プロトコル クラス

Tomcat プロトコルに基づく

パスワード暗号化をサポートする属性

com.atlassian.secrets.tomcat.protocol.
Http11NioProtocolWithPasswordEncryption
Http11NioProtocol
  • KeystorePass
  • KeyPass
  • SSLPassword
  • TruststorePass
com.atlassian.secrets.tomcat.protocol.
Http11Nio2ProtocolWithPasswordEncryption
Http11Nio2Protocol
  • KeystorePass
  • KeyPass
  • SSLPassword
  • TruststorePass
com.atlassian.secrets.tomcat.protocol.
Http11AprProtocolWithPasswordEncryption
Http11AprProtocol
  • KeystorePass
  • KeyPass
  • SSLPassword
  • TruststorePass
com.atlassian.secrets.tomcat.protocol.
AjpNioProtocolWithPasswordEncryption
AjpNioProtocol
  • secret
com.atlassian.secrets.tomcat.protocol.
AjpNio2ProtocolWithPasswordEncryption
AjpNio2Protocol
  • secret
com.atlassian.secrets.tomcat.protocol.
AjpAprProtocolWithPasswordEncryption
AjpAprProtocol
  • secret

単一のパスワードの暗号化

暗号化されたパスワードを作成すると、暗号化ツールは 2 つのファイル、encryptedPasswordencryptionKey を生成します。

また、以下の手順でコマンドの末尾にオプションの引数として独自の暗号化キーファイル名を追加することもできます。これにより、暗号化ツールは、暗号化キーを使用して新しいファイルを生成する代わりに、このファイル名を使用します。独自のファイル名を使用する場合は、現在のディレクトリにそのファイルが既に存在することを確認してください。

  1. <Confluence-installation-directory>/bin に移動します。

  2. 次のコマンドを実行してパスワードを暗号化します。

    java -cp "./*" com.atlassian.secrets.cli.tomcat.TomcatEncryptionTool

    独自のファイル名を追加する場合は、必ずコマンドの最後に名前を追加し、そのファイルが現在のディレクトリにすでに存在することを確認してください。

    java -cp "./*" com.atlassian.secrets.cli.tomcat.TomcatEncryptionTool encryptionKey_1698120035971
  3. プロンプトが出たら、パスワードを入力します。
    コマンドの最後に独自のファイル名を追加しなかった場合、暗号化ツールは encryptedPasswordencryptionKey という 2 つのファイルを生成します。
    コマンドの最後に独自のファイル名を追加した場合、暗号化ツールは encryptedPassword のみを生成します。

  4. 2 つの新しいファイルを安全な場所に移動してください。必要に応じてファイルの名前を変更することもできます。

1 つのコネクタの複数のパスワードの暗号化

1 つのコネクタで複数のパスワードを暗号化する場合は、すべてのパスワードに同じ暗号化キーを使用する必要があります。最初のパスワードを暗号化したら、生成された encryptionKey ファイルを使って、キーのパスを暗号化ツールに渡すことで 2 つ目以降のパスワードを暗号化します。

java -cp "./*" com.atlassian.secrets.cli.tomcat.TomcatEncryptionTool /path/to/encryptionKey

暗号化ツールでは encryptedPassword ファイルのみが生成されます。

コネクタ設定における暗号化されたパスワードの使用

コネクタ設定で暗号化されたパスワードを使用するには、次のプロパティを設定します。

  • protocol -上記のいずれかのプロトコル クラスを使用

  • productEncryptionKey - encryptionKey ファイルのパスを指定

その後、コネクタ構成でプレーンテキストのパスワードの代わりに、暗号化されたパスワードを含むファイルへのパスを使用できます。

たとえば、Confluence の conf/server.xml ファイルでは、キーストアとキー パスワードが暗号化された Http11Nio2 コネクタの構成が次のようになります。

<Connector
    protocol="com.atlassian.secrets.tomcat.protocol.Http11Nio2ProtocolWithPasswordEncryption"
    port="8443"

    (...)

    keystoreFile="/var/secrets/keystore/keystore"
    keystorePass="/var/secrets/keystore/encryptedKeystorePass"
    keyPass="/var/secrets/keystore/encryptedKeyPass"

    productEncryptionKey="/var/secrets/encryptionKey"
/>

productEncryptionKey が 1 つだけ指定されており、keystorePasskeyPass の両方を同じキーで暗号化する必要があることに注意してください。

最終更新日 2023 年 11 月 3 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.