Hosting your own server also means being your own night watchman. We kitted ours out in a single day in April, and were rather pleased with ourselves. Then an outage in July showed us what we had forgotten: a watchman locked inside the building he guards cannot warn anyone when the door is jammed.
Update of 28 November 2026.
The security audit of 23 November tightened the watch. The sixteen Gatus probes now send their alerts to the phone, which they did not do before. A health check verifies every service and every container, the system logs are kept for 90 days, and the kernel audit log follows fifteen rules. The backups cover all the databases, a copy leaves every day for a workstation at the office, and a full restore was tested there on 24 November. Since that day, every deliberate change we make on the server has been entered in a register, and the morning watch now flags only the discrepancies that nobody has declared. The same audit also stripped our deployment pipeline of its privileges (see the article on the forge).
The server also watches over the connected Cube. When the Cube stays silent for more than fifteen minutes, an alert goes to the phone and is repeated every hour. That delay drops to three minutes when the silence follows a sign of attack, such as a power cut or a detection (see The Cube decides on its own). The main lesson from July, however, is still outstanding: no probe yet monitors the server from the outside. The indicators that would let us track a service over time are described in Making a connected device last, and what becomes of a device when the service behind it stops, in an article of its own.
The problem, and what is available
A server exposed to the Internet receives automated connection attempts all the time, and it can also fail all by itself, with nobody’s help. Watching over it therefore covers two different jobs: protecting yourself, and noticing that something is wrong.
For the second one, monitoring, the most useful vocabulary we know comes from Google’s book on running systems. It distinguishes “white-box” monitoring, based on what the system says about itself, from “black-box” monitoring, which tests the behaviour visible from the outside, as a user would see it. Keep this distinction in mind, because it comes back further down, and not to our advantage.
The large hosting providers offer all of this as a managed service. We had another constraint, written in our release notes: to build this workstream, which the project calls “fortress”, with a “strict preference for French / European tools”, open-source and hosted on our own server.
What we installed on 26 April
- CrowdSec, a collaborative firewall. It reads the server’s logs, recognises attack scenarios in them and blocks the offending addresses. It also draws on a list of addresses reported by other installations, as its documentation explains.
- AIDE, an integrity checker. It hashes the system’s files, then compares the current state against that baseline every day, so that a file modified without our knowledge shows up.
- Lynis, a weekly audit that reviews the configuration and returns a list of recommendations.
- Gatus, probes that query about twenty endpoints on the server at regular intervals and flag those that no longer respond. Its configuration is a text file, which can therefore be kept under version control.
- ntfy, a service that pushes notifications to the phone. We started with the public service, then hosted it ourselves within the hour, to stay on European hosting that we control.
To these we added a honeypot, that is, a fake service meant to keep the curious busy, and a monitor for scheduled tasks. At the end of the first session, our log recorded 966 active blocking decisions in CrowdSec, two hours after it went live. The figure impressed us at the time, but we did not separate what came from our own logs from what came from the shared list, so it should not be read as 966 attacks against us.
The July outage
On the evening of 8 July, the server rebooted, probably after a kernel security update. The containers came back by themselves, but not the front-end web server, the one through which all our sites pass. It was no longer set to start at boot. It had been running for weeks without anyone noticing that a reboot would not bring it back. We still do not know when or why that setting was lost.
The site, the forge, the sign-in portal and everything else stayed unreachable for about 70 hours. No alert went out. We discovered the outage on 11 July, by hand, while looking for a link, and getting everything running again took less than half an hour once the cause was understood.
Our incident report explains the silence in these words: “the monitoring watches from inside the thing it is watching”. The probes and the notifications ran on the same server, behind the same front end. When it went quiet, they went quiet with it. We had plenty of white box, and no black box worthy of the name.
What the outage taught us
- An alert must be able to go out when everything is down. Useful monitoring looks from somewhere other than the thing it monitors. It is obvious once written down, and yet we had missed it.
- A service that is running is not a service that will come back up. Only a reboot proves it. We checked the same day that no other essential service was in the same situation, then decided to reboot deliberately, on a chosen date, rather than wait for the next surprise.
- Two vantage points are better than one for diagnosis. During the outage, a browser was receiving well-formed errors even though nothing was listening on the server any more: an intermediary on the workstation was answering in its place. A simple connection test from another network told the truth.
We also ruled out two remedies. A second, high-availability front end would have been out of proportion for a demonstrator’s single server. Moving the front end into a container would have made the whole set-up uniform, at the cost of a risky migration for little gain.
November: a watch that writes every morning
On 14 November, we added what day-to-day use lacked most: a daily check-in. Every morning a script takes stock of the server and emails the result: pending updates, certificates nearing expiry, a summary of the integrity check, backups, and advisories from CERT-FR (in French) matched against the installed software. It fixes nothing; it reports. The principle is to compare the day’s state against a baseline and to flag only the differences. That avoids the three-page report that nobody reads any more after a week. If there is something to deal with, a notification also goes to the phone, deliberately with no detail at all.
The lesson from July is built into it: reboots are now scheduled, and an automatic check runs a few minutes later to verify that everything has come back. Incidentally, the first version of the watch had a rather ironic flaw: it recorded the differences but did not count them, and so did not warn anyone. We fixed it two days later, the day we added Netdata to track system metrics second by second, behind our sign-in desk, which is covered in the article on single sign-on.
What we did not do
The April plan was more ambitious: a security event correlation tool, a vulnerability scanner and a threat intelligence platform. We judged the first two too heavy or too poorly maintained for a single server, and the third required a second machine. We deployed none of them, and we do not think that is a gap at this stage: better a few tools whose output we actually read.
Where we stand.
CrowdSec, AIDE, Lynis, Gatus, ntfy, the daily watch and Netdata are in service. The backups actually date from November: an audit on 6 November put them back in place and tested a restore, and a copy has been sent off the server since the 14th. Since 16 November, we have been running a second server along the same lines, with encrypted cross-backups. However, the most important action to come out of the outage, monitoring the main server from the outside, is not marked as closed in any of our documents; we therefore consider it open. The choice of cold storage for the backups has yet to be made.
Sources
- Google, Site Reliability Engineering, the chapter “Monitoring Distributed Systems”: the distinction between black-box and white-box monitoring.
- CrowdSec and its documentation: log analysis, scenarios and community list.
- AIDE, Advanced Intrusion Detection Environment, file integrity checking.
- Lynis, a security auditing tool for Unix systems.
- Gatus, availability probes and status page.
- ntfy, push notifications, usable as a public service or self-hosted.
- Netdata, real-time monitoring of system metrics.
- CERT-FR, security alerts and advisories from the French government centre (in French).
A question, an objection? contact@ops-devices.eu, or on Bluesky.