Block bot attacks in your authentication flows
Create an attack protection policy that enforces Okta Challenge during sign-in flows when bot activity is suspected.
About this task
Early Access release
Okta recommends enforcing Okta Challenge in any flow with unexpected bot traffic. For example, if users in your org must sign in from a browser using the Okta Sign-In Widget, you can create an attack protection policy rule that enforces Okta Challenge on sign-in flows for any level of bot confidence. Because this setting imposes some user friction on the sign-in process, use the System Log to determine what percentage of requests should be presented with the challenge.
This configuration shows you how to look in the System Log for bot activity in your sign-in flows and customize a rule that blocks it. You can adapt it to other flows by changing the event type.
Before you begin
- Your org must use Sign-In Widget version 7.47.1 or later.
- Your global session policy must require a password to establish the session.
- If your org uses a Web Application Firewall (WAF) like Cloudflare, Zscaler, or Fastly, you must configure it to pass the original client's IP address.
- Configure X-Forwarded-For (XFF) HTTP headers on the WAF, so that the original client's IP address is appended to the XFF header in the HTTP request. This creates a chain of IP addresses, with the first IP being the real client. Okta can then see the full IP chain and use the client's IP in its bot detection model.
- Configure WAF's IPs as trusted proxies in Okta. This allows Okta to ignore the WAF's IP. Instead, Okta looks at the first IP address in the XFF header to determine the true source of the request.
Procedure
- In the Admin Console, go to .
-
Run this query to see how often Okta Challenge was enforced with a High bot confidence on a sign-in flow:
target.detailEntry.policyMatchedRuleAction eq "OKTA_CHALLENGE" and securityContext.botProtection.level eq "HIGH" -
Run the query again for other bot confidence levels, replacing
eq HIGHwitheq MEDIUMandeq LOW. - Evaluate the distribution of high, medium, and low bot levels to determine when to enforce Okta Challenge.
- Run the query again for other bot confidence levels, replacing
eq "HIGH"witheq "MEDIUM"oreq "LOW". - In the Admin Console, go to .
- Click the Detection and Response tab.
- Go to the Attack protection section.
- On the Attack protection page, click Add rule.
- Name the rule.
- In the Protected flows menu, select Sign-in.
- For Bot Likeliness, select High.
- For Action, select Okta Challenge.
- Click Save.