Under the hood
Why /wp-login.php wakes your Laravel container
Scanners ask every site for /.env and /wp-login.php. On a serverless Laravel container each guess costs 15 minutes awake. How the edge refuses them with a 403.
In this post
Open the access log of any public website and you will find requests for pages it never had: /wp-login.php, /.env, /.git/config, /phpmyadmin/. Your Laravel app does not run WordPress and does not serve its .env, so each of them gets a 404 and nothing is lost.
On a server that runs all day, that is the end of it. On a serverless container it is not, because something had to be awake to say 404. This post explains why these requests get past an edge cache, what they cost a container that is supposed to sleep, and how a pull zone that Brewless manages answers them before they reach your app.
Why does /wp-login.php wake a Laravel app that has no WordPress?
Because the scanner does not know what your site runs, and the edge has never seen the address. bunny.net looks in its cache, finds nothing under /wp-login.php, and passes the request to your container, which starts, boots Laravel and answers 404.
On Scaleway a serverless container scales to zero after 15 minutes without a request, and every request that reaches it starts those 15 minutes again. One guess at three in the night keeps the container up for a quarter of an hour.
What scanners ask for
Scanners are programs that walk through hostnames and try a fixed list of paths on each one. They find your hostname without any link to it: a certificate is listed in public certificate logs from the moment it is issued. What they look for falls into a few groups:
| What they ask | What they hope to find |
|---|---|
/.env, /.env.backup, /.aws/credentials |
Keys and passwords in a file that was left in the web root |
/.git/config, /.svn/entries |
A repository to download the source code from |
/wp-login.php, /wp-admin/, /xmlrpc.php |
A WordPress login to try passwords on |
/phpmyadmin/, /phpinfo.php, /cgi-bin/ |
A database tool or a page that tells them about the server |
None of this is aimed at you. The same list goes to every site, and they try it under folders as well: /old/.env, /backup/wp-login.php, /api/.git/config.
Is your .env at risk?
Not in a Laravel app that is set up as the framework intends. The web server serves the public/ folder only, and .env sits one level above it, next to composer.json. A request for /.env is a request for public/.env, which does not exist, so it goes to public/index.php like any other unknown address and Laravel answers 404.
So the answer was always right. What changes on serverless is who has to give it. A 404 from Laravel needs a running container, and a container that was asleep has to start for it.
Why the edge cache does not help
The edge cache is what lets a serverless Laravel container sleep: bunny.net keeps your public pages and answers them itself. That works for an address that comes back. A visitor asks for /pricing, the edge keeps it, and the next thousand visitors never reach the container.
A scanner's address does not come back in the same form. Brewless does keep a 404 at the edge like a page, so the second request for the same missing address is answered there. But a scanner has more addresses than you have pages, and each one is new to the edge: every one of them reaches the container once. It does not take many of them, spread over a night, to make sure the 15 quiet minutes never come.
There is nothing to fix in your application either. Session cookies, Cache-Control and the other things that keep a Laravel container awake are about pages you serve. These are pages you do not have.
Refusing them at the edge
The requests have one thing in common: the path. No Laravel application has a page at /wp-login.php or /.git/config. So the edge does not need to ask the container what the answer is.
Every pull zone Brewless manages has a set of edge rules for this, called brewless: scanner addresses blocked 1 to 7. bunny.net takes five patterns in one rule, which is why there are seven. A request whose path matches one of them is answered by bunny.net itself with a 403, and the container is not asked. The patterns match the path under any folder:
| Paths | What they are |
|---|---|
/.env, /.env.*, /.git, /.git/*, /.svn/*, /.aws/*, /.ssh/*, /.DS_Store, /.htpasswd, /.vscode/* |
Hidden files and folders of tools |
/wp-admin, /wp-admin/*, /wp-login.php, /wp-content/*, /wp-includes/*, /xmlrpc.php, /wp-json, /wp-json/*, /wp-cron.php, /wp-config.php, /wlwmanifest.xml, /wp-signup.php, /wordpress, /wordpress/*, /wp, /wp/* |
WordPress |
/phpmyadmin, /phpmyadmin/*, /phpinfo.php, /cgi-bin/* |
phpMyAdmin, a PHP info page and CGI |
/index.php together with a query string that holds option=com_… |
Joomla |
You can see it on any site behind such a pull zone:
curl -I https://brewless.eu/wp-login.php
The answer is HTTP/2 403 with a server: BunnyCDN-… header, and no container was started for it.
You do not turn this on. A new pull zone gets the rules at its first deploy, and every later deploy adds them to a zone that was made earlier, or puts one back when somebody changed it or switched it off in the bunny.net dashboard.
What is not on the list
A rule that refuses a path can also refuse a page you meant to serve, so the list is short on purpose. It holds only paths that are never a page of an application.
/.well-known/is not blocked. It starts with a dot like the others, but it is wheresecurity.txtand other files that are meant to be public live.- Folders an application may serve are not blocked, however often a scanner tries them.
/blog/,/cms/and/site/are yours. - Joomla's entrance is
/index.php, and that is a path your own application may answer. So that one rule looks at two things together: the path and a query string withoption=com_…./index.phpon its own goes through.
The other rules look at the path only. A scanner that asks /blog/?rest_route=/wp/v2/users is passed on, because /blog/ may be a page of yours. For addresses like that one, where the path is real and only the query string is invented, the tool is a different one: edge.ignore_query and edge.vary_query in brewless.yml, described in why ?utm_source links wake your Laravel container.
Note
These rules are not a firewall. They refuse a fixed list of paths and do nothing about a client that hammers your login form. For that, an environment can have bunny.net Shield in front of it, with a rate limit per address and bot control, under
firewallinbrewless.yml. See the firewall documentation.
Seeing what still gets through
The rules take away the known guesses. Any other address that does not exist still reaches the container once. To see which ones do, open the page of an environment behind bunny.net and look at What reaches the container, or ask in a terminal:
brewless wakes production
It lists the addresses of the last 24 hours that the edge did not answer itself, most first, read from the request log of your own pull zone. The page also says how many requests the edge answered from a rule of its own: plain HTTP sent on to https, and scanner addresses it refused. Those are counted apart and left out of the list, because the container never saw them. A 403 that your own application gave on another path stays in the list, since that one did reach it.
If a path keeps turning up there that is clearly not yours and not on the list, you can add an edge rule for it yourself in the bunny.net dashboard, with the action that blocks the request and the path as its trigger. The pull zone is in your own bunny.net account, and Brewless finds the rules it looks after by their name. Before you do, check that no route of your application answers under that path.
Without Brewless
Nothing here is tied to Brewless. Any CDN that can answer a request from a rule can do the same, and on bunny.net it is an edge rule with a URL trigger and the block action. What Brewless adds is that the list is there from the first deploy, that it is put back when it goes missing, and that the requests it refuses are counted apart from the ones your container answered. How the rest of the pull zone is set up is in putting bunny.net in front of a Laravel app, and the full list of patterns is in the edge cache documentation.
In short
- Scanners ask every site for
/.env,/.git/configand/wp-login.php, and a Laravel app answers them with a 404. - Every guessed address is new to the edge cache, so each one reaches the container and keeps it awake for 15 minutes.
- A pull zone Brewless manages refuses a fixed list of such paths with a
403at the edge, and every deploy keeps that list in place. - The list holds only paths that are never yours:
/.well-known/,/blog/and a plain/index.phpalways reach your application. - What reaches the container and
brewless wakes productionshow what still gets through, with the refused requests counted apart.
Frequently asked questions
Is a request for /.env dangerous for a Laravel app?
Not when the app is set up as Laravel intends. The .env file sits one folder above public/, which is the only folder the web server serves, so the request gets a 404. On a serverless container the problem is the cost, since that 404 is made by a container that had to wake up for it.
Why does my Laravel site get requests for /wp-login.php when it does not run WordPress?
Scanners do not check what a site runs before they ask. They try the same list of paths on every hostname they find, and WordPress logins, leaked .env files and Git folders are on every such list.
Why does the edge cache not stop scanner requests?
A cache answers an address it has seen before. A scanner asks for addresses nobody asked before, such as /old/.env or /backup/wp-login.php, so each one is a miss and goes to the container.
Can Brewless block a path that my own application serves?
The list holds only hidden files of tools and the entrances of WordPress, phpMyAdmin, CGI and Joomla. A folder an application may well serve, such as /blog/, /cms/ or /site/, is not on it, and neither is /.well-known/.
How do I see how many scanner requests the edge refused?
On the page of an environment behind bunny.net, What reaches the container says how many requests the edge answered itself. Those are plain HTTP requests sent on to https and scanner addresses it refused, and they are left out of the list of addresses that reached the container.