コンテンツにスキップ

Wallarm SidecarがサポートするPodのアノテーション

Wallarm Sidecar solutionは、Podごとのアノテーションを通じて設定できます。本書には、当ソリューションがサポートするアノテーションの一覧が記載されています。

グローバル設定とPodごとの設定の優先順位

Podごとのアノテーションは、Helmチャートの値よりも優先されます.

アノテーション一覧

アノテーションと対応するチャート値 説明
Annotation: sidecar.wallarm.io/sidecar-injection-schema

config.injectionStrategy.schema
Wallarmコンテナの展開パターンsingle(デフォルト)またはsplit.
Annotation: sidecar.wallarm.io/sidecar-injection-iptables-enable

config.injectionStrategy.iptablesEnable
iptables init コンテナを起動するかどうかtrue(デフォルト)またはfalse.
Annotation: sidecar.wallarm.io/wallarm-application

チャート値なし
WallarmアプリケーションID.
Annotation: sidecar.wallarm.io/wallarm-block-page

チャート値なし
ブロックされたリクエストに返すブロックページとエラーコード.
Annotation: sidecar.wallarm.io/wallarm-enable-libdetection

config.wallarm.enableLibDetection
SQLインジェクション攻撃をlibdetectionライブラリで追加検証するかどうか:on(デフォルト)またはoff.
Annotation: sidecar.wallarm.io/wallarm-fallback

config.wallarm.fallback
Wallarmフォールバックモードon(デフォルト)またはoff.
Annotation: sidecar.wallarm.io/wallarm-mode

config.wallarm.mode
トラフィックフィルトレーションモードmonitoring(デフォルト)、safe_blockingblockまたはoff.
Annotation: sidecar.wallarm.io/wallarm-mode-allow-override

config.wallarm.modeAllowOverride
Cloudでの設定を介してwallarm_modeの値を上書きできるかどうかを管理しますon(デフォルト)、offまたはstrict.
Annotation: sidecar.wallarm.io/wallarm-node-group

config.wallarm.api.nodeGroup
新たに展開されるノードを追加するフィルタリングノードグループの名前を指定します。この方法によるノードのグルーピングは、Deployロールを持つAPIトークンを使用してCloudにノードを作成して接続する場合にのみ利用可能です(その値はconfig.wallarm.api.tokenパラメータに渡されます)。
この値はTarantool podには適用されず、Tarantool podのノードは常にconfig.wallarm.api.nodeGroup Helmチャート値で指定されたノードグループにリンクされます.
Annotation: sidecar.wallarm.io/wallarm-parser-disable

チャート値なし
パーサを無効化できます。ディレクティブの値は無効にするパーサの名前に対応し、例:jsonです。複数のパーサを指定する場合はセミコロンで区切ります。例:json;base64.
Annotation: sidecar.wallarm.io/wallarm-parse-response

config.wallarm.parseResponse
攻撃検出のためにアプリケーションのレスポンスを解析するかどうか:on(デフォルト)またはoff. レスポンス解析は、パッシブ検出および脅威再現テスト中の脆弱性検出に必要です.
Annotation: sidecar.wallarm.io/wallarm-acl-export-enable

config.wallarm.aclExportEnable
ノードからCloudへdenylisted IPからのリクエストに関する統計情報を送信するかどうかを、有効onまたは無効offで設定します。
  • on値(デフォルト)の場合、denylisted IPからのリクエストに関する統計情報がAttacksセクションに表示されます
  • off値の場合、denylisted IPからのリクエストに関する統計情報は表示されません。
Annotation: sidecar.wallarm.io/wallarm-parse-websocket

config.wallarm.parseWebsocket
Wallarmは完全なWebSocketサポートを提供します。デフォルトではWebSocketメッセージは攻撃解析されません。機能を強制するには、API Securityのサブスクリプションプランを有効にし、このアノテーションを使用してonまたはoff(デフォルト)を指定します.
Annotation: sidecar.wallarm.io/wallarm-unpack-response

config.wallarm.unpackResponse
アプリケーションレスポンスで返される圧縮データの解凍を行うかどうか:on(デフォルト)またはoff.
Annotation: sidecar.wallarm.io/wallarm-upstream-connect-attempts

config.wallarm.upstream.connectAttempts
TarantoolまたはWallarm APIへの即時再接続の回数を定義します.
Annotation: sidecar.wallarm.io/wallarm-upstream-reconnect-interval

config.wallarm.upstream.reconnectInterval
即時再接続の回数の閾値を超えた後、TarantoolまたはWallarm APIへの再接続試行間隔を定義します.
Annotation: sidecar.wallarm.io/application-port

config.nginx.applicationPort
公開されているアプリケーションpodのポートが見つからない場合、Wallarmコンテナはこのポートへの着信リクエストを待機します(詳細).
Annotation: sidecar.wallarm.io/nginx-listen-port

config.nginx.listenPort
Wallarmコンテナがリッスンするポートです。このポートはWallarm sidecar solution専用であり、application-portと同じにはできません.
Annotation: sidecar.wallarm.io/nginx-http-include

チャート値なし
NGINXの設定ファイルのパスの配列で、NGINX構成のhttpレベルにインクルードされるものです。ファイルはコンテナにマウントされ、このパスはコンテナ内のファイルを指す必要があります.
Annotation: sidecar.wallarm.io/nginx-http-snippet

チャート値なし
NGINX構成のhttpレベルに含める追加のインライン設定です.
Annotation: sidecar.wallarm.io/nginx-server-include

チャート値なし
NGINXの設定ファイルのパスの配列で、NGINX構成のserverレベルにインクルードされるものです。ファイルはコンテナにマウントされ、このパスはコンテナ内のファイルを指す必要があります.
Annotation: sidecar.wallarm.io/nginx-server-snippet

チャート値なし
NGINX構成のserverレベルに含める追加のインライン設定です.
Annotation: sidecar.wallarm.io/nginx-location-include

チャート値なし
NGINXの設定ファイルのパスの配列で、NGINX構成のlocationレベルにインクルードされるものです。ファイルはコンテナにマウントされ、このパスはコンテナ内のファイルを指す必要があります.
Annotation: sidecar.wallarm.io/nginx-location-snippet

チャート値なし
NGINX構成のlocationレベルに含める追加のインライン設定です.
Annotation: sidecar.wallarm.io/nginx-extra-modules

チャート値なし
有効にする追加のNGINXモジュールの配列です.
Annotation: sidecar.wallarm.io/nginx-worker-connections

config.nginx.workerConnections
NGINXワーカープロセスが開くことのできる同時接続の最大数(詳細)。デフォルトでは、チャート値は4096に設定されています.
Annotation: sidecar.wallarm.io/nginx-worker-processes

config.nginx.workerProcesses
NGINXワーカープロセス数。デフォルトでは、チャート値はautoに設定されており、これはワーカーの数がCPUコア数に合わせて設定されることを意味します.
Annotation: sidecar.wallarm.io/proxy-extra-volumes

チャート値なし
Podに追加するカスタムボリュームの配列。アノテーション値はシングルクォート''で囲む必要があります.
Annotation: sidecar.wallarm.io/proxy-extra-volume-mounts

チャート値なし
sidecar-proxyコンテナに追加するカスタムボリュームマウントのJSONオブジェクト。アノテーション値はシングルクォート''で囲む必要があります.
Annotation: sidecar.wallarm.io/proxy-cpu

config.sidecar.containers.proxy.resources.requests.cpu
sidecar-proxyコンテナの要求CPUです.
Annotation: sidecar.wallarm.io/proxy-memory

config.sidecar.containers.proxy.resources.requests.memory
sidecar-proxyコンテナの要求メモリです.
Annotation: sidecar.wallarm.io/proxy-cpu-limit

config.sidecar.containers.proxy.resources.limits.cpu
sidecar-proxyコンテナのCPU制限です.
Annotation: sidecar.wallarm.io/proxy-memory-limit

config.sidecar.containers.proxy.resources.limits.memory
sidecar-proxyコンテナのメモリ制限です.
Annotation: sidecar.wallarm.io/helper-cpu

config.sidecar.containers.helper.resources.requests.cpu
sidecar-helperコンテナの要求CPUです.
Annotation: sidecar.wallarm.io/helper-memory

config.sidecar.containers.helper.resources.requests.memory
sidecar-helperコンテナの要求メモリです.
Annotation: sidecar.wallarm.io/helper-cpu-limit

config.sidecar.containers.helper.resources.limits.cpu
sidecar-helperコンテナのCPU制限です.
Annotation: sidecar.wallarm.io/helper-memory-limit

config.sidecar.containers.helper.resources.limits.memory
sidecar-helperコンテナのメモリ制限です.
Annotation: sidecar.wallarm.io/init-iptables-cpu

config.sidecar.initContainers.iptables.resources.requests.cpu
sidecar-init-iptablesコンテナの要求CPUです.
Annotation: sidecar.wallarm.io/init-iptables-memory

config.sidecar.initContainers.iptables.resources.requests.memory
sidecar-init-iptablesコンテナの要求メモリです.
Annotation: sidecar.wallarm.io/init-iptables-cpu-limit

config.sidecar.initContainers.iptables.resources.limits.cpu
sidecar-init-iptablesコンテナのCPU制限です.
Annotation: sidecar.wallarm.io/init-iptables-memory-limit

config.sidecar.initContainers.iptables.resources.limits.memory
sidecar-init-iptablesコンテナのメモリ制限です.
Annotation: sidecar.wallarm.io/init-helper-cpu

config.sidecar.initContainers.helper.resources.requests.cpu
sidecar-init-helperコンテナの要求CPUです.
Annotation: sidecar.wallarm.io/init-helper-memory

config.sidecar.initContainers.helper.resources.requests.memory
sidecar-init-helperコンテナの要求メモリです.
Annotation: sidecar.wallarm.io/init-helper-cpu-limit

config.sidecar.initContainers.helper.resources.limits.cpu
sidecar-init-helperコンテナのCPU制限です.
Annotation: sidecar.wallarm.io/init-helper-memory-limit

config.sidecar.initContainers.helper.resources.limits.memory
sidecar-init-helperコンテナのメモリ制限です.
Annotation: sidecar.wallarm.io/profile

チャート値なし
このアノテーションは、TLS/SSL終端のためにアプリケーションpodに特定のTLSプロファイルを割り当てるために使用されます。

このアノテーションとTLS/SSL終端はHelmチャート4.6.1以降でサポートされています.

WallarmがサポートするNGINXディレクティブには直接のアノテーションでカバーされていないものもありますが、nginx-*-snippetおよびnginx-*-includeアノテーションを使用してこれらも設定可能です。

アノテーションの使用方法

アプリケーション構成の該当するDeploymentオブジェクトの設定にアノテーションを指定してPodに適用します。例:

kubectl edit deployment -n <APPLICATION_NAMESPACE> <APP_LABEL_VALUE>
apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
        wallarm-sidecar: enabled
      annotations:
        sidecar.wallarm.io/wallarm-mode: block
    spec:
      containers:
        - name: application
          image: kennethreitz/httpbin
          ports:
            - name: http
              containerPort: 80