Tier 5: Stay Current
Hardened releases, OS patching and containers.
Goal: benefit from hardening done in Sonic itself, and keep the rest of the server patched.
5.1 Use hardened releases
Besides fixing bugs, new releases can turn off features that are risky to expose. The fewer features an attacker can reach, the fewer places a bug can hide.
For example, starting with v2.2.5, the node rejects custom JavaScript tracers (code supplied inside an RPC request) unless you turn them on. Built-in tracers (callTracer, prestateTracer, etc.) keep working.
To confirm your node rejects custom JavaScript tracers (run it against the node directly, on 127.0.0.1):
curl -s -H 'content-type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"debug_traceCall","params":[{"to":"0x0000000000000000000000000000000000000000"},"latest",{"tracer":"{result:function(){return 1},fault:function(){}}"}]}' \
http://127.0.0.1:18545✅ Expected: an "error" saying custom tracer is not permitted.
❌ A "result" of 1 means custom tracers are on. Upgrade, or turn them off (Tier 1.2).
⚠️ If the error says the method doesn't exist or isn't available, debug is turned off on this node, and the test tells you nothing. Run it on a node that has debug enabled.
Static builds. Check how your binary is built:
file /usr/local/bin/sonicdIf it says statically linked or static-pie linked, re-run Tier 2 step 2.0. The ExecPaths= line will shrink to just the binary.
5.2 Keep the operating system patched
Many attacks chain a bug in the node with a bug in the operating system to gain more control.
Run a supported LTS release (recommended: Ubuntu 24.04 LTS, see Before you start step 3), and plan the move to the next one before standard support for yours ends. Enable automatic security updates:
Schedule regular reboots so kernel updates actually take effect.
Validators: a reboot takes the validator offline until the node is back in sync (with a named pipe, until someone sends the password). Plan reboots like upgrades, and check the log afterwards (Tier 2, test (a)).
5.3 If you run the node in containers
Containers aren't a security boundary by default, and the systemd protections from Tier 2 don't apply inside them. If you use containers, apply the same ideas:
Use a minimal image containing only the
sonicdbinary (and its libraries), with no shell, no package manager, no download tools. Don't use the repository's experimentalDockerfileimage in production.Run as a non-root user, with a read-only filesystem except the data volume.
Drop all privileges and block privilege gain.
Make sure nothing can be run from the data folder (the container version of Tier 2A): put the data folder on its own disk, mounted with
noexec,nosuid,nodevin/etc/fstab. The container inherits these options.
Example:
Inside the container, the node must listen on
0.0.0.0, or Docker can't forward traffic to it. Control who can reach it with the-paddress instead:-p 127.0.0.1:18545:18545makes RPC reachable only from the host itself.Published ports bypass
ufw. Docker edits the firewall directly, so a port published with-p 18545:18545is open to the world whateverufwsays. Publish RPC on127.0.0.1or a private IP, and rely on your cloud firewall too.Validators: no RPC flags, and publish only the peer-to-peer port (
-p 5050:5050 -p 5050:5050/udp).
Block the private network (the container version of Tier 2B). Container networks can reach your private network by default. Docker reserves a firewall chain called DOCKER-USER for your own rules:
If you use your own Docker network (e.g. with Docker Compose), replace
docker0with that network's interface (ip link | grep br-).These rules disappear on reboot. Put the commands in a small service like
sonic-guard(Tier 3.2), withAfter=docker.service.Also apply the Tier 4.3 network rules in your cloud firewall.
5.4 Rebuild instead of repair
Keep a documented, repeatable way to build a node server from scratch (image, configuration management, scripts). After any suspected compromise, and periodically anyway, rebuild rather than patching a server you can't fully trust.
Validators: the rebuilt server uses the same signing key, so stop the old one for good before the new one starts. Never run both, not even for a minute: that's double-signing. After a suspected compromise, follow the validator steps in Tier 3.4 first.
✅ Tier 5 checklist
Last updated

