JIRA を SSL または HTTPS 上で実行する
アトラシアンの製品はSSLに対応しています。しかし、アトラシアンのサポートはその設定に対して支援は行いません。したがって、アトラシアンは、そのためのサポートの提供を保証できません 。
- SSL証明書の変更に際してサポートが必要であれば、証明書の提供元のベンダーに相談してください。
- 設定に関してサポートが必要であれば、Atlassian Answers に質問をあげてください。
このページでは、Apache Tomcat で HTTPS に関する設定を行うことによって JIRA を HHTP (HTTP over SSL) 経由でアクセスできるようにする手順を説明します。この手順は JIRA が通常の方法でインストールされている場合を前提としており、HTTPS 設定の完全なガイドでも包括的なガイドでもなく、またお客様が個別の設定を行っている場合は適用できないことがあります。
Why should you enable HTTPS access to JIRA?
HTTPS is a good way to safeguard your JIRA data and user logins from being intercepted and read by outsiders.
はじめる前に
作業を始める前に、以下の点を確認してください :
- アトラシアンのサポートは、SSL のサポートについては証明書を発行する認証局 (CA) に委ねます。このページにおける SSL 関連の説明は参考情報としてのみ提供されます。
- Windows インストーラーを使用して JIRA をインストールした場合 :
- Windows インストーラー は、Tomcat を実行するために独自の Java Runtime Environment (JRE) Java プラットフォームをインストールします。SSL 証明書をアップデートする場合は、JRE のインストレーション中に行う必要があります。
- In this document, the term
<jira-install-dir>
refers to the JIRA Installation Directory itself.
If hosting JIRA behind a reverse-proxy such as Apache, please follow our Integrating JIRA with Apache using SSL documentation.
Java キーストアの生成
このセクションでは、お客様の SSL 証明書を保存する Java キーストア (JKS) を作成します。SSL 証明書は、JIRA において SSL 通信を行うためには必須のものです。SSL 証明書は一般的に 2 つの種類に区分されます :
証明書 | 説明 | 使用目的 | 手順 |
---|---|---|---|
自己署名証明書 | ウェブサーバー証明書の正当性を確認する方法のひとつである CA によるデジタル署名がない証明書です。自分自身が自己名で署名します。 | テスト用、開発用、その他内部向けサーバーのみです。 | 1 - 13 |
CA 署名証明書 | 認証局 (CA) のデジタル署名によって正当性が確認された証明書です。これにより、ブラウザやクライアントは証明書に信用を置くことが可能になります。 | 本番環境用サーバー | 1 - 21 |
Digital Certificate that are issued by trusted 3rd party CAs (Certification Authority) provide verification that your Website does indeed represent your company, thereby verifying your company's identity. Many CAs simply verify the domain name and issue the certificate, whereas other such as VeriSign verifies the existence of your business, the ownership of your domain name, and your authority to apply for the certificate, providing a higher standard of authentication.
よく知られた認証局の例を次に示します:
当社としては、CA で署名された証明書の利用を推奨いたします。
お客様のサーバーに Portecle をインストールすることができない場合や、コマンドラインの利用をご希望の場合は、このページ下部にある コマンドラインを使用したインストール セクションをご覧ください。
- Download and install the Portecle app onto the server that runs JIRA.
This is a third-party application and is not supported by Atlassian.
Run the App as an Administrator, so it will have the appropriate permissions. Also, ensure the
<JAVA_HOME>
variable is pointing to the same version of Java that JIRA uses. See our Setting JAVA_HOME docs for further information on this.
If running on a Linux/UNIX server, X11 will need to be forwarded when connecting to the server (so you can use the GUI), as below:
ssh -X user@server
- Select the Create a new Keystore option:
- Select the type JKS and OK:
- Select the Generate Key Pair button:
- Select the RSA algorithm and your preferred Key Size - the standard is currently 2048:
- Make sure the Signature Algorithm is
"SHA256withRSA"
and then edit the certificate details, as per the below example and select OK:
The Common Name MUST match the server's URL, otherwise errors will be displayed in the browser.
If you would like to use SHA256withRSA, please use the appropriate Signature Algorithm, and refer to: Security tools report the default SSL Ciphers are too weak
- 証明書のエイリアス名を指定します。ここでは、jira を使用しています。
- キーストアのパスワードを入力します (既定のパスワードは通常
changeit
です)。 - 下の例のように、キーペアの生成が成功した旨のメッセージが表示されます :
パスワードがステップ 11 と同一であることを確認し、キーストアを
<JIRA_HOME>/jira.jks
に保存します。[ファイル] > [キーストアの保存] を選択して保存できます。If using a self-signed certificate certificate, proceed to Configuring your web server using the JIRA configuration tool, otherwise continue on.
- We need to generate a Certificate Signing Request for the CA to sign and confirm the identity of the certificate. To do so, right click on the certificate and choose Generate CSR. Save it in <JIRA_HOME>/jira.csr.
- 証明書要求 (CSR) を認証局に送信して署名を求めます。認証局からは、署名済み証明書 (CA 応答) および CA のルート証明書/中間証明書のセットが返送されます。
- Import the root and/or intermediate CA certificates with Import Trusted Certificate, repeating this step for each certificate.
- Import the signed certificate by right clicking on the
jira
certificate and selecting Import CA Reply:
- CA から提供された証明書 (
jira.crt
) を選択します。これで、CA 応答のインポートが完了しました。 - 結果を、Tools > Keystore Report で確認します。証明書はルート証明書の子ノードに表示されます。
- キーストアを保存し、次のセクションに進みます :
JIRA 設定ツールを利用した web サーバーの設定
In this section, you will finish setting up SSL encryption for JIRA, by configuring your web server using the JIRA configuration tool. For more information on the JIRA configuration tool, see Using the JIRA Configuration Tool.
JIRA 設定ツールを利用してウェブサーバーの設定を行う手順 :
- 次のように JIRA 設定ツールを起動します :
- Windows: Open a command prompt and run
config.bat
in thebin
sub-directory of the JIRA Installation Directory. - Linux/Unix: Open a console and execute
config.sh
in thebin
sub-directory of the JIRA Installation Directory.This may fail with the error as described in our Unable to Start JIRA applications Config Tool due to No X11 DISPLAY variable was set error KB article. Please refer to it for the workaround.
- Windows: Open a command prompt and run
- Click the Web Server tab.
Screenshot: JIRA configuration tool — 'Web Server' tab
各フィールドに次のように入力します :
フィールド 値 ポートの制御 Leave as default. You can change the port number if you wish. See Changing JIRA's TCP Ports . プロフィール Profile とはプリセットされたウェブサーバー動作設定です。次の 4 つの値から選択します : - 無効
- HTTP のみ
- HTTP および HTTPS (HTTP を HTTPS へリダイレクト)
- HTTPS のみ
JIRA を HTTPS 上で実行する場合は、'HTTP & HTTPS' または 'HTTPS' を選択する必要があります。
JIRA を HTTPS 上で実行するが、ユーザーに HTTP 経由でも JIRA にアクセスさせる場合は、'HTTP & HTTPS' を選択する必要があります。'HTTP & HTTPS' を選択すると、HTTP 経由で JIRA にアクセスするユーザーは HTTPS のアドレスにリダイレクトされます。HTTP ポート Leave as default (8080). You can change the port number if you wish. See Changing JIRA's TCP Ports .
This will be disabled if you set the Profile to 'HTTPS only'.HTTPS ポート Leave as default (8443). You can change the port number if you wish. See Changing JIRA's TCP Ports . Keystore パス 証明書のキーストアの場所を指定します。これは手順 13 でキーストアを保存した際に選択され、 <JIRA_HOME>/jira.jks
となります。Keystore パスワード キーストアのパスワードを指定します。自己署名証明書を生成した場合は、このパスワードは手順 13 で証明書を生成したときにキーおよびキーストアに設定したパスワードです。 Keystore エイリアス キーストア内のそれぞれの項目はエイリアスで区別されます。手順 10 で説明したように、証明書について jira
を使用することを推奨します。- 無効
- Check Certificate in Key Store ボタンをクリックして、以下の項目を確認します :
- キーストア内に証明書が存在すること。
- キーストアのパスワードが有効であること。
- キーエイリアスを使用してキーを見つけられること。
- Save ボタンをクリックして設定を保存します。
高度な設定
同一ホストにおける複数のインスタンスの実行
When running more than one instance on the same host, it is important to specify the address attribute in the <JIRA_INSTALLATION>/conf/server.xml
file because by default the connector will listen on all available network interfaces, so specifying the address will prevent conflicts with connectors running on the same default port. See the Tomcat Connector documentation for more about setting the address attribute in The HTTP Connector Apache Tomcat 7 docs.
コマンド ラインを使用したインストール
キーストアを作成します
Java キーストア (JKS) の生成 :
<JAVA_HOME>/keytool -genkeypair -alias jira -keyalg RSA -sigalg SHA256withRSA -keystore <JIRA_HOME>/jira.jks
Instead of first and last name, enter the server URL, excluding "https://" (e.g.: jira.atlassian.com).
- Enter an appropriate password (e.g.:
changeit
). 手順 2 のパスワードを使用して、署名のための CSR を生成します :
<JAVA_HOME>/keytool -certreq -keyalg RSA -alias jira -keystore <JIRA_HOME>/jira.jks -file jira.csr
- Submit the CSR to the CA for signing. They will provide a signed certificate and a root and/or intermediate CA.
If the certificate will not be signed, skip to step 7.
ルート証明書、または中間証明書をインポートします :
<JAVA_HOME>/keytool -import -alias rootCA -keystore <JIRA_HOME>/jira.jks -trustcacerts -file root.crt
(CA から返送された) 署名済み証明書をインポートします :
<JAVA_HOME>/keytool -import -alias jira -keystore <JIRA_HOME>/jira.jks -file jira.crt
Keystore 内に証明書が存在することを検証します。
<JAVA_HOME>/keytool -list -alias jira -keystore <JIRA_HOME>/jira.jks
This must be a
PrivateKeyEntry
, if it is not the certificate setup has not successfully completed. For example:jira, Jan 1, 1970, PrivateKeyEntry, Certificate fingerprint (MD5): 73:68:CF:90:A8:1D:90:5B:CE:2A:2F:29:21:C6:B8:25
Keystore で Tomcat を更新する
Create a backup of
<JIRA_INSTALL>/conf/server.xml
before editing it.HTTPS コネクタを編集し、キーストアを示すパラメーターを含めます。
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol" maxHttpHeaderSize="8192" SSLEnabled="true" maxThreads="150" minSpareThreads="25" enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" useBodyEncodingForURI="true" keyAlias="jira" keystoreFile="<JIRA_HOME>/jira.jks" keystorePass="changeit" keystoreType="JKS"/>
Ensure to put the appropriate path in place of
<JIRA_HOME>
and change the port as needed.HTTP コネクタを編集し、HTTPS コネクタへリダイレクトするようにします。
<Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" port="8080" protocol="HTTP/1.1" redirectPort="<PORT_FROM_STEP_1>" useBodyEncodingForURI="true"/>
Ensure the
<PORT_FROM_STEP_1>
is change to the appropriate value. In this example it would be 8443.Save the changes to
server.xml
.HTTPS へのリダイレクトを使用する場合 (推奨)、
JIRA_INSTALL>/atlassian-jira/WEB-INF/web.xml
ファイルを編集し、ファイルの末尾に次のセクションを追加してから、</web-app>
を閉じます。この例では、添付ファイルを除くすべての URL が HTTP から HTTPS にリダイレクトされます。<security-constraint> <web-resource-collection> <web-resource-name>all-except-attachments</web-resource-name> <url-pattern>*.jsp</url-pattern> <url-pattern>*.jspa</url-pattern> <url-pattern>/browse/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint>
変更を保存したら JIRA を再起動します。
You can also redirect users from HTTP URLs to HTTPS URLs by choosing the 'HTTP & HTTPS' profile in the JIRA configuration tool. However, if you want to only redirect certain pages to HTTPS, you can do this manually. To do this, select the 'HTTPS only' profile in the JIRA configuration tool and save the configuration.
トラブルシューティング
上記にある通り Portecle を用いて生成した自己署名キーを使用する場合の、トラブルシューティングの TIPS をいくつか紹介します。
ブラウザに「https://localhost:<port number>」と入力したときに "Cannot establish a connection to the server at localhost:8443" のようなメッセージが表示される場合は、ログ ファイル logs/catalina.out
でエラー メッセージを探します。ここには発生する可能性があるいくつかのエラーとそれぞれの説明を紹介します。