Operations Runbook - CyberMind-FR/secubox-deb GitHub Wiki
What it is for. A field guide drawn from recent incidents. Each entry reads symptom, cause, check, fix. Version numbers say from which package version the cause is fixed in the source; on an older box, upgrade the package first (see Operations-APT-Repository).
| # | Symptom | Section |
|---|---|---|
| 1 | disk full | Disk full |
| 2 | timer with no next run | Timers |
| 3 | new routes return 404 / aggregator restart | Aggregator |
| 4 | WAF no longer writes logs | sbxwaf logs |
| 5 | WAF shown "out of service" while it runs | WAF state |
| 6 | valid certificates shown expired | Certificates |
| 7 | network stats always "stale" | Network stats |
| 8 | module restart loop, stale socket | Sockets |
| 9 | nginx will not start | nginx :80 |
-
Symptom. Services fail to write,
dpkgcannot write its own state file, packages stay unconfigured, UIs return 5xx. Seen on a build host and on an undersizedfullimage (the build sizes are now 8G forisp, 12G forfull). - Cause. On a development host: accumulated agent worktrees and build output. On a box: a small root filesystem and data on the wrong volume (media and caches belong on the data disk).
-
Check.
df -h, thendu -xh --max-depth=1 /on the full volume. For worktrees:scripts/agent-worktree.sh list --verbose. -
Fix. Remove finished worktrees with
scripts/agent-worktree.sh clean <issue>(it refuses a dirty worktree or a branch whose pull request is not merged, unless--force). Before deleting a worktree by hand, look at what git ignores (git status --ignored): an unanchored.gitignorepattern can hide real source files. Clean the apt cache withapt-get clean. Never free space by deleting under/etc/secuboxor/var/lib/secubox.
-
Symptom. A job never runs;
systemctl list-timers --allshowsn/ain the NEXT column for a SecuBox timer. -
Cause. The timer unit is not active (not enabled, stopped by a package upgrade, or failed), or a timer driven only by
OnUnitActiveSec=whose service never ran has nothing to count from. Package postinst scripts must restart a unit that the upgrade stopped. -
Check.
systemctl list-timers --all,systemctl status <name>.timer, and the effective cadence withsystemctl cat <name>.timer(the cadence drop-ins10-cadence.confcome fromsecubox-core; they first resetOnUnitActiveSec=then set the new interval, with aRandomizedDelaySec=). -
Fix.
systemctl daemon-reloadafter any drop-in change, thensystemctl enable --now <name>.timer. A package that leaves its timer stopped after an upgrade has a postinst bug: report it with the package version.
-
Symptom. A new or changed route of a module answers 404, or a whole set of
/api/v1/<module>/routes answers 502. -
Cause.
secubox-aggregatorimports the code of every aggregated module at startup (about 110 modules in one process, no module runs its own daemon). A module's new code is only taken into account after the aggregator restarts. The cold start takes time and the sockets are unavailable meanwhile. -
Check.
systemctl is-active secubox-aggregator;journalctl -u secubox-aggregatorfor import errors. A module on its own socket is independent of the aggregator. -
Fix.
systemctl restart secubox-aggregator. Expect a cut of about 40 seconds for every aggregated module; plan it, and never restart manysecubox-*daemons in parallel. The watchdog allows a startup grace of 480 s before its own auto-heal, so do not restart it again while it is still loading.
-
Symptom.
/var/log/secubox/waf/waf-threats.logstops growing; WAF panels go empty although traffic flows. -
Cause. The log directory lost its owner or mode. It must be
secubox-waf:secubox-waf, mode0750; the shared parent/var/log/secuboxstays0755(setting it to0750breaks traversal for the other services). The cache directory/var/cache/secubox/wafhas the same owner. -
Check.
ls -ld /var/log/secubox /var/log/secubox/waf /var/cache/secubox/waf;journalctl -u secubox-waf-ng. -
Fix. Reinstall or upgrade
secubox-waf-ng(its postinst recreates the directories with the right owner and mode; the unit prepares the cache itself since 1.27.3), thensystemctl restart secubox-waf-ng. Do not use a hand-written drop-in: a corrupted one (backticks in an unquoted heredoc) once broke the unit.
-
Symptom. The global health (portal, banner) says the WAF is out of service while
sbxwafis running. -
Cause. The health check still looked at the old mitmproxy container. Since
secubox-metrics1.19.1 (#2391) the state followssecubox-waf-ng(service active and port 8085 answering). -
Check.
systemctl is-active secubox-waf-ngandss -ltnfor port 8085 on the loopback. -
Fix. Upgrade
secubox-metricsto 1.19.1 or later. If the service is really down,systemctl restart secubox-waf-ng(a restart, not a reload signal).
-
Symptom. The Certificates page lists valid certificates as
expired(minus 999 days). -
Cause. Files in
/data/haproxy/certswererootmode0600: the API runs assecuboxand could not read them, and an unreadable file counted as expired (#2383).secubox-certs1.2.8 now shows such a certificate asunknown("illisible"), andsecubox-haproxy1.10.3 writes the.pemas0640 haproxy:secubox, likecertsctl deploy. -
Check.
ls -l /data/haproxy/certs. -
Fix. Upgrade both packages, then make the existing files readable by the group (
chown haproxy:secubox,chmod 0640). A failed read is no longer cached, so the next scan picks them up.
- Symptom. "Live network" in the SOC and the Network tab of the Toolbox show "COLLECTOR STOPPED?" while the collector runs.
-
Cause. The staleness threshold was lower than the collector cadence. The collector timer
secubox-netstats.timerruns every 120 s plus up to 30 s of random delay.secubox-hub1.9.55 (#2388) sets the threshold to 360 s (two cadences plus a margin), tied to the cadence drop-in by a test. -
Check.
systemctl cat secubox-netstats.timer; compare the interval with the threshold. If you slow the cadence down, raise the threshold above two cadences. -
Fix. Upgrade
secubox-hubto 1.9.55 or later. If the collector is really stopped:systemctl status secubox-netstats.timer.
-
Symptom. A module restarts in a loop, with
Unable to check or remove stale UNIX socket: PermissionError(1)thenAddress already in use; its routes answer 502. Or many modules lose their socket at once after a restart. -
Cause.
/run/secuboxis shared by about 95 units and is sticky (1777,root:root): a process can only remove a file it owns, so a socket left by another user blocks the daemon. The opposite fault,RuntimeDirectory=secuboxin a unit, wipes the sockets of every neighbour on restart. -
Check.
ls -l /run/secubox. For the effective setting (nevergrep, comments produce false hits):systemctl show <unit> -p RuntimeDirectory -p RuntimeDirectoryPreserve --value. -
Fix. Every unit that binds a socket there carries
ExecStartPre=+/bin/rm -f /run/secubox/<module>.sock(the+runs it as root). Neverchownthe parent and never declareRuntimeDirectory=secubox. Rules: section 2 of the repository file RULES-CODE.md.
-
Symptom.
nginxfails withbind() to 0.0.0.0:80 failed (98: Address already in use), and every host vhost goes down with it. It can stay invisible for weeks because areloaddoes not rebind. -
Cause. On a SecuBox, HAProxy holds
0.0.0.0:80(and :443). Any host vhost withlisten 80prevents nginx from starting; the first real restart then fails. -
Check.
nginx -t, then search the enabled vhosts forlisten 80. Several nginx instances can also run inside containers: check the cgroup before killing a process. -
Fix. Make the vhost listen on its module port instead (the HAProxy to
sbxwafchain already routes there) and restart nginx. Traffic must go throughsbxwaf; do not bypass it by hand (only the declarativewaf_bypass = trueper vhost in/etc/secubox/haproxy.toml). See WAF.
Operations-APT-Repository · Operations-Release-Process · Troubleshooting · FAQ-Troubleshooting · WAF · Profils · Operations-Runbook-FR