I want to create a CAPTCHA rule for a specific hostname for my protection pack in AWS WAF.
Resolution
To create a CAPTCHA rule that checks a specific hostname, complete the following steps:
- Open the AWS WAF console.
- In the navigation pane, choose AWS WAF.
- Choose Resources & protection packs.
- Find the associated protection pack and choose View and edit next to Rules. This will open a right pane.
- In the right pane, choose Add rule.
- Choose Custom rule and select Next.
- Choose Custom rule again and select Next.
- To set up your rule, configure the following values:
For Action, choose CAPTCHA.
For Rule name, enter a rule name.
For If a Request, choose Matches the statement.
For Inspect, choose Single header.
For Header field name, enter Host.
For Match type, choose Exactly matches String.
For String to match, enter your hostname.
- Choose Create rule.
Note: If you have multiple rules and you need to change the rule priority, then select Edit rule order in the right pane. Move the recently created rule to the desired priority.
- Choose Save rule order.
Related information
CAPTCHA and Challenge in AWS WAF
How can I use AWS WAF to help prevent brute force login attacks?