Amazon Web Application Firewall

Présentation

AWS WAF est un pare-feu d’applications Web qui vous aide à protéger vos applications contre les failles Web les plus courantes.

Activez cette intégration pour visualiser dans Datadog vos métriques de WAF.

Configuration

Installation

Si vous ne l’avez pas déjà fait, configurez d’abord l’intégration Amazon Web Services.

Collecte de métriques

  1. Dans le carré d’intégration AWS, assurez-vous que l’option WAF est cochée dans la section concernant la collecte des métriques. Si vous utilisez le nouvel endpoint WAFV2, vérifiez que l’option WAFV2 est cochée.

  2. Installez l’intégration Datadog/AWS WAF.

Collecte de logs

Logs d’audit

Activez les logs d’audit Web Application Firewall pour obtenir des informations détaillées sur le trafic lié à vos contrôles d’accès Web (ACL Web) :

  1. Créez un Amazon Kinesis Data Firehose dont le nom commence par aws-waf-logs-.
  2. Dans la destination du Amazon Kinesis Data Firehose, choisissez Amazon S3 et ajoutez le préfixe waf.
  3. Sélectionnez l’ACL Web souhaité et envoyez ses logs vers le Firehose que vous venez de créer (étapes détaillées).

Les logs WAF sont recueillis et envoyés vers un compartiment S3.

Envoyer des logs à Datadog

  1. Si vous ne l’avez pas déjà fait, configurez la fonction Lambda de collecte de logs AWS avec Datadog.
  2. Une fois la fonction Lambda installée, ajoutez manuellement un déclencheur sur le compartiment S3 contenant vos logs WAF dans la console AWS. Dans votre Lambda, cliquez sur S3 dans la liste des déclencheurs :
    Configuration déclencheur S3
    Configurez votre déclencheur en choisissant le compartiment S3 qui contient vos logs WAF et remplacez le type d’événement par Object Created (All). Cliquez ensuite sur le bouton Add.
    Configuration déclencheur Lambda S3

Remarque : le Forwarder Lambda de Datadog convertit automatiquement les tableaux d’objets imbriqués dans les logs WAF au format key:value pour une plus grande facilité d’utilisation.

Données collectées

Métriques

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

Remarque : Datadog recueille les métriques aws.waf.* et waf.* pour permettre la compatibilité avec l’ancien format des API de métriques CloudWatch pour WAF.

Chacune des métriques récupérées à partir d’AWS se voit assigner les mêmes tags que ceux qui apparaissent dans la console AWS, y compris, mais sans s’y limiter, le hostname et les groupes de sécurité.

Événements

L’intégration AWS WAF n’inclut aucun événement.

Checks de service

L’intégration AWS WAF n’inclut aucun check de service.

Dépannage

Besoin d’aide ? Contactez l’assistance Datadog.

PREVIEWING: may/lambda-logs-http-server-source