MirLabs / The blog / Security / Open source

Why I turned Sentinelle green

My security bundle was sending me too many alerts about nothing. Now it only really rings when a sensitive file has actually been served.

· Cyril Delage · 2 min read · Lire en français

Network cables plugged into a server
Photo: Taylor Vick on Unsplash

Sentinelle is the Symfony security bundle I run on all my sites, published as open source. It logs every request, spots the attempts (a .env, a .git, WordPress paths, injections), blocks the offending addresses and sends an email.

Too many alerts, no alert

Scanners hit every site, all day long. On one of my production sites, alert emails were climbing to about 200 a week. Nearly all of them told the same story: an address asks for /.env, gets a 404, gets blocked. Nothing happened.

At that rate, you stop reading alerts. And the day one of them really matters, it drowns among the others.

The only question that matters

An attempt is not a leak. What matters is the site's answer: if /.env returns 404, nothing went out; if it returns 200, you must act right away.

So version 0.4 looks at the responses, not only the requests. A sensitive file served successfully (.env, .git, keys, database backups, logs, debug tools) or a secret showing up in a response: the address is blocked for 30 days and a red alert goes out at once, high priority, with what to do now.

The green

Every alert now shows what the address did over the last 48 hours. When none of its requests to a sensitive path succeeded, the alert says so in a green banner. You know in one second you can close the email.

And addresses already blocked whose every attempt failed no longer send any email at all. They are counted in a daily summary, which only goes out if something happened. Those who prefer the old behaviour get it back with one line of configuration (quiet_when_blocked: false).

Update, 27 October: that setting did not actually apply, because of a bug fixed in version 0.6. I explain it in One alert per bot is zero alerts.

What I take from it

An alert must answer a single question: do I need to act? Green: no. Red: yes, now. Everything else can wait for the morning summary.

The first line of defence is still the web server: on my sites, a sensitive file dropped by mistake into the public folder is never served. Sentinelle is there for the day that line gives way, and to say so clearly.

A project like this one?AI integration, a site to make readable by assistants, security: let's talk.
Contact me

Read next