三歩あるけば物も忘れる

お腹のお肉がメタボックル

ユーザ用ツール

サイト用ツール


Aws:WAF:SettingExample

2.設定例

以下にWAFの設定例を記載します。
そのうち充実していくはず。

設定例

指定したヘッダーに、特定の値が入っているWebリクエストのみ許可したい。

デフォルトルール

・WAFのデフォルト動作は[Block]とします。

■Default web ACL action for requests that don't match any rules
・Default action:Block

カスタムルール

■Rule
・Type:Regular rule

■If a request
・If a request:matches the statement

■Statement
・Inspect:Header
・Header field name:{ヘッダー名}
・Match type:Exactly matches string
・String to match:{ヘッダーに設定された値}
・Text transformation:None

■Then
・Action:Allow
・Custom request:任意
・Add label:任意

指定したIPアドレスからのWebリクエストのみ許可したい。

デフォルトルール

・WAFのデフォルト動作は[Block]とします。
・CloudFrontからのWebリクエストのみ許可したい想定として、評価対象を[X-Forwarded-For]ヘッダとしています。

■Default web ACL action for requests that don't match any rules
・Default action:Block

IP sets

・IP set name:任意
・Description - optional:任意
・Region:設定したいリージョンorグローバル
・IP version:IPv4
・IP addresses:許可したいCIDRを指定(/8 /16 /24 /32しか対応していないらしい)

カスタムルール

■Rule
・Type:Regular rule

■If a request
・If a request:matches the statement

■Statement
・Inspect:Originates from an IP address in
・IP set:上記[IP sets]で指定した[IP set name]
・IP address to use as the originating address:IP address in header
・Header field name:X-Forwarded-For
・Position inside header:Last IP address
・Fallback for missing IP address:Match

■Then
・Action:Allow
・Custom request:任意
・Add label:任意

,
Aws/WAF/SettingExample.txt · 最終更新: 2021/06/01 by 127.0.0.1