Allow rule or scope down?
The Allow rule is one place to look and covers rate rules as well. The scope down is narrower, because it excuses us from Bot Control alone. Either is safe, because both match the address and the user agent.
Documentation · Letting our agent through your CDN · AWS
On CloudFront with AWS WAF, our agent is let through with one rule in your web ACL: an AND statement of an IP set holding our addresses and a user agent that starts with our token, with the action Allow. Its priority puts it after the rules that look for attacks and before Bot Control and your rate based rules.
OttomAgent/https://ottom.io/agent/ips.jsonMatch both, never the user agent alone: anyone can send our user agent, but only we send it from those addresses. The current addresses are also listed on our agent page.
In the AWS WAF console, open IP sets, choose the Global (CloudFront) scope and create an IPv4 set named ottom-agent. Add each address from the file as a /32.
Open the web ACL attached to your distribution and add a rule of your own with the rule builder. Choose that the request matches all the statements. The JSON below is the same rule, if you prefer the JSON editor.
{
"Name": "allow-ottom-agent",
"Action": {
"Allow": {}
},
"Statement": {
"AndStatement": {
"Statements": [
{
"IPSetReferenceStatement": {
"ARN": "<your ottom-agent IP set ARN>"
}
},
{
"ByteMatchStatement": {
"FieldToMatch": {
"SingleHeader": {
"Name": "user-agent"
}
},
"PositionalConstraint": "STARTS_WITH",
"SearchString": "OttomAgent/",
"TextTransformations": [
{
"Priority": 0,
"Type": "NONE"
}
]
}
}
]
}
},
"VisibilityConfig": {
"SampledRequestsEnabled": true,
"CloudWatchMetricsEnabled": true,
"MetricName": "allow-ottom-agent"
}
}Allow ends evaluation, so every rule after it is skipped for our requests. Place it below the managed rule groups that look for attacks, such as the core rule set, and above the Bot Control rule group and your rate based rules. In the console, lower in the list is a higher priority number.
Save the web ACL.
Run a scan of your store from your Ottom dashboard. When the rule works, the report has no bot protection finding and the agent reaches your products. In the web ACL’s sampled requests, our requests show allow-ottom-agent as the rule that matched, with the action Allow.
Instead of an Allow rule, give the Bot Control rule group a scope down statement: NOT the same AND statement. Bot Control then never inspects our requests, and nothing else changes.
Check the IP set is in the Global (CloudFront) scope, not a region, and that the header name is user-agent in lower case.
Menus move. If a name here no longer matches your dashboard, these are the pages we checked this guide against:
The Allow rule is one place to look and covers rate rules as well. The scope down is narrower, because it excuses us from Bot Control alone. Either is safe, because both match the address and the user agent.
The same rule for other providers, and why it is safe: the CDN guides.