Docker Envoy‑ベースのイメージを実行する¶
これらの手順は、Envoy 1.18.4に基づくWallarm Dockerイメージの実行手順を説明します。このイメージには、正しいWallarmノード動作に必要なすべてのシステムが含まれています:
-
Envoyプロキシサービス(Wallarmモジュールを内蔵)
-
Tarantoolモジュール(ポストアナリティクス用)
-
その他のサービスおよびスクリプト
Wallarmモジュールは、リクエストプロキシ用のEnvoy HTTPフィルターとして設計されています。
サポートされている設定パラメーター
NGINXベースのフィルタリングノード設定のほとんどのディレクティブは、Envoyベースのフィルタリングノード設定ではサポートされていません。その結果、レート制限およびクレデンシャルスタッフィング検知は、このデプロイ方法では利用できません。
ユースケース¶
Among all supported Wallarm deployment options, Envoy-based Docker image is recommended for Wallarm deployment in these use cases:
-
If your organization utilizes Docker-based infrastructure, Wallarm Docker image is the ideal choice. It integrates effortlessly into your existing setup, whether you are employing a microservice architecture running on AWS ECS, Alibaba ECS, or other similar services. This solution also applies to those using virtual machines seeking a more streamlined management through Docker containers.
-
If you require fine-grained control over each container, the Docker image excels. It affords a greater level of resource isolation than typically possible with traditional VM-based deployments.
必要条件¶
-
Docker installed on your host system
-
Access to
https://hub.docker.com/r/wallarm/envoy
to download the Docker image. Please ensure the access is not blocked by a firewall -
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 below for downloading updates to attack detection rules, as well as retrieving precise IPs for your allowlisted, denylisted, or graylisted countries, regions, or data centers
コンテナ実行のオプション¶
フィルタリングノードの設定パラメーターは、以下の方法でdocker run
コマンドに渡すことができます:
-
環境変数内に.このオプションは基本的なフィルタリングノードパラメーターの設定のみを可能にし、ほとんどのパラメーターは環境変数を通じて変更することはできません.
-
マウントされた設定ファイル内に.このオプションにより、フィルタリングノードのすべてのパラメーターの設定が可能になります.
環境変数を渡してコンテナを実行する¶
コンテナを実行するには:
-
Get Wallarm token of the appropriate type:
-
ノード付きでコンテナを実行します:
以下の基本的なフィルタリングノードの設定を、オプション-e
を通じてコンテナに渡すことができます:
Environment variable | 説明 | 必須 |
---|---|---|
WALLARM_API_TOKEN | WallarmノードまたはAPIトークン. | Yes |
ENVOY_BACKEND | Wallarmソリューションで保護するリソースのドメインまたはIPアドレス. | Yes |
WALLARM_API_HOST | Wallarm APIサーバ:
api.wallarm.com . | No |
WALLARM_MODE | ノードモード:
monitoring .フィルトレーションモードの詳細な説明 → | No |
WALLARM_LABELS | ノード4.6以降で利用可能です。WALLARM_API_TOKEN がDeploy ロールのAPI tokenに設定されている場合にのみ動作します。ノードインスタンスのグループ化のためにgroup ラベルを設定します.例えば:
…はノードインスタンスを | Yes (for API tokens) |
TARANTOOL_MEMORY_GB | Tarantoolに割り当てられるメモリ量.値は整数または浮動小数点数で指定し、(ドット. は小数点の区切り文字です).デフォルトは0.2ギガバイトです. | No |
コマンドは以下の処理を行います:
-
/etc/envoy
コンテナディレクトリ内に最小限のEnvoy設定を含むenvoy.yaml
ファイルを作成します. -
/etc/wallarm
コンテナディレクトリ内にWallarm Cloudへアクセスするためのフィルタリングノード認証情報のファイルを作成します:node.yaml
:フィルタリングノードのUUIDとシークレットキーprivate.key
:Wallarmプライベートキー
-
http://ENVOY_BACKEND:80
のリソースを保護します.
envoy.yamlをマウントしてコンテナを実行する¶
用意したenvoy.yaml
ファイルは-v
オプションを使用してDockerコンテナにマウントできます。ファイルには以下の設定が含まれている必要があります:
コンテナを実行するには:
-
Get Wallarm token of the appropriate type:
-
ノード付きでコンテナを実行します:
-e
オプションは以下の必須環境変数をコンテナに渡します:
Environment variable 説明 必須 WALLARM_API_TOKEN
Wallarmノードトークン. 複数インストールで1つのトークンを使用する場合
選択されたプラットフォームに関係なく、1つのトークンを複数のインストールで使用できます。これにより、Wallarm Console UIでノードインスタンスを論理的にグループ化できます。例:開発環境に複数のWallarmノードをデプロイし、各ノードが特定の開発者所有の別々のマシン上にある場合などです。
Yes WALLARM_API_HOST
Wallarm APIサーバ: - USクラウドの場合は
us1.api.wallarm.com
- EUクラウドの場合は
api.wallarm.com
api.wallarm.com
.No -v
オプションは設定ファイルenvoy.yaml
のあるディレクトリを/etc/envoy
コンテナディレクトリにマウントします.
コマンドは以下の処理を行います:
-
envoy.yaml
ファイルを/etc/envoy
コンテナディレクトリにマウントします. -
/etc/wallarm
コンテナディレクトリ内にWallarm Cloudへアクセスするためのフィルタリングノード認証情報のファイルを作成します:node.yaml
:フィルタリングノードのUUIDとシークレットキーprivate.key
:Wallarmプライベートキー
-
マウントされた設定ファイルに指定されたリソースを保護します.
ログローテーションの設定(オプション)¶
ログファイルのローテーションはあらかじめ設定され、デフォルトで有効になっています。必要に応じてローテーションの設定を調整できます。これらの設定はコンテナの/etc/logrotate.d
ディレクトリにあります.
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][link-wallarm-health-check] other aspects of the node functioning.