概要

AWS WAF は、一般的な Web エクスプロイトから Web アプリケーションを保護するために役立つ Web アプリケーションファイアウォールです。

このインテグレーションを有効にすると、WAF メトリクスを Datadog に表示できます。

セットアップ

インストール

Amazon Web Services インテグレーションをまだセットアップしていない場合は、最初にセットアップします。

メトリクスの収集

  1. AWS インテグレーションページで、使用しているエンドポイントに応じて、Metric Collection タブで WAF または WAFV2 が有効になっていることを確認します。

  2. Datadog - AWS WAF インテグレーションをインストールします。

ログ収集

Web Application Firewall 監査ログを有効にして、Web ACL で分析されたトラフィックに関する詳細情報を取得します。

WAF

  1. aws-waf-logs- から始まる名前で Amazon Data Firehose を作成します。
  2. Amazon Data Firehose の送信先で Amazon S3 を選択し、waf をプレフィックスとして必ず追加してください。
  3. 希望する Web ACL を選択し、それを構成して、新しく作成した Firehose にログを送信するようにします (詳細な手順はこちら)。

WAFV2

  1. aws-waf-logs- から始まる名前で S3 bucket を作成します。
  2. Amazon S3 バケットのログの宛先を構成します (詳細手順)。

WAF/WAFV2 ログが収集され、指定された S3 バケットに送信されます。

ログを Datadog に送信する方法

  1. Datadog Forwarder Lambda 関数をまだセットアップしていない場合は、セットアップします。
  2. Lambda 関数がインストールされたら、AWS コンソールで WAF ログを含む S3 バケットに手動でトリガーを追加します。Lambda で、トリガーリストから S3 をクリックします。
  3. トリガーを構成するには、WAF ログを含む S3 バケットを選択して、イベントタイプを Object Created (All) に変更します。
  4. Add をクリックします。

:

  • Datadog Lambda Forwarder は、WAF ログのネストされたオブジェクトの配列を、使いやすいように自動的に key:value 形式に変換します。
  • “Configurations on the same bucket cannot share a common event type” (同じバケットの構成で共通のイベントタイプを共有することはできない) というエラーメッセージが表示された場合は、該当バケットに他の Lambda Forwarder にリンクされた別のイベント通知が存在しないことを確認してください。S3 バケットは、All object create events の複数のインスタンスを持つことができません。

データ収集

メトリクス

aws.waf.allowed_requests
(count)
The number of allowed web requests.
Shown as request
aws.waf.blocked_requests
(count)
The number of blocked web requests.
Shown as request
aws.waf.counted_requests
(count)
The number of counted web requests.
Shown as request
aws.waf.passed_requests
(count)
The number of passed web requests.
Shown as request
aws.wafv2.allow_rule_match
(count)
The number of matched rules that terminated request evaluation with an Allow action.
aws.wafv2.allowed_requests
(count)
The number of allowed web requests.
Shown as request
aws.wafv2.block_rule_match
(count)
The number of matched rules that terminated request evaluation with a Block action.
aws.wafv2.blocked_requests
(count)
The number of blocked web requests.
Shown as request
aws.wafv2.captcha_requests
(count)
The number of web requests that had CAPTCHA controls applied.
Shown as request
aws.wafv2.captcha_rule_match
(count)
The number of matched rules that terminated request evaluation with a CAPTCHA action.
aws.wafv2.captcha_rule_match_with_valid_token
(count)
The number of matched rules that applied a non-terminating CAPTCHA action.
aws.wafv2.captchas_attempted
(count)
The number of solutions that were submitted by an end user in response to a CAPTCHA puzzle challenge.
aws.wafv2.captchas_attempted_sdk
(count)
The number of solutions that were submitted by an end user in response to a CAPTCHA puzzle challenge, for puzzles that were served via the CAPTCHA JavaScript API.
aws.wafv2.captchas_solved
(count)
The number of CAPTCHA puzzle solutions submitted that successfully solved the puzzle.
aws.wafv2.captchas_solved_sdk
(count)
The number of CAPTCHA puzzle solutions submitted that successfully solved the puzzle, for puzzles that were served via the CAPTCHA JavaScript API.
aws.wafv2.challenge_requests
(count)
The number of web requests that had challenge controls applied.
Shown as request
aws.wafv2.challenge_rule_match
(count)
The number of matched rules that terminated request evaluation with a Challenge action.
aws.wafv2.challenge_rule_match_with_valid_token
(count)
The number of matched rules that applied a non-terminating Challenge action.
aws.wafv2.count_rule_match
(count)
The number of matched rules that applied a non-terminating Count action.
aws.wafv2.counted_requests
(count)
The number of counted web requests.
Shown as request
aws.wafv2.days_to_expiry
(gauge)
The number of days until the expiration date for the associated managed rule group and version.
Shown as day
aws.wafv2.passed_requests
(count)
The number of passed web requests.
Shown as request
aws.wafv2.requests_with_valid_captcha_token
(count)
The number of web requests that had CAPTCHA controls applied and that had a valid CAPTCHA token.
Shown as request
aws.wafv2.requests_with_valid_challenge_token
(count)
The number of web requests that had challenge controls applied and that had a valid challenge token.
Shown as request
aws.wafv2.sample_allowed_request
(count)
The number of sampled requests that the Bot Control managed rule group would allow.
Shown as request
aws.wafv2.sample_blocked_request
(count)
The number of sampled requests that the Bot Control managed rule group would block.
Shown as request
aws.wafv2.sample_captcha_request
(count)
The number of sampled requests that the Bot Control managed rule group would respond to with a CAPTCHA.
Shown as request
aws.wafv2.sample_challenge_request
(count)
The number of sampled requests that the Bot Control managed rule group would respond to with a challenge.
Shown as request
aws.wafv2.sample_count_request
(count)
The number of sampled requests for which the Bot Control managed rule group would apply a Count action.
Shown as request

: WAF の CloudWatch メトリクス API の履歴形式により、aws.waf.*waf.* の両メトリクスが報告されます。

AWS から取得される各メトリクスには、ホスト名やセキュリティ グループなど、AWS コンソールに表示されるのと同じタグが割り当てられます。

イベント

AWS WAF インテグレーションには、イベントは含まれません。

サービスチェック

AWS WAF インテグレーションには、サービスのチェック機能は含まれません。

トラブルシューティング

ご不明な点は、Datadog のサポートチームまでお問い合わせください。