17.2. Password Based Encryption (パスワードベースの暗号化 : PBE) で設定されたアイデンティティ


org.jboss.resource.security.JaasSecurityDomainIdentityLoginModule は JaasSecurityDomain によって暗号化されたパスワードを使用してデータソースを静的に定義するためのログインモジュールです。データソースのパスワードの base64 形式は PBEUtils を使用して生成できます。

手順17.4 PBEUtils を使用したパスワードの暗号化 - Platforms 5.0 および 5.0.1 バージョン

これは JBoss Enterprise Application Platform 5.0 および 5.0.1 バージョンでのパスワードの暗号化手順です。
  • 以下のコマンドを実行します。
    java -cp jboss-as/common/lib/jbosssx.jar org.jboss.security.plugins.PBEUtils \
      salt count domain-password data-source-password
    Copy to Clipboard Toggle word wrap
    結果

    暗号化されたパスワードが表示されます。

手順17.5 PBEUtils を使用したパスワードの暗号化 - Platform 5.1 バージョン

これは JBoss Enterprise Application Platform 5.1 およびそれ以降のバージョンでのパスワードの暗号化手順です。
  • 以下のコマンドを実行します。
    java -cp jboss-as/lib/jbosssx.jar org.jboss.security.plugins.PBEUtils \
     salt count domain-password data-source-password
    Copy to Clipboard Toggle word wrap
    結果

    暗号化されたパスワードが表示されます。

PBEUtils のパラメータは以下のとおりです。
salt
JaasSecurityDomain からの Salt 属性です (8 文字ちょうどでなければなりません)。
count
JaasSecurity ドメインからの IterationCount 属性です。
domain-password
JaasSecurityDomain から KeyStorePass 属性にマップするプレーンテキストのパスワードです。
data-source-password
JaasSecurityDomain パスワードにより暗号化されるべきデータソースのプレーンテキストのパスワードです。
例17.3「PBEUtils コマンドの例」 ではコマンドの例とその出力を示しています。

例17.3 PBEUtils コマンドの例

 java -cp jbosssx.jar org.jboss.security.plugins.PBEUtils abcdefgh 13 master password
 Encoded password: 3zbEkBDfpQAASa3H39pIyP
Copy to Clipboard Toggle word wrap
次のアプリケーションポリシーを $JBOSS_HOME/server/$PROFILE/conf/login-config.xml ファイルに追加します。
<application-policy name="EncryptedHsqlDbRealm">
   <authentication>
      <login-module code= "org.jboss.resource.security.JaasSecurityDomainIdentityLoginModule"
         flag = "required">
         <module-option name="username">sa</module-option>
         <module-option name="password">E5gtGMKcXPP</module-option>
         <module-option name="managedConnectionFactoryName">
            jboss.jca:service=LocalTxCM,name=DefaultDS
         </module-option>
         <module-option name="jaasSecurityDomain">
            jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword
         </module-option>
      </login-module>
   </authentication>
</application-policy>
Copy to Clipboard Toggle word wrap
$JBOSS_HOME/docs/examples/jca/hsqldb-encrypted-ds.xml はキーストアの JaasSecurityDomain 設定と併せてデータソースの設定を図解します。
例17.4「FilePassword コマンドの例」 はコマンドの例とその出力を提供します。

例17.4 FilePassword コマンドの例

次の例は、.../conf/server.password ファイルを参照します。最初に、暗号化の詳細を保存し、マスターパスワードを難読化するため、次のコマンドを実行する必要があります。
java -cp jboss-as/lib/jbosssx.jar org.jboss.security.plugins.FilePassword salt count master_password password_file
          
For example: java -cp jboss-as/lib/jbosssx.jar org.jboss.security.plugins.FilePassword abcdefgh 13 master jboss-as/server/$PROFILE/conf/server.password
Copy to Clipboard Toggle word wrap
<?xml version="1.0" encoding="UTF-8"?>

<!-- The Hypersonic embedded database JCA connection factory config
that illustrates the use of the JaasSecurityDomainIdentityLoginModule
to use encrypted password in the data source configuration. 

$Id: hsqldb-encrypted-ds.xml,v 1.1.2.1 2004/06/04 02:20:52 starksm Exp $ -->


<datasources>
   ...


   <application-policy name="EncryptedHsqlDbRealm">
      <authentication>
         <login-module code="org.jboss.resource.security.JaasSecurityDomainIdentityLoginModule"
            flag = "required">
            <module-option name="username">sa</module-option>
            <module-option name="password">E5gtGMKcXPP</module-option>
            <module-option name="managedConnectionFactoryName">
              jboss.jca:service=LocalTxCM,name=DefaultDS
            </module-option>
            <module-option name="jaasSecurityDomain">
              jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword
            </module-option>
         </login-module>
      </authentication>
   </application-policy>

   <mbean code="org.jboss.security.plugins.JaasSecurityDomain"
      name="jboss.security:service=JaasSecurityDomain, domain=ServerMasterPassword">
      <constructor>
         <arg type="java.lang.String" value="ServerMasterPassword"></arg>
      </constructor>
      <!-- The opaque master password file used to decrypt the encrypted
      database password key -->
      <attribute name="KeyStorePass">{CLASS}org.jboss.security.plugins.FilePassword:${jboss.server.home.dir}/conf/server.password</attribute>
      <attribute name="Salt">abcdefgh</attribute>
      <attribute name="IterationCount">13</attribute>
   </mbean>

   <!-- This mbean can be used when using in process persistent db -->
   <mbean code="org.jboss.jdbc.HypersonicDatabase"
      name="jboss:service=Hypersonic,database=localDB">
      <attribute name="Database">localDB</attribute>
      <attribute name="InProcessMode">true</attribute>
   </mbean>

   ...

</datasources>
Copy to Clipboard Toggle word wrap

警告

パスワード生成ステップで使用された MBean の同じ Salt と IterationCount を使用するようにしてください。

注記

暗号化されたデータソースに依存するサービスを開始するとき、次の MBean がサービスとして開始されていない場合はエラー java.security.InvalidAlgorithmParameterException: Parameters missing が発生します。
(jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword)
Copy to Clipboard Toggle word wrap
以前に示した例の hsqldb-encrypted-ds.xml コードのとおり次の要素を含めることで、データソースの前に MBean が開始します。
<depends>jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword</depends>
Copy to Clipboard Toggle word wrap
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat