AWS WAF

CDN and WAF

Also known as: AWS WAF Bot Control, AWS Shield, awswaf

The one product here whose challenge and CAPTCHA responses have documented, distinctive status codes: 202 for a challenge, 405 for a CAPTCHA, and 403 for a block.

AWS WAF is the most precisely documented product in this glossary, and it is worth learning for that reason alone. Where most vendors overload 403, AWS gives each action its own status code and its own header value, so a caller can tell exactly what happened without parsing HTML.

The behaviour turns on a token. AWS WAF documents that when a request carries a valid token, the CAPTCHA and Challenge actions behave like a Count action: labels and customisations are applied and evaluation continues through the rest of the web ACL. When the token is missing, invalid, or expired, evaluation stops and the request is answered with the challenge or CAPTCHA response instead.

One documented sharp edge catches people repeatedly: AWS WAF does not include CORS headers on CAPTCHA and challenge responses, so browser JavaScript cannot read the x-amzn-waf-action header cross-origin. The header is only available within the application's own domain.

How to identify it

Headers

Cookies

Status codes

202 Challenge action

Challenge. Documented by the vendor.

A silent challenge was issued because the request had no valid token. AWS documents this as HTTP status code 202 Request Accepted with the header x-amzn-waf-action set to challenge.

What triggers it

How to confirm it

What to do about it

HTTP/2 202
x-amzn-waf-action: challenge
content-type: text/html; charset=UTF-8

<html><head><script type="text/javascript" src="/challenge.js"></script></head>...

405 CAPTCHA action

Challenge. Documented by the vendor.

A CAPTCHA puzzle was required. AWS documents this as HTTP status code 405 Method Not Allowed with the header x-amzn-waf-action set to captcha.

What triggers it

How to confirm it

What to do about it

HTTP/2 405
x-amzn-waf-action: captcha
content-type: text/html; charset=UTF-8

<html><head><script type="text/javascript" src="/captcha.js"></script></head>...

403 Block action

Blocked. Documented by the vendor.

A rule with the Block action matched. AWS documents that Block responds with an HTTP 403 Forbidden status code, and that in rules you define you can customize the response.

What triggers it

How to confirm it

What to do about it

If you run a site behind it

If your traffic is being caught by it

Documentation

See also