How to bypass challenge for special urls (api entries) #1543
Replies: 1 comment 2 replies
-
|
The issue is that Anubis, by default, is "heavy-handed" and challenges any client that looks like a browser (typically those with To resolve this, you need to add an allowlist rule to your policy file that matches your API paths using a regex. In Anubis, rules are evaluated sequentially, so you must place your "allow" rules before the generic browser challenge rules. Solution: Bypass API PathsAdd a rule using bots:
# 1. Bypass specific API endpoints (Place this first!)
- name: bypass-api-endpoints
path_regex: ^/(api|webhooks|cron-trigger)/.*
action: ALLOW
# 2. Bypass Joomla/Wordpress specific triggers
- name: joomla-wp-loopback
path_regex: ^/(index\.php\?option=com_ajax|wp-cron\.php)
action: ALLOW
# 3. Existing generic challenge rule (Keep this last)
- name: generic-browser
user_agent_regex: Mozilla|Opera
action: CHALLENGE
challenge:
difficulty: 1
algorithm: preactKey Implementation Details
Tip If you are using the Nginx environment, ensure your Do you have a specific URL pattern or a custom User-Agent for these external programs that we could use to make the regex more precise? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Anubis community
First thanks to TecharoHQ and contributers fior this program :)
Just new to anubis :)
So at this time i dont know all about anubis configuration (bot policies, ...)
We tested anubis with a web site. All is ok, Anubis do the job well, bad crawlers and bot stopped :)
The setup is similar to : https://anubis.techaro.lol/docs/admin/environments/nginx
The problem :
The web site have some 'api' (specific urls with variable parameters) that will be called by external programs/web sites (some have specfic agent stings, others no agent string at all) to trigger or perform some actions in the web site.
But those external programs dont know anything about cookies, javascript, .... they just send requests to the web site on the api url.
They cannot response to the challenge send by Anubis.
Bypass by IP cannot be used (variable external ips, not constant).
Notice : Joomla and Wordpress also have somme fonctions or plugins that use external triggers (or loopback calls to themself this external url) to trigger crons, ..., the question is also valid for them too.
How to instruct anubis to not challenge those calls ?
(filter by request check with regex in my mind)
Francis
Beta Was this translation helpful? Give feedback.
All reactions