このトピックと AdminTask オブジェクトの SecureConversation グループのコマンドを使用して、
ご使用のアプリケーションに添付する新規ポリシー・セットとバインディングを作成することにより、
secure conversation client のキャッシュを使用可能にできます。
始める前に
SecureConversation ポリシー・セットが構成で使用可能であることを確認します。
デフォルトでは、SecureConversation ポリシー・セットは使用できません。
importPolicySet コマンドを使用して、SecureConversation ポリシーを構成にインポートします。
次に例を示します。
AdminTask.importPolicySet('-defaultPolicySet SecureConversation')
このトピックのコマンドを使用する前に、ご使用の wsadmin ツールが最新のものであることを確認してください。プロパティー・オブジェクトを attributes または bindingLocation パラメーターの値として受け入れるポリシー・セット管理コマンドは、以前のバージョンの wsadmin ツールではサポートされていません。例えば、
これらのコマンドは、バージョン 6.1.0.x ノードでは実行できません。
このタスクについて
このトピックでは、デフォルトの SecureConversation ポリシー・セットと、
デフォルトの WS-Security および TrustServiceSecurityDefault バインディングを使用して、secure conversation を使用可能にします。
デフォルトの SecureConversation ポリシー・セットには、
対称バインディングを持つアプリケーション・ポリシーと、
非対称バインディングを持つブートストラップ・ポリシーが含まれています。
アプリケーション・ポリシーは、アプリケーション・メッセージをセキュアにします。
ブートストラップ・ポリシーは、RequestSecurityToken (RST) メッセージをセキュアにします。
セキュリティー・コンテキスト・トークン・プロバイダーを発行するトラスト・サービスは、
TrustServiceSecurityDefault システム・ポリシーと TrustServiceSecurityDefault バインディングを使用します。
トラスト・ポリシーは、RequestSecurityTokenResponse (RSTR) メッセージをセキュアにします。
ブートストラップ・ポリシーを変更する場合は、
両方の構成が一致するように、トラスト・ポリシーも変更する必要があります。
トラブルの回避 (Avoid trouble): 以下のステップは、開発およびテスト環境でのみ使用します。
この手順の WS-Security バインディングには、
サンプル鍵ファイルが含まれています。このファイルは、実稼働環境でバインディングを使用する前にカスタマイズする必要があります。実稼働環境向けのカスタム・バインディングを作成します。
gotcha
手順
- Jython スクリプト言語を使用する wsadmin スクリプト・ツールを起動します。 詳しくは、『wsadmin スクリプト・クライアントの開始』を参照してください。
- 既存の SecureConversation ポリシー・セットをコピーします。
次のコマンド例を使用して、
既存の SecureConversation ポリシー・セットをコピーすることにより、
新規ポリシー・セットを作成します。
AdminTask.copyPolicySet('[-sourcePolicySet SecureConversation -newPolicySet CopyOfSCPolicySet]')
- グローバル・セキュリティー・ドメインのバインディングを変更します。プロファイル管理ツールまたは manageprofiles コマンド・ユーティリティーを使用してプロファイルを作成したときに「開発テンプレートを使用するサーバーの作成」オプションを選択している場合は、オプションでこのステップをスキップできます。
- 各 WS-Security ポリシー属性をリストします。
グローバル・セキュリティー・ドメインのバインディングを変更するには、getDefaultBindings コマンドを使用して、プロバイダーまたはクライアントにデフォルトとして設定されたバインディングを判別します。次に例を示します。
AdminTask.getDefaultBinding('-bindingType provider')
- バインディングの属性を表示します。
getBinding コマンドを使用して、バインディングの現行属性を表示します。次に例を示します。
AdminTask.getBinding('-bindingLocation "" -bindingName myBinding')
- 保護トークンのアウトバウンド構成を変更します。
次のコマンドを使用して、保護トークンのアウトバウンド構成を変更します。
cmd1_attributes_value = "[ [application.securityoutboundbindingconfig.tokengenerator_5.callbackhandler
.key.name [CN=Bob,O=IBM, C=US]] [application.securityoutboundbindingconfig.tokengenerator_5.callbackhandler
.keystore.storepass storepass] [application.securityoutboundbindingconfig.tokengenerator_5.callbackhandler
.keystore.type JCEKS] [application.securityoutboundbindingconfig.tokengenerator_5.callbackhandler.key.alias bob]
[application.securityoutboundbindingconfig.tokengenerator_5.callbackhandler.keystore.path ${USER_INSTALL_ROOT}
/etc/ws-security/samples/enc-sender.jceks] ]"
AdminTask.setBinding('[-policyType WSSecurity -bindingLocation "" -attributes cmd1_attributes_value
-attachmentType application]')
cmd2_attributes_value = "[ [application.securityoutboundbindingconfig.tokengenerator_0.callbackhandler.keystore
.path ${USER_INSTALL_ROOT}/etc/ws-security/samples/dsig-sender.ks] [application.securityoutboundbindingconfig
.tokengenerator_0.callbackhandler.keystore.storepass client] [application.securityoutboundbindingconfig
.tokengenerator_0.callbackhandler.key.name [CN=SOAPRequester, OU=TRL, O=IBM, ST=Kanagawa, C=JP]] [application
.securityoutboundbindingconfig.tokengenerator_0.callbackhandler.key.keypass client] [application
.securityoutboundbindingconfig.tokengenerator_0.callbackhandler.key.alias soaprequester]
[application.securityoutboundbindingconfig.tokengenerator_0.callbackhandler.keystore.type JKS] ]"
AdminTask.setBinding('[-policyType WSSecurity -bindingLocation "" -attributes cmd2_attributes_value
-attachmentType application]')
- オプション: TrustDefaultBindings バインディングを変更します。
プロファイル管理ツールまたは manageprofiles コマンド・ユーティリティーを使用してプロファイルを作成したときに「開発テンプレートを使用するサーバーの作成」オプションを選択している場合は、オプションでこのステップをスキップできます。
TrustDefaultBindings をまだカスタマイズしていない場合は、
次のコマンドを使用して TrustDefaultBindings バインディングを変更します。
cmd3_attributes_value = "[ [application.securityoutboundbindingconfig.tokengenerator_1.callbackhandler.keystore
.storepass storepass] [application.securityoutboundbindingconfig.tokengenerator_1.callbackhandler.key.alias bob]
[application.securityoutboundbindingconfig.tokengenerator_1.callbackhandler.keystore.type JCEKS] [application
.securityoutboundbindingconfig.tokengenerator_1.callbackhandler.keystore.path ${USER_INSTALL_ROOT}/etc
/ws-security/samples/enc-sender.jceks] [application.securityoutboundbindingconfig.tokengenerator_1.callbackhandler
.key.name [CN=Bob, O=IBM, C=US]] ]"
AdminTask.setBinding('[-policyType WSSecurity -bindingLocation "[attachmentId 2]"
-attributes cmd3_attributes_value -attachmentType system/trust]')
cmd4_attributes_value = "[ [application.securityoutboundbindingconfig.tokengenerator_0.callbackhandler.keystore.path
${USER_INSTALL_ROOT}/etc/ws-security/samples/dsig-sender.ks] [application.securityoutboundbindingconfig.tokengenerator_0
.callbackhandler.keystore.storepass client] [application.securityoutboundbindingconfig.tokengenerator_0.callbackhandler
.key.name [CN=SOAPRequester, OU=TRL, O=IBM, ST=Kanagawa, C=JP]] [application.securityoutboundbindingconfig.tokengenerator_0
.callbackhandler.key.keypass client] [application.securityoutboundbindingconfig.tokengenerator_0.callbackhandler.key
.alias soaprequester] [application.securityoutboundbindingconfig.tokengenerator_0.callbackhandler.keystore.type JKS] ]"
AdminTask.setBinding('[-policyType WSSecurity -bindingLocation "[attachmentId 2]"
-attributes cmd4_attributes_value-attachmentType system/trust]')
- ポリシー・セットとバインディングをアプリケーションに添付します。
createPolicySetAttachment コマンドの attachmentType パラメーターを使用して、
アプリケーションがサービス・クライアントであるか、サービス・プロバイダーであるかを指定します。
次のコマンドを使用して、
CopyOfSCPolicySet ポリシー・セットを
myTestApp サービス・クライアント・アプリケーションに関連付けます。
AdminTask.createPolicySetAttachment('[-applicationName myTestApp -policySet CopyOfSCPolicySet
-resources WebService:/ -attachmentType client]')
次のコマンドを使用して、
CopyOfSCPolicySet ポリシー・セットを
myTestApp サービス・プロバイダー・アプリケーションに添付します。
AdminTask.createPolicySetAttachment('[-applicationName myTestApp -policySet CopyOfSCPolicySet
-resources WebService:/ -attachmentType application]')
このステップにより、バインディングが自動的に割り当てられます。
タスクの結果
セル・レベル・ディレクトリーにある WSSCCache.xml ファイル内のセキュアな会話の構成が更新されました。
次のタスク
AdminTask オブジェクトの SecureConversation コマンド・グループを使用して、
secure conversation 構成を管理します。