MS SQLのデータベース接続暗号化の有効化

SSL ベースの暗号化を適用するように MS SQL データベースを構成します。

始める前に

MS SQL データベースは、接続暗号化が有効になるように構成する必要があります。

このタスクについて

MMC (Microsoft Management Console) を使用して、公開証明書を .CER Base-64 エンコード X.509 形式でエクスポートします。以下の手順を実行します。
  • MS SQL データベースをホストする Windows システムで MMC を実行します。
  • 証明書を右クリックし、「すべてのタスク」> 「エクスポート」の順に移動します。
  • 「次へ」をクリックします。
  • 秘密鍵をエクスポートしないことを選択し、「次へ」をクリックします。
  • 「Base-64 encoded X.509 (.CER)」を選択し、「次へ」をクリックします。
  • ファイル名を入力します。
  • 指定した設定を確認し、「完了」をクリックします。
  • 証明書が、指定された場所にエクスポートされます。

証明書をエクスポートしたら、接続暗号化を有効にします。

手順

  1. MS SQL サーバーの公開証明書をアップロードします。
  2. コマンド行を開き、コマンド cd <BFI_INSTALL_DIR>/wlp/usr/servers/server1/resources/security を使用します。
  3. <keystore_extension> タイプのトラストストアを作成し、コマンド keytool -importcert -file <.cer file> -keystore key_bfi_db.<keystore_extension> -alias "bfi_db_cert" -storetype <type> を使用してトラストストアに証明書をインポートします。トラストストアのパスワードを入力します。証明書を信頼するには、Yes を入力します。
  4. BigFix Inventory サービスを停止します。
  5. 既存の属性を更新し、欠落している属性を server.xml ファイルに 追加します。
    重要: データベースについては、証明書と同じサーバー名を使用します。serverName 属性の値を更新します。
    <dataSource id="DatabaseConnection" jndiName="jdbc/ilmtDatabaseConnection"> <jdbcDriver libraryRef="DatabaseLib"/> 
    <properties.microsoft.sqlserver databaseName="temadb" encrypt="true" lockTimeout="180000" 
    password="<password encrypted in in ‘aes’ encoding>" 
    serverName="<host name - the same that certificate is issued to>" 
    trustServerCertificate="false" trustStore="<BFI_INSTALL_DIR>/wlp/usr/servers/server1/resources/security/key_bfi_db.<keystore_extension>>” 
    trustStorePassword="<password encrypted in in ‘aes’ encoding>" user="sa"/> 
    </dataSource>
    注: パスワードを AES 方式で暗号化しています。詳しくは『データベース・パスワードの更新』を参照してください。BigFix Inventory サーバーのアップグレード中にデータベース接続を暗号化する場合は、データ・ソースでパスワード暗号化属性を定義する必要があります。
  6. 既存の属性を更新し、欠落している属性を database.yml ファイルに 追加します。
    重要: データベースについては、証明書と同じホスト名を使用します。host name 属性の値を更新します。
    host: <host name - the same that certificate is issued to> 
    database: temadb 
    username: sa 
    database_type: mssql 
    windows_authenticated: false 
    encrypted_password: "<password encrypted in in ‘aes’ encoding>" 
    encrypt: true 
    trustServerCertificate: false 
    trustStore: <<BFI_INSTALL_DIR>/wlp/usr/servers/server1/resources/security/key_bfi_db.<keystore_extension>> 
    trustStorePassword: "<password encrypted in in ‘aes’ encoding>"
  7. BigFix Inventory サービスを開始します。
  8. tema.log をモニターし、接続が確立されていることを確認します。
    アプリケーションが起動しない場合は、上部から tema.log を確認してください。構成に問題がある場合、WebSphere は FFDC ログを作成します。
    [3/10/21 11:28:03:118 UTC] 00000026 com.ibm.ws.recoverylog.spi.RecoveryDirectorImpl I CWRLS0010I: Performing recovery processing for local WebSphere server (server1). 
    [3/10/21 11:28:03:180 UTC] 00000026 com.ibm.ws.recoverylog.spi.RecoveryDirectorImpl I CWRLS0012I: All persistent services have been directed to perform recovery processing for this WebSphere server (server1). 
    [3/10/21 11:28:03:180 UTC] 00000041 com.ibm.tx.jta.impl.RecoveryManager I WTRN0135I: Transaction service recovering no transactions. 
    [3/10/21 11:28:03:352 UTC] 00000026 com.ibm.ws.logging.internal.impl.IncidentImpl I FFDC1015I: An FFDC Incident has been created: "com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: "PKIX path validation failed: java.security.cert.CertPathValidatorException: signature check failed". ClientConnectionId:a89039f3-b6ce-4de6-8d10-8c205c44243e com.ibm.ws.rsadapter.impl.MicrosoftSQLServerHelper 1298" at ffdc_21.03.10_11.28.03.0.log 
    [3/10/21 11:28:03:477 UTC] 00000026 com.ibm.ws.logging.internal.impl.IncidentImpl I FFDC1015I: An FFDC Incident has been created: "com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException: DSRA8100E: Unable to get a PooledConnection from the DataSource. with SQL State : 08S01 SQL Code : 0 com.ibm.ejs.j2c.poolmanager.FreePool.createManagedConnectionWithMCWrapper 199" at ffdc_21.03.10_11.28.03.1.log 
    [3/10/21 11:28:03:524 UTC] 00000026 com.ibm.ws.logging.internal.impl.IncidentImpl I FFDC1015I: An FFDC Incident has been created: "javax.resource.spi.ResourceAllocationException: DSRA8100E: Unable to get a PooledConnection from the DataSource. with SQL State : 08S01 SQL Code : 0 com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection 299" at ffdc_21.03.10_11.28.03.2.log 
    [3/10/21 11:28:03:524 UTC] 00000026 SystemOut O [JAVA] [ERROR] [ILMTCore] (Default Executor-thread-3) com.ibm.ilmt.common.dao.util.DBDefaultPoolerManager::init:Unable to initialize datasource jdbc/ilmtDatabaseConnection 
    注: 上記のコマンドに適用される <type> および <keystore_extension> パラメーターは、以下を指定します。
    <type>
    バージョン 10.0.8.0 以降では、証明書のタイプは PKCS12 です。上記より前のバージョンでは、JCEKS です。
    <keystore_extension>
    バージョン 10.0.8.0 以降では、鍵ストア・ファイルの名前は .p12 です。上記より前のバージョンでは、.jceks です。