Security #
The engine has three security-relevant surfaces: the RESP listener, the Raft transport, and the optional admin HTTP servers. They share one credential and one certificate.
Transport encryption (TLS) #
./bin/IceFireDB --tls-cert ./server.crt --tls-key ./server.key -a 0.0.0.0:11001 -d /var/lib/icefiredb
- Both flags are required together — providing one without the other is a startup error.
- TLS is applied to the single listening socket. RESP clients and the Raft transport both arrive on it, and the server decides which is which by sniffing the first bytes. There is no second port.
- The value of
--advertisemust therefore be the TLS address peers and clients use. - Clients must speak TLS too:
redis-cli --tls --cacert ./ca.crt -h host -p 11001, or the equivalent client option (go-redis:TLSConfig, Pythonredis.Redis(ssl=True), Nodetls: {}). - The certificate needs a
DNS:SAN for the name clients use; the server copies the first DNS SAN into itstls.Config.ServerNamefor outbound connections. - No client certificates.
tls.Configis built withCertificatesonly, so there is no mTLS and no client identity. Peers authenticate with the shared token, not a certificate.
Cluster authorization #
export ICEFIREDB_AUTH='openssl rand -hex 32' # preferred: not visible in the process list
./bin/IceFireDB -a 0.0.0.0:11001 -d /var/lib/icefiredb
# or
./bin/IceFireDB --auth '<token>' -a 0.0.0.0:11001 -d /var/lib/icefiredb
What it does:
- A client must send
AUTH <token>before any other command. A wrong token answers-unauthorized. - So the first command on a connection has to be
AUTH. Every mainstream client library does this automatically when you configure a password (redis-cli -a, go-redisPassword, Pythonpassword=, Nodepassword:); a hand-rolled client that sends a command first will not get a clean error reply in the current build (see Known gaps). - Nodes use the same token to authenticate to each other when joining a cluster, reading the log index, and transferring leadership. Every node must share the token, and changing it on one node breaks the cluster.
- It is a single shared secret with no notion of users, roles or per-command permissions. There is no
ACL subsystem in this engine today: whoever holds the token can write, flush (
FLUSHALL), change cluster membership (RAFT SERVER ADD|REMOVE) and shut the process down (SHUTDOWN).
What it does not do:
- No rate limiting, no lockout, no token rotation, no per-key authorization.
- No audit log of who ran what (the
MONITOR-style observer is internal and does not exposeraft/auth/clustercommands). - It does not encrypt traffic — pair it with
--tls-cert/--tls-keyon any network you do not own.
Admin HTTP servers #
| Endpoint group | Flag | Default bind | Auth |
|---|---|---|---|
/healthz, /readyz, /metrics | --metrics | 127.0.0.1:11002 | none |
pprof (/debug/pprof/*) | --pprof | 127.0.0.1:26063 | none |
Both are off by default and bound to loopback precisely because they carry no authentication.
/metrics and /debug/pprof leak operational detail and block or allocate memory under load; keep
them on a private interface, a sidecar, or behind a reverse proxy that enforces identity.
Recommended baseline #
ICEFIREDB_AUTH="$(cat /run/secrets/icefiredb-auth)" \
./bin/IceFireDB \
--tls-cert /etc/icefiredb/tls/server.crt --tls-key /etc/icefiredb/tls/server.key \
-a 0.0.0.0:11001 --advertise db1.internal:11001 \
-d /var/lib/icefiredb \
--metrics --metrics-addr 127.0.0.1:11002 \
--storage-backend goleveldb
- Never expose the RESP port without TLS unless it is only reachable over a private network.
- Keep the token in
ICEFIREDB_AUTHor a.envfile (the binary loadsgodotenvat startup), never in a shell history or a unit file that is world-readable. - Leave
--metrics/--pprofon loopback; scrape them from the same host. - Treat
FLUSHALL,RAFT SERVER REMOVEandSHUTDOWNas root-equivalent operations, because they are. - Run the process as an unprivileged user that owns the data directory;
-dneeds write access only to that tree.
Toolchain and known vulnerabilities #
The dependency set is checked two ways: GitHub Dependabot alerts (anything touching a module in
go.mod) and govulncheck . (only vulnerabilities reachable from the code that is actually built).
Only the second describes risk, and the current accepted set is two entries, both on the libp2p path:
| ID | Module | Why it is not fixed | When it is reachable |
|---|---|---|---|
GO-2026-4479 | github.com/pion/dtls/[email protected] | No fixed v2 release exists; kubo, boxo, ipfs-lite and the IceFireDB forks all still require it | libp2p WebRTC transport, i.e. only with a decentralized backend (crdt, ipfs, ipfs-log, ipfs-synckv) |
GO-2024-3218 | github.com/libp2p/[email protected] | The fix needs kad-dht >= 0.40, which changed dht.New/dualdht.New signatures and breaks the same upstream set | Same libp2p/DHT path |
Practically: the GA backends (goleveldb, hybriddb) never enter that code at runtime, and the
mitigation is network exposure — keep the libp2p port of a decentralized backend off untrusted
networks. The full record, with the condition under which each entry can be closed, is in the engine’s
SECURITY.md; re-check with govulncheck . after any coordinated upgrade of kubo, ipfs-lite and
the IceFireDB forks.
Known gaps #
- No per-user ACLs (tracked as future work, not implemented in this tree).
- No token rotation protocol: rotating the token means a coordinated restart.
- No protection against a malicious peer that already holds the token — cluster membership is trust-on-first-use plus the shared secret.
- A command sent before
AUTH(or after a failedAUTH) is not answered with an error reply in the current build: the dispatcher leaves the response slot empty for unauthenticated commands. SendAUTHfirst, as every client library does, and treat the token as a connect-time credential rather than something you can prompt for mid-connection.