Scanners looking for your .env now get a 404 from the edge
Requests for paths like /.env and /.git/config now get a 404 from Traefik on every app, before they reach your code. It only covers known paths, so it is not a WAF.
Bots scan every website for files like /.env and /.git/config, hoping to find a password someone forgot about. As of today, PicoPaaS answers those requests itself. Traefik returns a 404 before the request reaches your app. POST, PUT and DELETE to those paths get a 501 and don't reach the app either.
What changed
This is live on every app, on by default, including custom domains. It started on Kaisen previews, where a guard inside the runtime protects static sites. That guard stays. The new block covers every app, whatever it runs.
The list comes from the dotfile entries of the OWASP Core Rule Set restricted-files.data (Apache-2.0), pinned at v4.30.0, plus our own additions like id_rsa and *.tfstate. We don't use the whole CRS list: its other entries include config.json and /package.json, which real apps serve. We also skip a few generic folder names like .cache/ and .config/.
To keep it current, a weekly job checks for new CRS releases, regenerates the rule on a branch, runs the path tests and opens an issue. A person reviews it before it ships.
Opting out, and what it costs
If your app really serves such paths, turn on "Serve sensitive paths" in its settings. Forgejo's template does, because it shows repository files like .env.
There is no new service, memory or money. The check costs about 16 microseconds per request, measured on a laptop.
The limit
This only stops known paths. A secret at a path that isn't on the list is still served, so don't put secrets in files your app serves. It is not a WAF and it doesn't stop attacks in general. It just closes the most common door scanners try first.
curl -si https://your-app.example/.env # 404