We set up a WAF in AWS CDK with default rules, and it includes a rule that blocks any request with SignalNonBrowserUserAgent. It's tough to get around this when your clients are apps or postman or python requests.
I couldn't not find a solution to this and spent a few days figuring it out so I'm documenting the setup and solution for anyone else that has struggled with this. The WAF was instantiated with the following code
from aws_solutions_constructs.aws_wafwebacl_apigateway import WafwebaclToApiGateway
my_waf = WafwebaclToApiGateway(scope, waf_id, existing_api_gateway_interface=gateway)
Solution:
I first used the webconsole to manually disable this signal. Click your WebACL -> Rules -> AWSManagedRulesBotControlRuleSet -> Edit. Once the signal was disabled, I looked in the JSON tab to find the correct format of the rule.
Then checked the `cdk.out/<my_stack>.template.json folder to find where this rule was located to add a rule override in the correct spot.
The final code ended up being
I hope this saves someone else some time.