Redis Config Audit Guide

A Redis config audit is a static review of a Redis server’s configuration file — redis.conf — checked line by line against known-good practice, without connecting to the server. The file is small, usually a few dozen settings, but it decides who can connect without a password, which network interfaces the server listens on, whether a crash loses your data, and whether you can recover it at all. This guide walks through the settings that matter, the persistence trade-off hiding in two directives, requirepass vs ACL users, and the mistakes that show up again and again — then shows you how to run the same audit yourself with the Redis Config Auditor.

What a Redis config audit actually checks

A config audit reads the file the way the server reads it: as a list of settings, one per line. Redis uses a flat list of directive value lines in redis.conf — no sections, no nesting — with # comments and quoted values. Because a setting that is simply absent leaves the compiled-in default in force, an audit checks absence as carefully as presence: the line you never wrote can be the one that matters most.

The checks fall into four families. Authentication and access: who can connect, from where, and with what password rules. Transport security: whether connections are encrypted, and with what. Durability and recovery: what survives a crash, and whether you can replay to a point in time. And operational basics: logging, connection limits and memory — the settings whose absence is only noticed during an incident. The Redis Config Auditor runs these rules and scores the result from 0 to 100; the same audit family covers MySQL/Postgres and Apache configs.

The settings that decide your security posture

Five settings do most of the work. protected-mode no turns off the guard that keeps a passwordless server on localhost — combined with bind 0.0.0.0, the server listens on every interface and anyone who can reach the port can run any command, including FLUSHALL and CONFIG. A missing requirepass means there is no authentication at all, and a user line with nopass and +@all is the same hole wearing a newer syntax: a passwordless superuser. And unrenamed dangerous commands — FLUSHALL, FLUSHDB, CONFIG, EVAL, DEBUG — stay available to every authenticated client, including the ones that should only read data.

Then come the quieter ones. No maxmemory at all means the server grows until the machine runs out of memory, and a maxmemory-policy of noeviction — the default when no policy is set — makes writes fail instead of evicting. appendonly no with no save schedule means a restart starts from an empty dataset. No tls-port means every credential travels in cleartext. And a replicaof with no masterauth means the replica cannot authenticate to its primary at all. None of these is exotic, and all of them are missing from a surprising share of production configs — usually not by decision, but because the config was copied from a tutorial years ago and nobody ever read it end to end. That reading is the audit.Redis Config Auditor showing the broken demo config at score 24 of 100, Poor, with 25 findings

The persistence trade-off: RDB snapshots vs AOF

Redis offers two kinds of durability, and the config picks between them. RDB snapshots — the save schedule — write the whole dataset to disk every so often: save 3600 1 means snapshot after an hour if at least one key changed. A disabled schedule (save "") means no snapshots at all, so a restart starts from nothing. The append-only file — appendonly yes — logs every write instead, so the dataset can be replayed after a crash, and appendfsync decides how often the log reaches disk.

appendfsync is where the trade-off lives. always flushes on every write — the most durable and the slowest. everysec, the default, flushes once a second: a crash can lose up to a second of writes, which most workloads accept. no lets the operating system decide, which can mean 30 seconds of writes gone. The usual answer is appendonly yes with appendfsync everysec plus a save schedule for fast restarts — and rdbchecksum yes, so a corrupted snapshot is rejected instead of loaded.

requirepass vs ACL users (Redis 6+)

requirepass is the original Redis authentication: one shared password every client sends before running a command. It is simple and it is all-or-nothing — every client that knows it can run every command. Redis 6 added ACL users, defined with user lines: each user gets its own password, key patterns (~cache:*), channels, and a command set — +@all for everything, +@read for read-only, or a hand-picked list.

Use both, in that order. Set a long requirepass first — it is the baseline, and older clients and tooling expect it — then add ACL users for the limits that matter: a read-only user for the dashboard, a write-only user for the ingester, a user that can only touch its own key prefix. The trap is the combination the auditor flags as an error: a user line with nopass and +@all is a passwordless superuser, and it undoes every other access rule in the file. Note the password itself is never echoed by the auditor — only its length, masked.

The five mistakes the auditor flags most

Across real-world configs, the same five findings recur. First, protected-mode no with bind 0.0.0.0 — the classic unauthenticated Redis on the public internet, the one behind the ransomware waves that wipe databases and leave a ransom note. Second, no requirepass at all — the same hole, one line earlier. Third, dangerous commands left at their default names: FLUSHALL one typo away from deleting the dataset. Fourth, no persistence: appendonly no and save "", so a restart is a data loss event. Fifth, maxmemory never set, so the server grows until the operating system kills it — usually at the worst moment.

The demo config below manages most of them in 18 lines, plus a few extras: a passwordless default user, replication without authentication, module commands enabled, keyspace notifications leaking key activity, and the slow log disabled. The auditor scores it 24 out of 100, band Poor. Its hardened twin — same shape, every finding fixed — scores 100.

What a static audit cannot see — and auditing yours in five minutes

A static audit reads text, and its limits are the limits of text. It cannot see the values the running server actually uses — a setting in the file can be overridden at startup, so check CONFIG GET on the server for the live truth. It cannot see total RAM, so a maxmemory it calls absent is a fact, but whether the limit you pick is right depends on the box. It cannot see real network exposure — a public bind behind a firewall that only allows localhost is a different risk from the same line on a public server. It cannot see replication lag, the client list, or what is stored in the keyspace. And it cannot follow include directives, so an included file can undo a hardening setting the audit just praised.

To audit yours in five minutes: copy the config (or the one file you care about), paste it into the Redis Config Auditor — it runs entirely in your browser, and the config is never uploaded, which matters because a config names hosts, users and paths you do not publish. Fix the errors first (protected-mode off, a public bind with no password, no requirepass, a passwordless user), then the warnings, then work through the infos as a list of defaults worth setting explicitly. Export the findings CSV if you want the checklist in a ticket. Then check the live values on the server — CONFIG GET protected-mode and friends — and audit every file your main config includes, because a clean redis.conf can include a very broken one.

The broken demo config

# Demo Redis config — deliberately broken. Do not deploy.
include /etc/redis/extra.conf

port 6379
bind 0.0.0.0
protected-mode no
user default on nopass ~* &* +@all
maxmemory 256mb
appendonly no
save ""
rdbchecksum no
maxclients 20000
timeout 0
loglevel debug
replicaof 10.0.0.5 6379
enable-module-command yes
slowlog-log-slower-than -1
notify-keyspace-events AKE

Sources

Frequently asked questions

Does the audit need the Redis server running?

No. The audit is static: it reads the config file you paste, nothing else, and the server does not need to be running — or even reachable. But the file is not always the truth: a setting can be overridden at startup, so confirm the live values on the server with CONFIG GET after the audit.

My Redis only listens on localhost — do I still need a password?

Yes. protected-mode is a guard, not a guarantee: it only blocks non-loopback connections, and it silently stops protecting you the moment a bind or a network change exposes the port. A requirepass costs nothing on localhost and closes the hole that a misconfigured bind or a container network would open. Set a long one, and keep the bind on 127.0.0.1 as well — defence in depth, not either-or.

A finding is not a vulnerability — how do I prioritise?

Fix the errors first: protected-mode off, a public bind with no password, no requirepass, a passwordless user — those are real exposure. Then the warnings, which are usually one-line fixes. Treat the infos as a list of defaults worth setting explicitly. And weigh the context: bind 0.0.0.0 behind a firewall that only allows localhost is a different risk from the same line on a public server. The score is a checklist, not a verdict.