TMAegis
More rules for redis

TMA-REDIS-RENAME-FLUSH

Ensure FLUSHALL and FLUSHDB are renamed or blocked

MediumLevel 2Automatedredis

Description

FLUSHALL/FLUSHDB destroy all data in one command. Compliant when rename-command FLUSHALL is set or the default ACL user has -@dangerous / -flushall. Checks /etc/redis/redis.conf (SKIP when it does not exist; RHEL uses /etc/redis.conf).

How it is checked

Audit method: File pattern

File
/etc/redis/redis.conf
Pattern
(?mi)^[ \t]*(?:rename-command[ \t]+['\x22]?flushall['\x22]?[ \t]+\S+|user[ \t]+default[ \t][^\n]*(?:-@dangerous|-flushall)\b)

How it is fixed

Fix method: Guidance or infrastructure patch

Add 'rename-command FLUSHALL ""' and 'rename-command FLUSHDB ""' to redis.conf (or use ACLs -@dangerous) and restart Redis

Properties

Operating systems
Any
Tags
redisdatabasesurface-reduction
Reference
CIS Redis Benchmark - Command Hardening / Dangerous Commands (verify section number for your release)

Check this host

Run this on a machine you are allowed to audit. The scan is read-only.

shell
tmaegis scan --target redis --level 2