基本的な暗号化

データベース パスワードの暗号化

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

この方法では、シンプルな難読化である Base64Cipher を使用します。

ステップ 1. パスワードの暗号化

  1. <Jira-installation-directory>/bin に移動します。
  2. 次のコマンドを実行してパスワードを暗号化します。以下に示すオプションの引数を使用することもできます。 

    java -cp "./*" com.atlassian.db.config.password.tools.CipherTool
オプション引数...
  • -- silent -s: ロギングを最小限に制限します
  • -- help -h: すべてのパラメータを含むヘルプ メッセージを出力します
  • -- mode -m: パスワード処理方法を暗号化または 復号化として定義します。省略した場合は "encrypt" が使用されます
  • -- password -p: プレーン テキスト パスワード。省略した場合、入力を求められます。パスワードが履歴に保存されないように、このパラメータを省略することをおすすめします。
サンプル出力...
main DEBUG [db.config.password.DefaultCipherProvider] Initiate cipher provider class: com.atlassian.db.config.password.ciphers.base64.Base64Cipher
main DEBUG [password.ciphers.base64.Base64Cipher] Initiate Base64Cipher
main DEBUG [password.ciphers.base64.Base64Cipher] Encrypting data...
main DEBUG [password.ciphers.base64.Base64Cipher] Encryption done. Success! Put those lines in database config xml file:
<atlassian-password-cipher-provider>com.atlassian.db.config.password.ciphers.base64.Base64Cipher</atlassian-password-cipher-provider> <password>ZGZnZGZn</password> and restart the instance.

ステップ 2. 暗号化されたパスワードを dbconfig.xml に追加

  1. Jira ホーム ディレクトリに移動し、dbconfig.xml ファイルをバックアップします。Jira サーバーの外部の安全な場所にバックアップを移動します。
  2. dbconfig.xml ファイルを編集します。
  3. <password> タグを CLI によって生成されたタグに置き換えます。例:

    <atlassian-password-cipher-provider>com.atlassian.db.config.password.ciphers.base64.Base64Cipher</atlassian-password-cipher-provider> <password>put-your-obfuscated-password-here</password>
  4. Jira を再起動します。

パスワードの復号化

パスワードを復号化するには、-m decrypt パラメータを使用してコマンドを拡張します。

java -cp "./*" com.atlassian.db.config.password.tools.CipherTool -m decrypt

パスワードを求められたら、dbconfig.xmlファイルから暗号化されたパスワードを指定します。

トラブルシューティング

変更を元に戻す場合...

変更を元に戻すには、dbconfig.xmlファイルから <atlassian-password-cipher-provider> タグを削除し、暗号化されたパスワードをプレーン テキストのパスワードに変更します。

Jira の再起動後にセットアップ画面が開く...

セットアップ画面が表示される場合、Jira はデータベースに接続して構成情報にアクセスすることができていません。これはほとんどの場合、パスワードの復号化時のエラーが原因です。

この問題を解決するには、<Jira_home_directory>/log/atlassian-jira.log を開いて、Reading database configuration from に続く行を確認します。

以下のメッセージが表示される場合があります。

[c.a.j.config.database.DatabaseConfigHandler] Trying to get encrypted password from xml and decrypt it
[c.a.d.c.p.ciphers.base64.Base64Cipher] Runtime Exception thrown when decrypting:

この場合、エラーや使用できる可能性がある解決策についての詳細がメッセージに含まれているため、メッセージの内容をご確認ください。エラーが java.lang.IllegalArgumentException の場合、パスワードを再度暗号化する必要があります。

Jira の再起動後に "Jira had problems starting up" メッセージが開く...

この問題を調べるには、<Jira_home_directory>/log/atlassian-Jira.log を開き、Reading database configuration from に続く行を確認します。

以下のメッセージが表示される場合があります。

[c.a.j.config.database.DatabaseConfigHandler] Trying to get encrypted password from xml and decrypt it
[c.a.j.config.database.DatabaseConfigHandler] Database password decryption success!
[c.a.config.bootstrap.DefaultAtlassianBootstrapManager] Could not successfully test your database:

[c.a.jira.health.HealthChecks] JIRA couldn't connect to your database
[c.a.jira.health.HealthChecks] JIRA failed to establish a connection to your database.

これは、Jira がパスワードを正常に復号化したが、パスワード自体が正しくないことを意味します。これは次の手順で確認できます。

  1. dbconfig.xml ファイルを開き、暗号化されたパスワードをコピーします。
  2. パスワードを復号化します
  3. 復号化されたパスワードがバックアップの dbconfig.xml ファイルと同じかどうかを確認します。
最終更新日 2021 年 8 月 26 日

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

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