Servisphere
AWS WAF のアイコン(AWS Architecture Icons)

AWS WAF

Web ファイアウォール

悪意のある HTTP request(SQL injection、XSS、bot、不正な IP)を、CloudFront、ALB、API Gateway に到達する前にフィルタリングします。

  • コスト$$ ふつう
  • 難易度●●●●●
  • 未使用でも課金?はい
  • AWS マネージド
  • 出題試験CLF · SAA · SOA

範囲: Global(CloudFront の場合)または Regional

WAF をマップで開く →
たとえるならブラックリストや不審な兆候に基づいて出入りする人をチェックする門の警備員のようなものです。

WAF はシステムのどこにある?

WAF

マップで全体を見る →

具体例でステップごとに

  1. ログインページに対して、ボットが 1 分間に何千回もパスワードを試しています。
  2. AWS WAF でウェブ ACL を作り、サイトの前にある CloudFront に関連付けます。
  3. SQL インジェクションと XSS をブロックする AWS のマネージドルールを有効にします。自分でルールを書く必要はありません。
  4. レートベースのルールで、5 分間に /login へ 300 回を超えるリクエストを送った IP をブロックします。
  5. ボットはエッジで止まり、悪いリクエストがサーバーに届くことはありません。

▶ シナリオ「誰が何を守るか」をマップで見る

いつ使う?

✓ 使うべき場面

公開されている Web アプリケーション。

✗ 避けるべき場面

ネットワーク層の DDoS 対策 → Shield、VPC 内のトラフィックのフィルタリング → Network Firewall。

よくある使い方

  • managed rules で SQL injection、XSS をブロック
  • レート制限でブルートフォース、bot を防止
  • IP または国によるブロック

WAF・VPC・CloudFront の違い

WAFVPCCloudFront
守る層アプリケーション層(HTTP):SQL インジェクション、XSS、ボットネットワーク:IP、ポート(セキュリティグループ、NACL)コンテンツ配信。Shield Standard で DDoS を標準で防御
適用先CloudFront、ALB、API Gateway、AppSync、Cognito などVPC 内のリソースWeb サイトの前段
リクエストの中身の理解あり(パス、ヘッダー、本文)なし一部(パスやヘッダーでキャッシュ)
課金ウェブ ACL、ルール、リクエスト単位セキュリティグループは無料データ転送量

料金はいくら?

料金の例web ACL 1 つ、rule 5 つ、1,000 万 request ≈ $5 + $5 + $6 = $16/月。
  • 課金方式: $5/web ACL/月 + $1/rule/月 + $0.60/100 万 request。高度な rule セット(Bot Control、Fraud Control)は追加料金です。
  • 無料枠: なし。
⚠️ 料金の落とし穴

Bot Control/Fraud Control は request 単位の課金でかなり高い。環境ごとに別々の web ACL を作成する。

料金は us-east-1 の参考値(2026年10月14日 更新)で、変更されている可能性があります。必ず AWS の料金ページでご確認ください。 AWS 公式の料金ページ ↗

💡 試験のコツ

SQL インジェクションや XSS のブロック、単一 IP のレート制限、国単位のブロックなら WAF です。ネットワーク層の DDoS 対策は Shield(対応支援やコスト保護が必要なら Advanced)です。WAF は EC2 や NLB には適用できません。

本番の試験問題に挑戦

AWS 認定試験は英語でも受験できるため、問題文は英語のまま掲載しています。

1A company's web application consists of multiple Amazon EC2 instances that run behind an Application Load Balancer in a VPC. An Amazon RDS for MySQL DB instance contains the data. The company needs the ability to automatically detect and respond to suspicious or unexpected behavior in its AWS environment. The company already has added AWS WAF to its architecture. What should a solutions architect do next to protect against threats?

  1. AUse Amazon GuardDuty to perform threat detection. Configure Amazon EventBridge (Amazon CloudWatch Events) to filter for GuardDuty findings and to invoke an AWS Lambda function to adjust the AWS WAF rules.
  2. BUse AWS Firewall Manager to perform threat detection. Configure Amazon EventBridge (Amazon CloudWatch Events) to filter for Firewall Manager findings and to invoke an AWS Lambda function to adjust the AWS WAF web ACL.
  3. CUse Amazon Inspector to perform threat detection and to update the AWS WAF rules. Create a VPC network ACL to limit access to the web application.
  4. DUse Amazon Macie to perform threat detection and to update the AWS WAF rules. Create a VPC network ACL to limit access to the web application.
答えを見る

正解: A

GuardDuty が不審な振る舞いを検出し、EventBridge がその検出結果を受けて Lambda を呼び出し、WAF のルールを自動で更新します。Inspector はソフトウェアの脆弱性スキャン、Macie は機密データの検出であり、脅威の検出には使いません。

2A company runs a web application on Amazon EC2 instances in an Auto Scaling group that has a target group. The company designed the application to work with session affinity (sticky sessions) for a better user experience. The application must be available publicly over the internet as an endpoint. A WAF must be applied to the endpoint for additional security. Session affinity (sticky sessions) must be configured on the endpoint. Which combination of steps will meet these requirements? (Choose two.)

  1. ACreate a public Network Load Balancer. Specify the application target group.
  2. BCreate a Gateway Load Balancer. Specify the application target group.
  3. CCreate a public Application Load Balancer. Specify the application target group.
  4. DCreate a second target group. Add Elastic IP addresses to the EC2 instances.
  5. ECreate a web ACL in AWS WAF. Associate the web ACL with the endpoint.
答えを見る

正解: C, E

パブリックな Application Load Balancer はスティッキーセッションに対応し、AWS WAF のウェブ ACL を関連付けられます。NLB や Gateway Load Balancer には WAF を適用できません。

Servisphere で 700 問以上を練習する →

よくある質問

WAF と Shield の違いは何ですか?

WAF はアプリケーション層で HTTP リクエストをフィルタリングし、SQL インジェクション、XSS、ボットのブロックや IP ごとのレート制限を行います。Shield は DDoS 対策で、Shield Standard はすべてのアカウントで無料で有効になっており、有料の Shield Advanced では AWS の DDoS 対応チームのサポートが加わります。

WAF はどこに適用できますか?

CloudFront、Application Load Balancer、API Gateway の REST API、AppSync、Cognito ユーザープール、App Runner、Verified Access に適用できます。EC2 や NLB には直接適用できません。

WAF の料金はどのように決まりますか?

ウェブ ACL の数、各 ACL のルール数、検査したリクエスト数で課金されます。AWS Marketplace のマネージドルールグループや、Bot Control、不正防止などの機能は追加料金がかかります。

AWS 認定試験では WAF について何が問われますか?

マネージドルールによる SQL インジェクションや XSS のブロック、単一 IP からの大量アクセスを防ぐレートベースのルール、地域によるブロック、適切なリソースへの WAF の適用、Shield、Network Firewall、セキュリティグループとの違いなどです。

関連サービス

WAF をマップで開く →