Security

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 --advertise must 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, Python redis.Redis(ssl=True), Node tls: {}).
  • The certificate needs a DNS: SAN for the name clients use; the server copies the first DNS SAN into its tls.Config.ServerName for outbound connections.
  • No client certificates. tls.Config is built with Certificates only, 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-redis Password, Python password=, Node password:); 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 expose raft/auth/cluster commands).
  • It does not encrypt traffic — pair it with --tls-cert/--tls-key on any network you do not own.

Admin HTTP servers #

Endpoint groupFlagDefault bindAuth
/healthz, /readyz, /metrics--metrics127.0.0.1:11002none
pprof (/debug/pprof/*)--pprof127.0.0.1:26063none

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.

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
  1. Never expose the RESP port without TLS unless it is only reachable over a private network.
  2. Keep the token in ICEFIREDB_AUTH or a .env file (the binary loads godotenv at startup), never in a shell history or a unit file that is world-readable.
  3. Leave --metrics/--pprof on loopback; scrape them from the same host.
  4. Treat FLUSHALL, RAFT SERVER REMOVE and SHUTDOWN as root-equivalent operations, because they are.
  5. Run the process as an unprivileged user that owns the data directory; -d needs 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:

IDModuleWhy it is not fixedWhen it is reachable
GO-2026-4479github.com/pion/dtls/[email protected]No fixed v2 release exists; kubo, boxo, ipfs-lite and the IceFireDB forks all still require itlibp2p WebRTC transport, i.e. only with a decentralized backend (crdt, ipfs, ipfs-log, ipfs-synckv)
GO-2024-3218github.com/libp2p/[email protected]The fix needs kad-dht >= 0.40, which changed dht.New/dualdht.New signatures and breaks the same upstream setSame 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 failed AUTH) is not answered with an error reply in the current build: the dispatcher leaves the response slot empty for unauthenticated commands. Send AUTH first, as every client library does, and treat the token as a connect-time credential rather than something you can prompt for mid-connection.