サポート終了(EOL)クラウドノードイメージのアップグレード¶
本書では、AWSまたはGCPにデプロイされたサポート終了のクラウドノードイメージ(バージョン3.6以下)を6.xにアップグレードする手順を説明します。
Wallarm nodes 3.6 and lower are not supported
You are recommended to upgrade the Wallarm nodes 3.6 and lower since these versions are not supported, they are end-of-life.
Node configuration and traffic filtration have been significantly simplified in the Wallarm node of the latest versions. Before upgrading the modules, please carefully review the list of changes and general recommendations. Please note that some settings of the latest node are incompatible with the nodes 3.6 and lower.
要件¶
-
Access to the account with the Administrator role in Wallarm Console in the US Cloud or EU Cloud
-
Access to
https://us1.api.wallarm.com
if working with US Wallarm Cloud or tohttps://api.wallarm.com
if working with EU Wallarm Cloud. Please ensure the access is not blocked by a firewall -
Access to the IP addresses and their corresponding hostnames (if any) listed below. This is needed for downloading updates to attack detection rules and API specifications, as well as retrieving precise IPs for your allowlisted, denylisted, or graylisted countries, regions, or data centers
手順1: フィルタリングノードモジュールをアップグレードすることをWallarmテクニカルサポートに連絡します(ノード2.18以下をアップグレードする場合のみ)¶
ノード2.18以下をアップグレードする場合は、フィルタリングノードモジュールを最新バージョンにアップグレードする旨をWallarmテクニカルサポートに連絡し、お使いのWallarmアカウントに対して新しいIPリストロジックの有効化を依頼してください。新しいIPリストロジックが有効化されたら、Wallarm ConsoleのIP listsセクションにアクセスできることを確認してください。
手順2: Threat Replay Testingモジュールを無効化します(ノード2.16以下をアップグレードする場合のみ)¶
Wallarmノード2.16以下をアップグレードする場合は、Wallarm Console → Vulnerabilities → ConfigureでThreat Replay Testingモジュールを無効化してください。
アップグレード中に当該モジュールの動作が誤検知を引き起こす可能性があります。無効化することでこのリスクを最小化できます。
手順3: APIポートを更新する¶
Starting with version 4.0, the filtering node uploads data to the Cloud using the us1.api.wallarm.com:443
(US Cloud) and api.wallarm.com:443
(EU Cloud) API endpoints instead of us1.api.wallarm.com:444
and api.wallarm.com:444
.
If you upgrade the node from the version 3.x or lower and your server with the deployed node has a limited access to the external resources and the access is granted to each resource separately, then after upgrade the synchronization between the filtering node and the Cloud will stop.
To restore the synchronization, in your configuration, change port 444
to 443
for API endpoint for each resource.
手順4: 直近のアーキテクチャ更新を確認する¶
最新のアップデートでは、特にノードのデフォルト設定ファイルを変更しているユーザーに影響する可能性のあるアーキテクチャの変更が導入されています。新しいイメージを正しく構成・利用できるよう、これらの変更点を必ず把握してください。
手順5: フィルタリングノード6.xの新規インスタンスを起動する¶
以前のWallarmノードバージョンの次の設定ファイルから、要求の処理とプロキシの設定をフィルタリングノード6.xのファイルにコピーしてください:
-
クラウドプラットフォームのマーケットプレイスでWallarmフィルタリングノードのイメージを開き、イメージの起動に進みます:
-
起動時の手順で、以下を設定します:
- イメージバージョン
6.x
を選択します - AWSの場合、Security Group Settingsフィールドで作成済みのセキュリティグループを選択します
- AWSの場合、Key Pair Settingsフィールドで作成済みのキーペアの名前を選択します
- イメージバージョン
-
インスタンスの起動を確定します。
-
GCPの場合、これらの手順に従ってインスタンスを構成します。
手順6: 最新バージョンでの変更に合わせてWallarmノードのフィルタリングモード設定を調整する(ノード2.18以下をアップグレードする場合のみ)¶
-
以下の設定の想定どおりの動作が、
off
およびmonitoring
フィルタリングモードの変更されたロジックに合致していることを確認してください: -
想定動作が変更後のフィルタリングモードロジックに合致していない場合は、手順に従って設定を最新の変更内容に合わせて調整してください。
手順7: フィルタリングノードをWallarm Cloudに接続する¶
-
SSHでフィルタリングノードのインスタンスに接続します。インスタンスへの接続に関する詳細な手順は各クラウドプラットフォームのドキュメントをご参照ください:
-
クラウドプラットフォーム別の手順に従い、生成したトークンを使用して新しいWallarmノードを作成し、Wallarm Cloudに接続します:
手順8: 以前のバージョンから新バージョンへフィルタリングノードの設定をコピーする¶
-
以前のWallarmノードバージョンの次の設定ファイルから、要求の処理とプロキシの設定をフィルタリングノード6.xのファイルにコピーします:
/etc/nginx/nginx.conf
およびその他のNGINX設定ファイル-
フィルタリングノードの監視サービス設定を含む
/etc/nginx/conf.d/wallarm-status.conf
コピーしたファイル内容が推奨される安全な構成に準拠していることを確認してください。
-
環境変数を含む
/etc/environment
- 最近のアーキテクチャの変更を踏まえ、
/etc/nginx/sites-available/default
など、要求の処理やプロキシに関するその他のカスタム設定ファイル
-
設定ファイルで明示的に指定している場合、以下のNGINXディレクティブをリネームしてください:
wallarm_instance
→wallarm_application
wallarm_local_trainingset_path
→wallarm_custom_ruleset_path
wallarm_global_trainingset_path
→wallarm_protondb_path
wallarm_ts_request_memory_limit
→wallarm_general_ruleset_memory_limit
ディレクティブは名前のみ変更され、ロジックは同一です。旧名称のディレクティブはまもなく非推奨となるため、事前にリネームすることを推奨します。
-
拡張ログ形式を設定している場合、設定内で
wallarm_request_time
変数を明示的に指定していないか確認してください。指定している場合は、
wallarm_request_cpu_time
にリネームしてください。変数は名称のみ変更され、ロジックは同一です。旧名称も一時的にサポートされていますが、リネームを推奨します。
-
ノード2.18以下をアップグレードする場合、以前のWallarmノードバージョンの許可リストと拒否リストの設定を6.xに移行してください。
-
ブロックされたリクエストに対してページ
&/usr/share/nginx/html/wallarm_blocked.html
を返している場合は、その新しいバージョンをコピーしてカスタマイズしてください。新しいノードバージョンでは、Wallarmのサンプルブロッキングページが変更されています。ページ上のロゴとサポートメールはデフォルトで空になりました。
NGINX設定ファイルの取り扱いに関する詳細は、公式NGINXドキュメントをご参照ください。
フィルタリングノードのディレクティブ一覧はこちらです。
手順8: overlimit_res
攻撃検出の設定をディレクティブからルールへ移行する¶
Starting from the version 3.6, you can fine-tune the overlimit_res
attack detection using the rule in Wallarm Console.
Earlier, the wallarm_process_time_limit
and wallarm_process_time_limit_block
NGINX directives have been used. The listed directives are considered to be deprecated with the new rule release and will be deleted in future releases.
If the overlimit_res
attack detection settings are customized via the listed directives, it is recommended to transfer them to the rule as follows:
-
Open Wallarm Console → Rules and proceed to the Limit request processing time rule setup.
-
Configure the rule as done via the NGINX directives:
- The rule condition should match the NGINX configuration block with the
wallarm_process_time_limit
andwallarm_process_time_limit_block
directives specified. -
The time limit for the node to process a single request (milliseconds): the value of
wallarm_process_time_limit
.Risk of running out of system memory
The high time limit and/or continuation of request processing after the limit is exceeded can trigger memory exhaustion or out-of-time request processing.
-
The node will either block or pass the
overlimit_res
attack depending on the node filtration mode:- In the monitoring mode, the node forwards the original request to the application address. The application has the risk to be exploited by the attacks included in both processed and unprocessed request parts.
- In the safe blocking mode, the node blocks the request if it is originated from the graylisted IP address. Otherwise, the node forwards the original request to the application address. The application has the risk to be exploited by the attacks included in both processed and unprocessed request parts.
- In the block mode, the node blocks the request.
- The rule condition should match the NGINX configuration block with the
-
Delete the
wallarm_process_time_limit
andwallarm_process_time_limit_block
NGINX directives from the NGINX configuration file.If the
overlimit_res
attack detection is fine-tuned using both the directives and the rule, the node will process requests as the rule sets.
手順9: NGINXを再起動する¶
設定を適用するため、NGINXを再起動します:
手順10: Wallarmノードの動作をテストする¶
-
Send the request with test Path Traversal attack to a protected resource address:
If traffic is configured to be proxied to
example.com
, include the-H "Host: example.com"
header in the request. -
Open Wallarm Console → Attacks section in the US Cloud or EU Cloud and make sure the attack is displayed in the list.
-
Optionally, test other aspects of the node functioning.
手順11: AWSまたはGCPでフィルタリングノード6.xをベースに仮想マシンイメージを作成する¶
フィルタリングノード6.xをベースに仮想マシンイメージを作成するには、AWSまたはGCPの手順に従ってください。
手順12: 前のWallarmノードインスタンスを削除する¶
新バージョンのフィルタリングノードが正常に構成・テストできたら、AWSまたはGCPの管理コンソールを使用して、旧バージョンのフィルタリングノードのインスタンスと仮想マシンイメージを削除してください。
手順13: Threat Replay Testingモジュールを再度有効化する(ノード2.16以下をアップグレードする場合のみ)¶
Threat Replay Testingモジュールの設定に関する推奨事項を確認し、必要に応じて再度有効化してください。
しばらく運用した後、当該モジュールの動作が誤検知を引き起こしていないことを確認してください。誤検知が発生する場合は、Wallarmテクニカルサポートにご連絡ください。