Debugging: resolving the "access denied by Imunify360 bot protection" block in automation workflows
Back to blog

Debugging: resolving the "access denied by Imunify360 bot protection" block in automation workflows

6/18/2026 · 6 min · Cybersecurity

Anyone managing web servers or integrating external services into web applications has likely faced this scenario: an automated routine that previously ran smoothly suddenly stops responding. It might be a payment webhook failing to acknowledge orders, an external cloud cronjob, a database sync routine between an ERP and an e-commerce platform, or an uptime monitor (such as Uptime Kuma or Pingdom) reporting false downtime.

When inspecting the consumer application's response logs, one of two characteristic messages typically appears:

In REST API responses or clients expecting JSON:

{"message":"Access denied by Imunify360 bot-protection..."}

Or in web requests receiving an HTML page (usually paired with an HTTP 403 or 423 status code):

Access Denied by Imunify360 Bot Protection

This error does not mean the server crashed or that your API token expired. It is an intentional, protective block triggered by WebShield, one of Imunify360's core security modules.

Below, we break down why this happens and explore practical methods to whitelist legitimate automated traffic using the command line, control panels, or application code.


Why was the automation blocked? Understanding the javascript challenge#

WebShield operates as a reverse proxy filter positioned between incoming internet traffic and the web server (Apache, LiteSpeed, or Nginx). Its primary objective is to deflect high-volume automated abuse, including scraping bots, vulnerability scanners, and credential brute-force attacks.

To differentiate legitimate human visitors from automated scripts, WebShield serves a transparent JavaScript challenge upon initial connection:

  1. Standard web browsers: Receive the verification page, execute the script in background within milliseconds, receive a verification cookie, and proceed to the destination page without user intervention.
  2. HTTP scripts and libraries: Tools like curl, wget, axios, Python's requests, or PHP's Guzzle only process raw HTTP responses. Lacking a full JavaScript execution runtime, they cannot compute and return the required challenge token. WebShield flags the client as an untrusted bot and drops the connection.

Now that the underlying mechanism is clear, let us examine the cleanest ways to restore connectivity without weakening your overall server defenses.


1. The custom user-agent fallacy#

When this block first occurs, a common instinct is to disguise the automated script with a desktop browser header:

# Common (and ineffective) attempt:
curl -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36..." https://example.com/api

If you build or consume the API and do not have server administration rights, your viable options are:


2. Diagnosing via server logs#

If you have SSH access to the server, checking the log files confirms whether WebShield caused the block and verifies the client IP:

# 1. Inspect WebShield access logs where bot blocks are recorded
tail -100 /var/log/imunify360/webshield/access.log | grep "BOT"

# 2. Review Imunify360 service logs from the past hour
journalctl -u imunify360 --since "1 hour ago" | grep -i "bot"

# 3. Search all Imunify360 log files for bot-protection events
grep -i "bot-protection" /var/log/imunify360/*.log | tail -20

If your automated tool's outbound IP appears in these files alongside bot block markers, the source of the issue is confirmed.


3. Whitelisting via command line (CLI)#

The Imunify360 agent CLI (imunify360-agent) provides direct commands to manage permanent allowlists. Keep in mind a critical syntax distinction:

Single IP addresses vs CIDR subnets#

To whitelist a single IP:

imunify360-agent whitelist ip add 198.51.100.25 --comment "Payment Webhook"

To whitelist an entire network subnet (standard for cloud services like AWS, Cloudflare, GitHub Actions, or payment gateways):

imunify360-agent whitelist subnet add 198.51.100.0/24 --comment "Cloud Gateway Subnet"

Ipv6 considerations#

If your infrastructure runs on IPv6, apply the same syntax rules:

# Single IPv6 address
imunify360-agent whitelist ip add 2001:db8::1 --comment "IPv6 Integration"

# IPv6 subnet
imunify360-agent whitelist subnet add 2001:db8::/64 --comment "IPv6 Subnet Range"

Comment flag compatibility#

On older Imunify360 installations, the --comment flag may trigger an unrecognized argument error. Use a simple shell fallback to prevent automation scripts from failing:

imunify360-agent whitelist ip add 198.51.100.25 --comment "Automation Job" || \
  imunify360-agent whitelist ip add 198.51.100.25

4. Whitelisting via web control panels (WHM, cPanel, or DirectAdmin)#

If you prefer managing the server through a web interface without opening an SSH terminal, you can apply allowlist rules in a few steps:

  1. Log in to your hosting management console (such as WHM for cPanel or the administrator area in DirectAdmin).
  2. In the navigation search bar or under Plugins, select Imunify360.
  3. Inside the Imunify360 dashboard, navigate to the Firewall tab.
  4. Click the White List sub-tab.
  5. Click the Add button.
  6. Enter the address in the input field. The web GUI accepts both single IP addresses (198.51.100.25) and CIDR subnets (198.51.100.0/24) within the same dialog.
  7. Add a descriptive justification in the comment field (e.g., "ERP Invoice API" or "Uptime Ping Monitor").
  8. Click Add IP to save. The rule takes effect immediately.

5. Defensive shell script for rule management#

For managing multiple hosts or updating allowlists routinely, the following bash script automatically distinguishes single IPs from CIDR ranges, handles comment flag errors, and verifies that the rule was registered:

#!/bin/bash
# /usr/local/sbin/imunify-whitelist.sh
# Adds an IP or Subnet to Imunify360's allowlist with automated validation

set -euo pipefail

TARGET="${1:?Usage: $0 <IP_OR_CIDR> [comment]}"
COMMENT="${2:-Added via automation script}"

# Check whether target is a single IP or CIDR block
if [[ "$TARGET" == *"/"* ]]; then
    echo "Detected: CIDR Subnet -> $TARGET"
    imunify360-agent whitelist subnet add "$TARGET" --comment "$COMMENT" 2>/dev/null || \
    imunify360-agent whitelist subnet add "$TARGET"
else
    echo "Detected: Single IP -> $TARGET"
    imunify360-agent whitelist ip add "$TARGET" --comment "$COMMENT" 2>/dev/null || \
    imunify360-agent whitelist ip add "$TARGET"
fi

# Verification step
echo ""
echo "=== Verifying Whitelist Rule ==="
if [[ "$TARGET" == *"/"* ]]; then
    imunify360-agent whitelist subnet list 2>/dev/null | grep -F "$TARGET" && \
      echo "✓ Subnet $TARGET verified in whitelist!" || \
      echo "⚠ Subnet not found in active list."
else
    imunify360-agent whitelist ip list 2>/dev/null | grep -F "$TARGET" && \
      echo "✓ IP $TARGET verified in whitelist!" || \
      echo "⚠ IP not found in active list."
fi

6. Selectively disabling or tuning the challenge#

When an external integration uses rapidly changing dynamic IP ranges where static whitelisting is impractical, you have two configuration options:

Option a: disable only the splash screen challenge#

Instead of turning off WebShield entirely, disable only the JavaScript challenge screen. The JSON syntax depends on your installed agent version:

# Standard syntax for current releases
imunify360-agent config update '{"WEBSHIELD_SPLASH_SCREEN": false}'

# Alternative nested block for specific agent builds
imunify360-agent config update '{"WEBSHIELD": {"splash_screen": false}}'

Option b: calibrate sensitivity without dropping defenses#

To reduce challenge friction while keeping protection active:

# Lower bot detection aggressiveness
imunify360-agent config update '{"WEBSHIELD_BOT_THRESHOLD": "medium"}'

# Increase challenge timeout for high-latency connections
imunify360-agent config update '{"WEBSHIELD_CHALLENGE_TIMEOUT": 30}'

To review active settings after applying changes:

imunify360-agent config show | grep -i -E "splash|webshield"

7. Troubleshooting decision roadmap#

When an automation job runs into an Imunify360 block, this flowchart maps the fastest resolution path:

flowchart TD A["Error: Access denied by Imunify360 bot-protection<br/>(HTTP 403/423)"] --> B["Identify outbound IP or CIDR block"] B --> C{"Do you have root or<br/>panel admin access?"} C -->|Yes via CLI| D{"Single IP or<br/>CIDR subnet?"} D -->|Single IP| E["imunify360-agent whitelist ip add IP"] D -->|Subnet| F["imunify360-agent whitelist subnet add CIDR"] E --> G["Verify: imunify360-agent whitelist ip list"] F --> G G --> H{"Does the request pass?"} H -->|Yes| I["✓ Resolved"] H -->|No| J["Inspect /var/log/imunify360/webshield/access.log"] J --> I C -->|Yes via Web Panel| K["Navigate to WHM/cPanel > Plugins > Imunify360"] K --> L["Firewall > White List > Add > Enter IP/CIDR"] L --> H C -->|No, application developer only| M{"Is the outbound<br/>IP static?"} M -->|Yes| N["Submit IP whitelist request to hosting provider"] M -->|No| O["Deploy headless browser (Puppeteer/Playwright) with JS runtime"] N --> I O --> I style I fill:#10b981,color:#fff style O fill:#f59e0b,color:#000 style K fill:#3b82f6,color:#fff

Best practices for keeping automation and server security in sync#

The Imunify360 bot-protection block is not a malfunction: it is an intended response from an application firewall when non-browser HTTP clients fail a JavaScript execution challenge.

To keep operations running smoothly:

  1. Apply targeted allowlists: Always use subnet add for CIDR ranges and ip add for discrete addresses, keeping default protections active for public web traffic.
  2. Annotate every entry: Clear comments ("Payment Webhook Gateway", "Uptime Robot Probe") prevent accidental rule pruning during server audits.
  3. Skip superficial User-Agent spoofing: Understanding that challenges run at the code execution level saves development time otherwise lost on header trial-and-error.
  4. Inspect logs before altering global settings: Validating the block in webshield/access.log ensures configuration adjustments address the actual point of failure.

🛡️ Production Security Benchmark: Want to see how Imunify360 compares against CSF/LFD and Wordfence CLI on CPU footprint and Layer 7 mitigation? Check out our evaluation: cPanel Security in Production: Imunify360, CSF/LFD, and Wordfence CLI in the Technical Rankings Hub.

Was this article helpful?

Leave a quick reaction to help prioritize future technical guides:

CC BY-NC

This post is licensed under CC BY-NC.

Comments

Join the discussion below.

0 comments