ADC

NSPEPI ツールを使用したポリシー式の変換

注:

NSPEPI と事前設定チェックツールは、公開 GitHub からダウンロードできます。ツールのダウンロード、インストール、使用の詳細な手順については、GitHub NEPEPIページとREADMEページを参照してください。お客様には、GitHub で利用可能なツールを使用して、最も完全で最新のバージョンを使用することをお勧めします。

従来のポリシーベースの機能は、NetScaler 12.0ビルド56.20以降では廃止されました。別の方法として、高度なポリシーインフラストラクチャを使用することをお勧めします。この取り組みの一環として、NetScaler 12.1ビルド56.20以降にアップグレードする場合、クラシックポリシーベースの機能を、対応する非推奨の機能に置き換える必要があります。また、クラシックポリシーと式を高度なポリシーと式に変換する必要があります。また、すべての新しいNetScaler機能は、高度なポリシーインフラストラクチャのみをサポートします。

このnspepiツールは、次のことを実行できます。

  1. クラシックポリシー式を高度なポリシー式に変換します。
  2. 特定のクラシックポリシーとそのエンティティバインディングを高度なポリシーおよびバインディングに変換します。
  3. いくつかの非推奨の機能を、対応する非推奨の機能に変換します。
  4. 従来のフィルタコマンドを高度なフィルタコマンドに変換します。

注:

nspepiツールが ns.conf 構成ファイルを正常に変換すると、変換されたファイルは、接頭辞「new_」が付いた新しいファイルとして表示されます。変換された設定ファイルにエラーまたは警告がある場合は、変換プロセスの一環として手動で修正する必要があります。変換したら、テスト環境でファイルをテストし、それを使用して実際の ns.conf 構成ファイルを置き換える必要があります。テスト後、新しく変換または修正された ns.conf 構成ファイル用にアプライアンスを再起動する必要があります。

クラシックポリシーまたは式のみをサポートする機能は廃止され、対応する非推奨の機能に置き換えることができます。

注:

旧バージョンのnspepiツールに関する情報は PDF 形式で入手できます。詳細については、「PDF12.1-51.16 より前の nspepi ツールを使用した従来のポリシー変換」を参照してください。

変換の警告とエラーファイル

変換にツールを使用する前に、注意すべき警告はほとんどありません。

  1. すべての警告とエラーがコンソールに出力されます。設定ファイルが保存されている場所に警告ファイルが作成されます。
  2. 警告およびエラーファイルの名前は、入力ファイルと同じですが、ファイル名に接頭辞「warn_」が追加されています。式の変換中 (-e を使用する場合)、警告はカレントディレクトリに「warn_expr」という名前で表示されます。

注:

このファイルは、日付/時刻スタンプとログレベルを含む標準のログファイル形式です。ツールが複数回実行されるので、ファイルの以前のインスタンスは「.1」、「.2」などの接尾辞で保持されます。最大で 10 個のインスタンスが保持されます。

変換されたファイル形式

設定ファイル (「-f」を使用) を変換する場合、変換されたファイルは、同じ名前でプレフィックス「new_」の入力設定ファイルが存在するディレクトリと同じディレクトリに置かれます。

nspepi 変換ツールによって処理されるコマンドまたは機能

自動変換処理中に処理されるコマンドは次のとおりです。

  • 次のクラシックポリシーとその式は、高度なポリシーと式に変換されます。変換には、エンティティバインディングとグローバルバインディングが含まれます。
  1. add appfw policy
  2. add cmp policy
  3. add cr policy
  4. add cs policy
  5. add tm sessionPolicy
  6. add filter action
  7. add filter policy
  8. 負荷分散、コンテンツスイッチング、キャッシュリダイレクト、およびグローバルへのポリシーバインディングをフィルタします。

注:

ただし、「add tm SessionPolicy」の場合、詳細ポリシーでグローバルオーバーライドにバインドすることはできません。

  • 「Add lb 仮想サーバー」で設定されたルールパラメーターは、クラシック式から高度な式に変換されます。
  • 「追加 ns HttpProfile」または「ns httpProfile を設定」コマンドで設定された SPDY パラメータが「-http2 ENABLED」に変更されます。
  • 名前付き式 (「ポリシー式の追加」コマンド)。各クラシック名前付きポリシー式は、接頭辞として「nspepi_adv_」が設定された、対応する Advanced 名前付き式に変換されます。さらに、変換されたクラシック式での名前付き式の使用は、対応する Advanced 名前付き式に変更されます。さらに、すべての名前付き式には 2 つの名前付き式があります。1 つは Classic で、もう 1 つは Advanced です (以下を参照)。
  • トンネルトラフィックポリシー変換がサポートされています。
  • CMP、CR、およびトンネルでの組み込みのクラシックポリシーバインディングの処理。
  • Patclass フィーチャは Pat セットフィーチャに変換されます。
  • 「書き換えアクションを追加」コマンドの「-pattern」パラメータは、「-search」パラメータを使用するように変換されます。
  • 高度な定義式の Q および S プレフィックスは、非推奨の同等の高度な式に変換されます。これらの式は、高度な定義式を使用できるすべてのコマンドで見ることができます。

例:

add policy expression classic_expr ns_true Converts to: add policy expression classic_expr ns_true add policy expression nspepi_adv_classic_expr TRUE 
  • 「set cmp パラメータ」コマンドで設定された policyType パラメータが削除されます。デフォルトでは、ポリシータイプは「Advanced」です。

従来のフィルタコマンドを高度なフィルタコマンドに変換する

このnspepiツールは、追加、バインドなどの従来のフィルタ操作に基づくコマンドを高度なフィルタコマンドに変換できます。

ただし、nepepi ツールは次のフィルタコマンドをサポートしていません。

  1. add filter actionFORWARD
  2. add filter actionADD prebody
  3. add filter actionADD postbody

注:

  1. ns。conf に既存の書き換え機能またはレスポンダ機能があり、それらのポリシーがGOTOENDまたはUSER_INVOCATION_RESULTとしてグローバルにバインドされ、 バインドタイプがREQ_XまたはRES_Xである場合、バインドフィルタコマンドは部分的に変換され、コメントアウトされます。手動変換ではエラーが表示されます。
  2. 既存の書き換え機能またはレスポンダー機能があり、そのポリシーがGOTO - ENDまたはUSER_INVOCATION_RESULTを使用して HTTPS タイプの仮想サーバー (負荷分散、コンテンツスイッチング、キャッシュリダイレクトなど) にバインドされている場合、ツールはバインドフィルターコマンドを部分的に変換してからコメントアウトします。手動変換には警告が表示されます。

以下は入力例です。

add lb vserver v1 http 1.1.1.1 80 -persistenceType NONE -cltTimeout 9000 add cs vserver csv1 HTTP 1.1.1.2 80 -cltTimeout 180 -persistenceType NONE add cr vserver crv1 HTTP 1.1.1.3 80 -cacheType FORWARD add service svc1 1.1.1.4 http 80 add filter action fact_add add 'header:value' add filter action fact_variable add 'H1:%%HTTP.TRANSID%%' add filter action fact_prebody add prebody add filter action fact_error_act1 ERRORCODE 200 "Good URL" add filter action fact_forward_act1 FORWARD svc1 add filter policy fpol_add_res -rule ns_true -resAction fact_add add filter policy fpol_error_res -rule ns_true -resAction fact_error_act1 add filter policy fpol_error_req -rule ns_true -reqAction fact_error_act1 add filter policy fpol_add_req -rule ns_true -reqAction fact_add add filter policy fpol_variable_req -rule ns_true -reqAction fact_variable add filter policy fpol_variable_res -rule ns_true -resAction fact_variable add filter policy fpol_prebody_req -rule ns_true -reqAction fact_prebody add filter policy fpol_prebody_res -rule ns_true -resAction fact_prebody add filter policy fpol_forward_req -rule ns_true -reqAction fact_forward_act1 bind lb vserver v1 -policyName fpol_add_res bind lb vserver v1 -policyName fpol_add_req bind lb vserver v1 -policyName fpol_error_res bind lb vserver v1 -policyName fpol_error_req bind lb vserver v1 -policyName fpol_variable_res bind lb vserver v1 -policyName fpol_variable_req bind lb vserver v1 -policyName fpol_forward_req bind cs vserver csv1 -policyName fpol_add_req bind cs vserver csv1 -policyName fpol_add_res bind cs vserver csv1 -policyName fpol_error_res bind cs vserver csv1 -policyName fpol_error_req bind cr vserver crv1 -policyName fpol_add_req bind cr vserver crv1 -policyName fpol_add_res bind cr vserver crv1 -policyName fpol_error_res bind cr vserver crv1 -policyName fpol_error_req bind cr vserver crv1 -policyName fpol_forward_req bind filter global fpol_add_req bind filter global fpol_add_res bind filter global fpol_error_req bind filter global fpol_error_res bind filter global fpol_variable_req bind filter global fpol_variable_res bind filter global fpol_variable_res -state DISABLED bind filter global fpol_prebody_req bind filter global fpol_forward_req After conversion, warning/error messages will be displayed for manual effort. Warning files: cat warn_: 2019-11-07 17:13:34,724: ERROR - Conversion of [add filter action fact_prebody add prebody] not supported in this tool. 2019-11-07 17:13:34,739: ERROR - Conversion of [add filter action fact_forward_act1 FORWARD svc1] not supported in this tool. 2019-11-07 17:13:38,042: ERROR - Conversion of [add filter policy fpol_prebody_req -rule ns_true -reqAction fact_prebody] not supported in this tool. 2019-11-07 17:13:38,497: ERROR - Conversion of [add filter policy fpol_prebody_res -rule ns_true -resAction fact_prebody] not supported in this tool. 2019-11-07 17:13:39,035: ERROR - Conversion of [add filter policy fpol_forward_req -rule ns_true -reqAction fact_forward_act1] not supported in this tool. 2019-11-07 17:13:39,060: WARNING - Following bind command is commented out because state is disabled. Advanced expressions only have a fixed ordering of the types of bindings without interleaving, except that global bindings are allowed before all other bindings and after all bindings. If you have global bindings in the middle of non-global bindings or any other interleaving then you will need to reorder all your bindings for that feature and direction. Refer to nspepi documentation. If command is required please take a backup because comments will not be saved in ns.conf after triggering 'save ns config': bind filter global fpol_variable_res -state DISABLED 

次に、出力例を示します。変換されたすべてのコマンドにはコメントが付きます。

猫new_ <输入文件名称>添加fact_重写操作add insert_http_header header ""value"" add filter action fact_prebody add prebody add filter action fact_forward_act1 FORWARD svc1 add filter policy fpol_prebody_req -rule ns_true -reqAction fact_prebody add filter policy fpol_prebody_res -rule ns_true -resAction fact_prebody add filter policy fpol_forward_req -rule ns_true -reqAction fact_forward_act1 bind lb vserver v1 -policyName fpol_forward_req bind cr vserver crv1 -policyName fpol_forward_req #bind filter global fpol_variable_res -state DISABLED bind filter global fpol_prebody_req bind filter global fpol_forward_req add rewrite action nspepi_adv_fact_variable insert_http_header H1 HTTP.RES.TXID add rewrite action fact_variable insert_http_header H1 HTTP.REQ.TXID add responder action fact_error_act1 respondwith "HTTP.REQ.VERSION.APPEND(" 200 OK\r nConnection: close\r nContent-Length: 21\r\n\r nGood URL")" add rewrite action nspepi_adv_fact_error_act1 replace_http_res "HTTP.REQ.VERSION.APPEND(" 200 OK\r nConnection: close\r nContent-Length: 21\r\n\r nGood URL")" add rewrite policy fpol_add_res TRUE fact_add add rewrite policy fpol_error_res TRUE nspepi_adv_fact_error_act1 add responder policy fpol_error_req TRUE fact_error_act1 add rewrite policy fpol_add_req TRUE fact_add add rewrite policy fpol_variable_req TRUE fact_variable add rewrite policy fpol_variable_res TRUE nspepi_adv_fact_variable set cmp parameter -policyType ADVANCED bind rewrite global fpol_add_req 100 NEXT -type REQ_DEFAULT bind rewrite global fpol_variable_req 200 NEXT -type REQ_DEFAULT bind rewrite global fpol_add_res 100 NEXT -type RES_DEFAULT bind rewrite global fpol_error_res 200 NEXT -type RES_DEFAULT bind rewrite global fpol_variable_res 300 NEXT -type RES_DEFAULT bind responder global fpol_error_req 100 END -type REQ_DEFAULT bind lb vserver v1 -policyName fpol_add_res -type RESPONSE -priority 100 -gotoPriorityExpression NEXT bind lb vserver v1 -policyName fpol_error_res -type RESPONSE -priority 200 -gotoPriorityExpression NEXT bind lb vserver v1 -policyName fpol_variable_res -type RESPONSE -priority 300 -gotoPriorityExpression NEXT bind lb vserver v1 -policyName fpol_add_req -type REQUEST -priority 100 -gotoPriorityExpression NEXT bind lb vserver v1 -policyName fpol_variable_req -type REQUEST -priority 200 -gotoPriorityExpression NEXT bind lb vserver v1 -policyName fpol_error_req -type REQUEST -priority 100 -gotoPriorityExpression END bind cs vserver csv1 -policyName fpol_add_req -type REQUEST -priority 100 -gotoPriorityExpression NEXT bind cs vserver csv1 -policyName fpol_add_res -type RESPONSE -priority 100 -gotoPriorityExpression NEXT bind cs vserver csv1 -policyName fpol_error_res -type RESPONSE -priority 200 -gotoPriorityExpression NEXT bind cs vserver csv1 -policyName fpol_error_req -type REQUEST -priority 100 -gotoPriorityExpression END bind cr vserver crv1 -policyName fpol_add_req -type REQUEST -priority 100 -gotoPriorityExpression NEXT bind cr vserver crv1 -policyName fpol_add_res -type RESPONSE -priority 100 -gotoPriorityExpression NEXT bind cr vserver crv1 -policyName fpol_error_res -type RESPONSE -priority 200 -gotoPriorityExpression NEXT bind cr vserver crv1 -policyName fpol_error_req -type REQUEST -priority 100 -gotoPriorityExpression END 

既存の書き換えまたはレスポンダーポリシーバインディングに goto 式 END または USE_INNVOCATION がある場合、従来のフィルタコマンドを高度な機能コマンドに変換します

この変換では、書き換えポリシーが 1 つ以上の仮想サーバーにバインドされ、サーバーに END または USE_INVOCATION_RESULT がある場合、ツールはコマンドをコメントアウトします。

次に、入力コマンドの例を示します。

COPY add filter policy fpol1 -rule ns_true -resAction reset add filter policy fpol2 -rule ns_true -reqAction reset add rewrite policy pol1 true NOREWRITE add rewrite policylabel pl http_res bind rewrite policylabel pl pol1 1 bind rewrite global NOPOLICY 1 USE_INVOCATION_RESULT -type RES_DEFAULT -invoke policylabel pl add responder policy pol2 true NOOP add responder policylabel pl -policylabeltype HTTP bind responder policylabel pl pol2 1 bind responder global NOPOLICY 1 USE_INVOCATION_RESULT -type REQ_DEFAULT -invoke policylabel pl bind lb vserver v1_tcp -policyName pol1 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type RESPONSE bind cs vserver csv1_tcp -policyName pol1 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type RESPONSE bind lb vserver v1_tcp -policyName pol2 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type REQUEST bind cs vserver csv1_tcp -policyName pol2 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type REQUEST bind cr vserver crv1_tcp -policyName pol2 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type REQUEST bind lb vserver v1_http -policyName fpol1 bind cs vserver csv1_http -policyName fpol1 bind lb vserver v2_http -policyName fpol2 bind cs vserver csv2_http -policyName fpol2 bind cr vserver crv2_http -policyName fpol2 bind filter global fpol1 -priority 100 bind filter global fpol2 -priority 100 

次に、出力コマンドの例を示します。

COPY add rewrite policy pol1 true NOREWRITE add rewrite policylabel pl http_res bind rewrite policylabel pl pol1 1 add responder policy pol2 true NOOP add responder policylabel pl -policylabeltype HTTP bind responder policylabel pl pol2 1 add rewrite policy fpol1 TRUE RESET add responder policy fpol2 TRUE RESET #bind lb vserver v1_http -policyName fpol1 -type RESPONSE #bind cs vserver csv1_http -policyName fpol1 -type RESPONSE #bind rewrite global fpol1 100 -type RES_DEFAULT #bind lb vserver v2_http -policyName fpol2 -type REQUEST #bind cs vserver csv2_http -policyName fpol2 -type REQUEST #bind cr vserver crv2_http -policyName fpol2 -type REQUEST #bind responder global fpol2 100 -type REQ_DEFAULT bind rewrite global NOPOLICY 1 USE_INVOCATION_RESULT -type RES_DEFAULT -invoke policylabel pl bind responder global NOPOLICY 1 USE_INVOCATION_RESULT -type REQ_DEFAULT -invoke policylabel pl bind lb vserver v1_tcp -policyName pol1 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type RESPONSE bind lb vserver v1_tcp -policyName pol2 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type REQUEST bind cs vserver csv1_tcp -policyName pol1 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type RESPONSE bind cs vserver csv1_tcp -policyName pol2 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type REQUEST bind cr vserver crv1_tcp -policyName pol2 -priority 100 -gotoPriorityExpression USE_INVOCATION_RESULT -type REQUEST- 

nspepi 変換ツールで処理されないコマンドまたは機能

次に、自動変換処理の一部として処理されないコマンドをいくつか示します。

  • 一部のバインディングは、グローバルバインドポイントと非グローバルバインドポイント間、ユーザーとグループ間、および異なるエンティティへのバインディング間で優先度のインターリーブがあると、変換できません。これらは、影響を受ける設定がコメントアウトされ、エラーが生成されます。このような構成は、手動で変換する必要があります。
  • クラシックポリシーとアドバンスドポリシーの両方を cmp global にバインドできます。クラシックポリシーを高度なポリシーに変換すると、機能が変更されるケースは多くあります。いくつかのポリシーをコメントアウトすることで解決できるコマンドを変換しました。それでも、変換できないコマンドがいくつかあります。このような場合、エラーが発生し、変換は手動で行う必要があります。
  • Classic 組み込みの名前付き式のすべての用途が、同等の高度な名前付き式に変換されるわけではありません。
  • クライアントセキュリティ式は処理されません。
  • SureConnect (SC)
  • プライオリティキューイング(PQ)
  • HTTP サービス拒否 (HDOS)
  • HTMLインジェクション
  • 認証
  • 承認
  • VPN
  • Syslog
  • Nslog
  • ファイルベースの Classic 式は処理されません。

注:

patClass/Filter のようないくつかの機能では、コマンドの構文が変更されます。cmd ポリシーがある場合は、お客様の要件に応じて cmd ポリシーを変更する必要があります。

既知の問題

次のシナリオでは、nspepiツールでエラーが発生します。

  • 式を変換するときに問題がある場合
  • 指定されたポリシー式で-ClientSecurityMessage パラメータが使用されている場合、このパラメータは拡張ポリシー式ではサポートされていないためです。
  • 負荷分散仮想サーバルール式が複雑な式で、コンテンツベースの式が複数ある場合。
  • CMP フィーチャ変換のエラー
    • 従来のポリシーと高度なポリシーの両方がグローバルにバインドされている場合。
    • クラシックポリシーがバインドされていて、cmp パラメータが拡張されている場合。
    • 高度なポリシーがバインドされていて、cmpパラメータがクラシックの場合。
    • クラシックポリシーが仮想サーバーにバインドされ、詳細ポリシーがグローバルサーバーにバインドされている場合。
    • 拡張ポリシーが仮想サーバーにバインドされ、クラシックポリシーがグローバルサーバーにバインドされている場合。
    • クラシックポリシーが仮想サーバーにバインドされ、クラシックポリシーとアドバンストポリシーの両方がグローバルサーバーにバインドされている場合。
    • 拡張ポリシーが仮想サーバーにバインドされ、クラシックポリシーと拡張ポリシーの両方がグローバルサーバーにバインドされている場合。
  • 従来の名前付きエクスプレッションの名前がコールアウトエンティティ名と同じ場合
  • クラシックエクスプレッション名がアドバンスエクスプレッションに対して無効な場合
  • 変換された式の長さが 1499 文字を超える場合
  • クラシックエクスプレッションにクライアントセキュリティエクスプレッションまたはファイルベースのエクスプレッションがある場合

警告

次のシナリオは、nspepiツールの警告を示しています。

  • 負荷分散仮想サーバーのルール式がブール式の場合、同等の高度な式は文字列形式のブール値になります。その結果、ルールをpersistenceTypeまたはlbMethodに使用すると機能が変わります 。機能の変更を避けるため、コマンドはkeywords ruleおよびpersistenceTypeを削除して変更します。
  • バインディングコマンドの state フィールドが DISABLED の場合。状態が無効の場合、コマンドは使用されていません。state パラメーターは詳細設定ではサポートされていません。そのため、この構成を変換すると、機能が変わります。コマンドが必要な場合は、save ns configをトリガー後にns。confにコメントが保存されないため、バックアップを取ってください 。

CMP フィーチャー変換の警告:

  • グローバル cmp パラメータポリシータイプが CLASSIC に設定されていて、詳細ポリシーがグローバルにバインドされている場合。変換しないと、グローバルポリシータイプがクラシックに設定されているため、制限付き詳細ポリシーは評価されません。変換後、ポリシータイプは ADVANCED に変換されます。そのため、既存のグローバルアドバンストバインディングをコメントアウトしないと、これらのバインディングが評価され、機能が変更される可能性があります。
  • グローバル cmp パラメータポリシータイプが ADVANCED に設定されていて、クラシックポリシーがグローバルにバインドされている場合。変換しないと、グローバルポリシータイプが ADVANCED であるため、これらのグローバルクラシックバインディングは評価されません。そのため、機能を維持するために、変換された設定をコメントアウトします。コメントアウトしないと、変換された高度なポリシーが評価され、機能が変更される可能性があります。

注:

-state オプションを無効にした従来のポリシーバインディングはすべてコメントアウトされます。-state オプションは、高度なポリシーバインディングでは使用できません。

nspepi ツールを実行する

以下は、nspepiツールを実行するためのコマンドライン例です。このツールは、シェルのコマンドラインから実行されます(そのためには、NetScaler「CLI」に「シェル」コマンドを入力する必要があります)。変換を実行するには、「-f」または」-e」のいずれかを指定する必要があります。「-d」の使用は、Citrix 担当者がサポート目的で分析することを意図しています。

usage: nspepi [-h] (-e  | -f )[-d] [-v] [-V Convert classic policy expressions to advanced policy expressions and deprecated commands to non-deprecated commands. optional arguments: -h, --help show this help message and exit -e , --expression  convert classic policy expression to advanced policy expression (maximum length of 8191 allowed) -f , --infile  convert netscaler config file -d, --debug log debug output -v, --verbose show verbose output -V, --version show program's version number and exit 

使用例:

  1. nspepi -e "req.tcp.destport == 80"
  2. nspepi -f /var/nsconfig/ns.conf

次に、CLIを使用したnspepiツールの実行例をいくつか示します。

—e パラメータの出力例:

root@ns# nspepi -e "req.http.header foo == "bar"" "HTTP.REQ.HEADER("foo").EQ("bar")" 

-f パラメータの出力例:

root@ns# cat sample.conf add cr vserver cr_vs HTTP -cacheType TRANSPARENT -cltTimeout 180 -originUSIP OFF add cr policy cr_pol1 -rule ns_true bind cr vserver cr_vs -policyName cr_pol1 

-f パラメータを指定して nspepi を実行中:

nspepi -f sample.conf 

変換されたコンフィグは新しいファイルnew_sample.confで使用できます。warn_sample.confファイルをチェックして、生成された可能性のある警告またはエラーがないか確認します。

-f パラメータと-v パラメータの出力例

nspepi -f sample.conf -v INFO - add cr vserver cr_vs HTTP -cacheType TRANSPARENT -cltTimeout 180 -originUSIP OFF INFO - add cr policy cr_pol1 -rule TRUE -action ORIGIN INFO - bind cr vserver cr_vs -policyName cr_pol1 -priority 100 -gotoPriorityExpression END -type REQUEST 

変換されたコンフィグは新しいファイルnew_sample.confで使用できます。warn_sample.confファイルをチェックして、生成された可能性のある警告またはエラーがないか確認します。

変換された設定ファイル:

root@ns# cat new_sample.conf add cr vserver cr_vs HTTP -cacheType TRANSPARENT -cltTimeout 180 -originUSIP OFF add cr policy cr_pol1 -rule TRUE -action ORIGIN set cmp parameter -policyType ADVANCED bind cr vserver cr_vs -policyName cr_pol1 -priority 100 -gotoPriorityExpression END -type REQUEST 

エラーや警告のない設定例の出力例:

nspepi -f sample_2.conf 

変換されたコンフィグは新しいファイルnew_sample_2.confで使用できます。warn_sample_2.confファイルをチェックして、生成された可能性のある警告またはエラーがないか確認します。

警告付きの設定例の出力例:

root@ns #猫sample_2.conf添加政策前pression security_expr "req.tcp.destport == 80" -clientSecurityMessage "Not allowed" set cmp parameter -policyType CLASSIC add cmp policy cmp_pol1 -rule ns_true -resAction COMPRESS add cmp policy cmp_pol2 -rule ns_true -resAction COMPRESS add cmp policy cmp_pol3 -rule TRUE -resAction COMPRESS bind cmp global cmp_pol1 bind cmp global cmp_pol2 -state DISABLED bind cmp global cmp_pol3 -priority 1 -gotoPriorityExpression END -type RES_DEFAULT bind lb vserver lb_vs -policyName cmp_pol2 root@ns# 

-f パラメータを指定した nspepi の実行例:

root@ns# nspepi -f sample_2.conf ERROR - Error in converting expression security_expr : conversion of clientSecurityMessage based expression is not supported. WARNING - Following bind command is commented out because state is disabled. Advanced expressions only have a fixed ordering of the types of bindings without interleaving, except that global bindings are allowed before all other bindings and after all bindings. If you have global bindings in the middle of non-global bindings or any other interleaving then you will need to reorder all your bindings for that feature and direction. Refer to nspepi documentation. If command is required please take a backup because comments will not be saved in ns.conf after triggering 'save ns config': bind cmp global cmp_pol2 -state DISABLED Warning - Bindings of advanced CMP policies to cmp global are commented out, because initial global cmp parameter is classic but advanced policies are bound. Now global cmp parameter policy type is set to advanced. If commands are required please take a backup because comments will not be saved in ns.conf after triggering 'save ns config'. Advanced expressions only have a fixed ordering of the types of bindings without interleaving, except that global bindings are allowed before all other bindings and after all bindings. If you have global bindings in the middle of non-global bindings or any other interleaving then you will need to reorder all your bindings for that feature and direction. Refer to nspepi documentation. root@ns# 

変換されたファイル:

root@ns #猫new_sample_2.conf expressi添加策略on security_expr "req.tcp.destport == 80" -clientSecurityMessage "Not allowed" set cmp parameter -policyType ADVANCED add cmp policy cmp_pol1 -rule TRUE -resAction COMPRESS add cmp policy cmp_pol2 -rule TRUE -resAction COMPRESS add cmp policy cmp_pol3 -rule TRUE -resAction COMPRESS #bind cmp global cmp_pol2 -state DISABLED #bind cmp global cmp_pol3 -priority 1 -gotoPriorityExpression END -type RES_DEFAULT bind cmp global cmp_pol1 -priority 100 -gotoPriorityExpression END -type RES_DEFAULT bind lb vserver lb_vs -policyName cmp_pol2 -priority 100 -gotoPriorityExpression END -type RESPONSE root@ns# 

警告ファイル:

root@ns# cat warn_sample_2.conf 2019-02-28 06:20:10,590: ERROR - Error in converting expression security_expr : conversion of clientSecurityMessage based expression is not supported. 2019-02-28 06:20:12,187: WARNING - Following bind command is commented out because state is disabled. Advanced expressions only have a fixed ordering of the types of bindings without interleaving, except that global bindings are allowed before all other bindings and after all bindings. If you have global bindings in the middle of non-global bindings or any other interleaving then you will need to reorder all your bindings for that feature and direction. Refer to nspepi documentation. If command is required please take a backup because comments will not be saved in ns.conf after triggering 'save ns config': bind cmp global cmp_pol2 -state DISABLED 2019-02-28 06:20:12,191: WARNING - Bindings of advanced CMP policies to cmp global are commented out, because initial global cmp parameter is classic but advanced policies are bound. Now global cmp parameter policy type is set to advanced. If commands are required please take a backup because comments will not be saved in ns.conf after triggering 'save ns config'. Advanced expressions only have a fixed ordering of the types of bindings without interleaving, except that global bindings are allowed before all other bindings and after all bindings. If you have global bindings in the middle of non-global bindings or any other interleaving then you will need to reorder all your bindings for that feature and direction. Refer to nspepi documentation. root@ns# 

バインディングの優先順位

高度なポリシーでは、グローバルと非グローバルの間、および異なるバインディングタイプ間の優先度による任意のインターリーブは許可されません。このようなクラシックポリシーの優先順位のインターリーブに依存する場合は、高度なポリシールールに準拠し、希望する動作になるように優先順位を調整する必要があります。 詳細ポリシーの優先順位は、バインドポイントに対してローカルです。バインドポイントは、プロトコル、機能、方向、およびエンティティの一意の組み合わせです(エンティティは、特定の仮想サーバ、ユーザ、グループ、サービス、およびグローバルオーバーライドまたはグローバルデフォルトのいずれかです)。ポリシーの優先順位は、バインドポイント全体では従いません。

特定のプロトコル、機能、方向性について、詳細ポリシーを評価する順序は次のとおりです。

  • グローバルオーバーライド。
  • (現在の) 認証、承認、および監査ユーザー。
  • 認証、認可、および監査グループ(ユーザーがメンバーである)の重み順です。複数のグループの重みが同じ場合、順序は定義されません。
  • 要求を受信したか、コンテンツスイッチングが選択された LB 仮想サーバー。
  • コンテンツスイッチング仮想サーバー、要求を受信したキャッシュリダイレクト仮想サーバー。
  • 負荷分散によって選択されたサービス。
  • グローバルデフォルト。

認可ポリシーの評価では、次の順序になります。

  • システムのオーバーライド。
  • 要求を受信した仮想サーバー、または CS が選択された負荷分散仮想サーバー。
  • 要求を受信したコンテンツスイッチング仮想サーバー。
  • システムデフォルト。

各バインドポイント内では、ポリシーは、番号の小さいものから高い番号の優先順位で評価されます。ポリシーは、使用されているプロトコルとメッセージの受信元の方向についてのみ評価されます。

手動での優先順位の再設定が必要な従来のポリシーバインディング

ここでは、ニーズを満たすために手動で優先順位を再設定する必要があるクラシックポリシーバインディングのタイプをいくつか示します。これらはすべて、特定のフィーチャと方向に対するものです。

  • 上記のエンティティタイプリストの方向とは逆のプライオリティ番号が増加するクラシックプライオリティ。たとえば、負荷分散仮想サーバーバインディングよりも低いコンテンツスイッチング仮想サーバーバインディングです。
  • 認証,承認,および監査グループをインターリーブする従来の優先順位。あるグループの一部が他のグループの前にあり、さらに別のパートはその他のグループの一部の後にあります。
  • 認証、認可、および監査グループの重みの順序以外の数が増加する従来の優先順位。
  • 一部の非グローバルプライオリティよりも小さく、同じグローバルプライオリティのクラシックグローバルプライオリティは、他の非グローバルプライオリティ(つまり、非グローバルプライオリティのセグメント、続いて 1 つ以上のグローバル、その後に非グローバルプライオリティ)よりも大きくなります。

NSPEPIおよびcheck_invalid_configツールは、CentOSおよびUbuntuシステムで実行できます

以下のモジュールは、これらのツールを使用するための前提条件です。

  • Python
  • Perl
  • Python pipモジュール
  • Python 用プレイモジュール
  • .pm を Perl 用に Switch.pm