コンテンツにスキップ

Istio Ingress向けWallarmフィルター

WallarmはIstioが管理するAPIを保護するためのフィルターを提供し、トラフィックをインラインまたはアウトオブバンドで分析します。Wallarm nodeを外部にデプロイし、Envoyの設定にWallarm提供の構成を適用して、gRPCベースの外部処理フィルター経由でトラフィックをWallarm nodeにルーティングして分析します。

OOBモード(ミラーリングされたトラフィック)

こちらで説明されているEnvoyパラメータobservability_modeを設定することで、Istio向けWallarmフィルターを使用してアウトオブバンド(OOB)でトラフィックを分析することもできます。

ユースケース

Envoyプロキシで動作するIstioが管理するAPIをリアルタイムに保護するのに最適な選択です。

制限事項

  • When deploying the Wallarm service with the LoadBalancer type using the Helm chart, a trusted SSL/TLS certificate is required for the domain. Self-signed certificates are not yet supported.

  • Custom blocking page and blocking code configurations are not yet supported.

    All blocked malicious traffic is returned with status code 403 and the default block page.

  • Rate limiting by Wallarm rules is not supported.

    Rate limiting cannot be enforced on the Wallarm side for this connector. If you need rate limiting, use the features built into your API gateway or cloud platform.

  • Multitenancy is not supported.

    All protected APIs are managed under a single Wallarm account; separating protection across multiple accounts for different infrastructures or environments is not yet supported.

要件

デプロイを進める前に、以下の要件を満たしていることを確認します。

  • Istio技術の理解

  • APIトラフィックを管理するEnvoyプロキシを備えたIstio

デプロイ

1. Wallarm nodeをデプロイします

Wallarm nodeはWallarmプラットフォームの中核コンポーネントで、デプロイする必要があります。受信トラフィックを検査し、不正なアクティビティを検出し、脅威を軽減するように構成できます。

セルフホスト型nodeデプロイ用のアーティファクトを選択し、envoy-external-filterモード向けの手順に従います:

  • All-in-oneインストーラー: ベアメタルまたはVM上のLinuxインフラストラクチャ向け

  • Docker image: コンテナ化デプロイを使用する環境向け

  • AWS AMI: AWSインフラストラクチャ向け

  • Helm chart: Kubernetesを利用するインフラストラクチャ向け

2. Envoyを構成してトラフィックをWallarm nodeへプロキシします

  1. envoy.yamlhttp_filtersセクションで、解析のためにリクエストとレスポンスを外部のWallarm Nodeへ送信する外部処理フィルターを構成します。そのために、次のテンプレートを使用します:

    ...
    
    http_filters:
    - name: ext_proc
      typed_config:
        "@type": type.googleapis.com/envoy.extensions.filters.http.ext_proc.v3.ExternalProcessor
        grpc_service:
          envoy_grpc:
            cluster_name: wallarm_cluster
        processing_mode:
          request_body_mode: STREAMED
          response_body_mode: STREAMED
        request_attributes: ["request.id", "request.time", "source.address"]
    
  2. envoy.yamlclustersセクションで、データをWallarm Nodeへ転送するために使用されるWallarmクラスターを構成します。そのために、次のテンプレートを使用します:

    clusters:
    - ...
    - name: wallarm_cluster
      connect_timeout: 30s
      load_assignment:
        cluster_name: wallarm_cluster
        endpoints: # Wallarm Nodeのエンドポイント
        - lb_endpoints:
          - endpoint:
              address:
                socket_address:
                  address: 127.0.0.1
                  port_value: 5080
      http2_protocol_options: {} # http2を有効化するために設定が必要です
      transport_socket:
        name: envoy.transport_sockets.tls
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext
          common_tls_context:
            validation_context:
              trusted_ca:
                filename: /path/to/node-ca.pem # Nodeインスタンスで使用される証明書を発行したCA
    

発生し得る500エラーの回避

外部フィルターに問題が発生した際の500エラーを回避するために、設定にfailure_mode_allowパラメータを追加できます。

テスト

デプロイしたフィルターの機能をテストするには、次の手順に従います。

  1. テスト用のパストラバーサル攻撃を含むリクエストをIstio Gatewayに送信します:

    curl https://<ISTIO_GATEWAY_IP>/etc/passwd
    
  2. Wallarm Console→US CloudまたはEU CloudのAttacksセクションを開き、攻撃が一覧に表示されていることを確認します。

    インターフェイスのAttacks