All Writings
Feature BreakdownSystems

Mitigated Automated Bot Probing at the Global Edge

Every production web application faces constant automated reconnaissance. Attackers run script bots across the internet 24/7, hunting for misconfigured servers, forgotten .env files, or unpatched CMS installations.

Miracle Oladapo
Miracle Oladapo
Frontend Engineer & Systems Architect
September 25, 2026•3 min read
logs
miracle oladapo

Every production web application faces constant automated reconnaissance. Attackers run script bots across the internet 24/7, hunting for misconfigured servers, forgotten .env files, or unpatched CMS installations.

I identified this automated noise in our logs and used it to harden the edge security perimeter of our platform. Here is an overview of what was happening, how I resolved it, and the measured outcome.

The Observation: Noise in the Logs

During routine log inspections, I identified repeated automated probes:

  • Scans looking for setup scripts (such as /wp-admin/install.php and Magento endpoints).
  • Dictionary attacks searching for configuration dumps (/.env, /.kube/config, /.docker/config.json, /secrets/openai.env, /openai.env, /.aws/credentials.js, /.aws/secret_access_key.txt).
  • Automated scrapers using command-line user agents (curl, python-requests, Go-http-client).

Why this was not a breach: The platform is built modernly on Next.js. WordPress, PHP, and Magento files do not exist in our infrastructure. Every probe was met with a standard 404 Not Found.

The hidden cost: Even though the attacker gained zero access, each probe made it all the way to our Vercel serverless environment, booted edge middleware, and consumed roughly 200 MB of server memory per request. At scale, this wastes serverless compute and generates log noise.

What We Implemented: A Two-Layer Defense

Instead of letting malicious scans reach our application, we stopped them at the perimeter.

Layer 1: Global Edge Firewall (Cloudflare WAF)

We shifted traffic filtering directly to Cloudflare’s worldwide Content Delivery Network:

  • Exploit Pattern Dropping: Deployed custom Web Application Firewall (WAF) rules that immediately terminate requests requesting .env, .php, .git, or hidden configuration files at the edge.
  • Bad-Bot Interception: Added custom edge rules targeting automated exploitation toolkits and headless scraping signatures, deploying Managed Challenges to verify traffic legitimacy before allowing it through.
  • Cryptographic HTTPS Enforcement: Turned on HTTP Strict Transport Security (HSTS) with a 1-year max-age policy and X-Content-Type-Options: nosniff headers to prevent protocol downgrade and MIME-sniffing attempts.

Layer 2: Next.js Edge Middleware Shielding

As a fallback behind Cloudflare, we updated firewall with an instant-rejection filter. If any anomalous probe or traversal pattern ever reaches the application router, the firewall drops it immediately with a lightweight 404, bypassing all database queries, rate limiters, and session lookups.

File Target in Log

Bots scan for these specific filenames because exposed credentials have high black-market value:

File Target in LogWhat the Attacker Was Searching For
/secrets/openai.env, /openai.envCompromised OpenAI API keys to hijack GPT-4 credits.
/secrets/anthropic.env, /anthropic.envCompromised Anthropic Claude API tokens.
/openrouter.envAggregator API keys for free AI inference.
/secrets/stripe.env, /stripe_keys.jsStripe secret keys (sk_live_...) to clone payment pipelines.
/.aws/credentials.js, /.aws/secret_access_key.txtRoot AWS IAM access keys for cloud compute / S3 data theft.
/office365.env, /outlook.env, /mail.envCorporate SMTP and mail relays for spam forwarding.
/config/database.yml, /config.envDatabase connection strings (postgresql://...).

3. The Outcome

MetricBefore policy enforcementResult & Outcome
Edge Compute WasteProbes booted deployment functions (~214 MB memory per scan)Zero — 100% dropped at the Cloudflare edge
Vulnerability ProbesPassed freely through the edge firewallBlocked / Challenged automatically
Immediate Live BlockInbound scans reached the app routerIntercepted instantly (e.g., active scanner IP blocked within minutes of deployment)
User ExperienceNormalZero friction — users browse unaffected

Takeaway

Security is not about hoping attackers will ignore your domain; it is about preparing and safeguarding automated filters that reject malicious traffic long before it touches your core application.

Tags & Topics
#logs#Automated scrapers#misconfigured servers#automated reconnaissance#Cloudflare WAF

Found this perspective valuable?

Share with engineers and founders or discuss it on Twitter / X.