The Pitch That Started It
Some services scan your websites around the clock. They sell it with lines like “24/7 website testing powered by AI and red-team experts.” It is a good pitch. What they really do is look at your sites the way an attacker would: from the outside, every day. Then they tell you what changed.
I already had half of that. Farore, one of my small cloud nodes, runs a sentry. It scans my public IPs for open ports and checks SSH policy. It makes sure that nothing can bypass my CDN and reach the origin servers directly. It also probes a few sites for leaked source files. It has been quietly useful for weeks.
But then I asked “is it checking every public address I have?”. The honest answer was no. I kept its list of websites by hand. And lists that you keep by hand drift.
So I built the other half: a gentle external web scanner. It runs from Farore and covers everything public. It runs daily on its own, or from my terminal when I want.
Rule Zero: Be Gentle, Be Honest
It is legitimate to scan your own infrastructure. But a careless scan can still hurt. A heavy scan can trip the defenses of your own CDN, fill logs or slow a small server. The scanner follows strict manners:
- Read-only. It only requests pages. No exploit payloads, no password guessing, no fuzzing, no form submissions.
- Slow. One request at a time, with a pause between them. A full scan of about 20 hosts takes ten minutes.
- Honest. Its User-Agent says what it is and gives a contact address. Anyone who reads the logs knows who knocked.
- Small. The daily scan sends a handful of requests per host. The heavier “look for leaked files” probe runs only once a week.
Step 1: Inventory Beats Intuition
Before I scanned anything, I needed the real list of public names, not the list in my head. I pulled every DNS record from every zone I own through the API of the DNS provider. Then I compared it with what the sentry checked.
The sentry was missing six public hostnames. Two were private apps behind single sign-on. Three belonged to the web side of my mail server. I had forgotten the last one entirely.
That forgotten hostname was the most interesting finding of the whole project. It was a public hostname that routed into a CDN tunnel to a local web service. (A CDN tunnel is a secure outbound connection from my server to the CDN.) It was a leftover from an old setup.
The route had a bad configuration, so it returned an error to every visitor. Its neighbour on the same tunnel sat behind an access login. This hostname had no login in front of it.
I checked what was behind it. It was only my public blog, so nothing was really exposed. But it was an unguarded door into my infrastructure, and it stayed harmless only by accident.
During that cleanup, I found a second old tunnel. I used it for SSH before I moved to a private mesh network. I deleted both DNS records (and kept backups). Then I removed the tunnels and their access applications in the dashboard.
Lesson one, before I wrote a single check: inventory first. Forgotten entrances are the most common real-world finding. No clever test finds a door that you do not test.
Step 2: What It Checks
For every public host, the daily scan does these checks:
| Check | What it looks for |
|---|---|
| DNS | does it resolve; is it behind the CDN or exposing the origin IP directly |
| TLS | certificate expiry and hostname match; whether old TLS 1.0 / 1.1 are still accepted |
| http → https | plain http:// should redirect, not serve content |
| Security headers | HSTS, nosniff, clickjacking protection, Referrer-Policy |
| Version leaks | Server / X-Powered-By headers that reveal software versions |
| Cookies | session cookies marked Secure, HttpOnly, SameSite |
| Login gates | private apps must answer an unauthenticated visitor with a login or redirect, never content |
| App-specific probes | the media server doesn’t list user names; the notification API refuses requests without a token; the mail admin interface isn’t reachable; the mail security policy is served |
| Open redirects | login pages don’t bounce visitors to an outside site via a ?rd= style parameter |
| CORS / TRACE | the site doesn’t reflect arbitrary origins with credentials; TRACE is off |
| Certificate transparency | every certificate ever issued for my domains is public. Names that appear there and still resolve, but aren’t in my inventory, get flagged |
Each host has a “kind” in the inventory: public, redirect, gated, behind an access login, or mail web. So the scanner knows what correct looks like for each one. A login page is a pass for a private app. For a public app, it is a red flag.
Once a week, the exposure probe adds about 45 classic leak paths per host. Examples are .git/HEAD, .env, backup archives, SQL dumps, SQLite databases and phpinfo. Others are server-status, API docs, debug endpoints, cloud credential files and so on.
Avoiding the false alarm trap
Modern single-page sites answer 200 for every path. So a naive scanner would report /.env as “exposed” on all of them. I use two defences:
- A soft-404 baseline. Before it probes, the scanner requests a random path that cannot exist. If that returns
200, it remembers the “not found” page of the site and ignores identical answers. - Content signatures. A hit counts only if the response looks like the file.
.git/HEADmust start withref:..envmust containKEY=valuelines. A SQLite file must start with its magic bytes.
Step 3: The Bug That Would Have Hidden Everything
My first test run said that every site was fine on old TLS versions. I did not believe it, so I checked by hand. There I found the most important bug of the project.
By default, modern OpenSSL refuses to offer TLS 1.0 or 1.1 as a client. My scanner asked “will this server accept TLS 1.0?”. But my own tool refused to even try, so every server looked secure. A test that cannot fail is not a test.
The fix is one option. It lowers the security level of the client for this probe only:
openssl s_client -tls1 -cipher 'DEFAULT@SECLEVEL=0' -connect example.com:443 -servername example.com
With that option, the truth showed up at once: every site behind my CDN still accepted TLS 1.0 and 1.1. That is the default minimum of the CDN, and I had never changed it.
Lesson two: before you trust a clean result, test your detector against a known-bad case.
Step 4: The First Real Scan
The first full scan covered 21 hosts in about ten minutes. Two of them were the forgotten entrances, which I deleted right after. The recorded baseline looked like this:
- HIGH: 0. Every login gate held. None of the 45 leak paths was exposed anywhere. The media server did not list users. The notification API refused requests without authentication. The mail admin interface was out of reach. No login page redirected to outside sites.
- MEDIUM: 36. 32 were the TLS 1.0/1.1 findings. The other 4 were sites that served content over plain
http://and did not redirect. - LOW: a few. The mail web server showed its exact nginx version. Two hosts that serve only a small mail policy file had missing headers.
Most of the fixes were settings:
- Minimum TLS 1.2, once per zone in the CDN dashboard. That single setting covers the whole zone, so all 32 findings cleared at once.
server_tokens offon the nginx of the mail edge: one line.- “Always Use HTTPS” for the zone of the blog. This one fought back, and the story is worth telling.
The redirect that wouldn’t redirect
The CDN shows a warning next to “Always Use HTTPS”: enabling this while your origin also forces HTTPS can cause redirect loops. A month earlier, I moved my blog to a new domain. At that time, I set the origin on purpose to serve the site on plain port 80 without a redirect, to prevent that loop. So before I turned on the switch, I checked it from both ends:
- the origin answered
200on both ports, with no redirect to https, - I counted live connections inside the container of the web server. The CDN reaches the origin over port 443 for https visitors. In its “Full” mode, the CDN matches the scheme of the visitor. So a loop was not possible either way.
Then I turned the setting on, and plain http still served 200. Something in the zone overrode it. It took a few rounds in the dashboard before plain http finally redirected. I turned an old rule off, and I toggled the setting off and on again.
The scanner made each round a one-command check. It confirmed one hop to https and no loop. It also confirmed that my old domain still had its one-hop redirect. A search engine’s change-of-address process depends on that redirect.
On the way, I noticed one detail that made the risk smaller. The plain-http response already carried a one-year HSTS header. Any browser that visited over https once would upgrade by itself. So the real exposure was only the very first plain-http visit of a visitor. It was still worth closing.
Step 5: Alerts That Don’t Cry Wolf
A daily scanner is useful only if its notifications stay meaningful. I learned this one quickly.
- The first recorded run is a baseline. It sends one summary, not 40 separate “new finding” alerts.
- After that, only changes. A new HIGH or MEDIUM finding sends an alert at once. When a finding disappears, the scanner sends a “resolved” message. So each fix gets a small receipt.
- Group identical findings. My first “resolved” message listed the TLS finding 32 times, once per host. It is really one setting. So now identical findings collapse into one line: “TLS 1.0 still accepted: 16 hosts (…)”. The state underneath still tracks each host, so the resolved notices stay accurate.
- A weekly summary with the full counts.
Alerts go to my self-hosted notification server over the private mesh. So they still arrive when my home lab has a bad day.
Step 6: Run It Whenever I Want
The scanner runs on its own every morning. The full exposure probe runs every Sunday. From my laptop:
webscan # quick scan of everything, printed in my terminal
webscan --full # + the weekly leak-path probe
webscan --host example.com # one host
webscan --record # also update the stored state and send notifications
Manual runs are dry by default. They print and change nothing, so I can poke at a fix twenty times and my phone gets no alerts. That bit me once. I ran a full scan by hand and expected a report on my phone. Of course I got none. Good defaults sometimes surprise their author.
Why I Didn’t Automate the Fixes
For a short time, I thought about letting the scanner fix settings like the TLS minimum when they drift. Then I asked the obvious question: do they drift? They don’t. A setting for the whole zone changes only when a person or an API token changes it. Auto-remediation would need a new credential with power to change my CDN settings. That is one more key to protect, and it would fix a problem that does not happen by itself.
The daily scan already catches the real risks. Someone can turn a setting off, a new rule can override it, or a new hostname can show up. Here, detection was the right amount of automation.
Takeaways
- Inventory first. Pull the real list of public names from DNS and certificate-transparency logs. My best finding was a forgotten, unguarded entrance, not a clever vulnerability.
- Be gentle and honest: read-only, slow, a User-Agent that identifies you, and the heavy probe only weekly.
- Teach the scanner what “correct” means per host: public, redirect, behind a login, or behind an access gate.
- Defeat false positives with a soft-404 baseline and content signatures.
- Test the detector against a known-bad case. My TLS test could not fail until I fixed the settings of the client.
- Defaults matter. My CDN still accepted TLS 1.0 because I never changed its default.
- Before you turn on redirect switches, check the origin and the CDN-to-origin protocol. Then confirm that there is no loop.
- Design alerts for humans: a baseline once, alerts on change, a small celebration on resolution, and grouped duplicates.
- Automate detection everywhere. Automate remediation only where things really drift.