Chapter 22 · Security: ACLs, TLS, Command/Key Permissions, Secrets, and Network Boundaries

Least Privilege for Applications, Operators, Monitoring, Replication, Sentinel, and Cluster

Map least privilege to applications, operators, monitoring, replication, Sentinel, and Cluster without sharing one administrator identity across technical roles.

Advanced170–250 minutesrole identities, replication/Sentinel/Cluster credentialsRedis Open Source 8.10.1Docker + redis-cli + OpenSSLStandalone ACL node + TLS primary/replicaDB 0 · AOF everysec + RDB · maxmemory 0/noevictionACL + mTLS + loopback/private networkFree/local-firstLast reviewed: September 6, 2026
Reproducible Chapter 22 baseline

Redis Open Source 8.10.1 using the pinned redis:8.10.1 image. Lessons 1–2 use a dedicated ACL-mechanics node published only to 127.0.0.1:6421. Lessons 3–5 use a separate TLS-only primary on host loopback 127.0.0.1:6422 plus one private-network replica on Docker network atlasmart-redis-ch22-net. Database 0; AOF everysec plus RDB save rule; maxmemory 0/noeviction; default ACL user disabled; disposable named ACL users; application key prefix atlasmart:ch22:*. Mutual TLS is enabled in the TLS lab, including the replication link. No Search/JSON/vector/time-series/probabilistic feature is required. All passwords and certificates shown are public lab-only material and must never be reused outside the disposable local lab.

Learning outcomes

This lesson turns Least Privilege for Applications, Operators, Monitoring, Replication, Sentinel, and Cluster into an observable AtlasMart workflow with explicit correctness, failure, and production boundaries.

01

Explain the mechanisms and terminology behind Least Privilege for Applications, Operators, Monitoring, Replication, Sentinel, and Cluster.

02

Collect Redis, client, configuration, and workload evidence before drawing operational conclusions.

03

Reproduce the lesson's deliberately incorrect or failure-prone case, diagnose the mechanism, and verify the repair.

04

Relate the design to memory, persistence, replication/Sentinel/Cluster, security, latency, and client behavior where applicable.

05

Apply the pattern to AtlasMart and state clearly what the implementation guarantees and what it does not guarantee.

1. Problem: “service account” is not one role

AtlasMart now has six technical actors: an API, an on-call operator, a monitoring collector, a replica, Sentinel, and Cluster management tooling. Sharing the administrator user among them makes attribution weak and turns every compromised workload into a control-plane compromise. Least privilege begins by describing each actor’s Redis jobs and failure mode before writing ACL syntax.

2. Separate control layers before assigning commands

Redis ACL authentication and command/key/channel authorization operate on client connections. Replication and Sentinel also authenticate when they connect to data nodes. Redis Cluster clients authenticate to each node, while the Cluster bus is a separate internode protocol whose transport should be protected with network isolation/TLS rather than pretending an application ACL user authenticates cluster gossip.

Actor Needs Must not silently receive
Application Data commands on AtlasMart prefixes/channels CONFIG, ACL, MODULE, DEBUG, unrestricted keys/channels
Operator Inspection and narrowly approved operations Application credentials; unrestricted module/code loading by default
Monitor PING/INFO or exporter-specific reads Data-key access, mutation, failover control
Replica PSYNC, REPLCONF, PING on the primary Key access, ACL/CONFIG control
Sentinel Minimal control commands + __sentinel__:hello Application key access; arbitrary Pub/Sub channels
Cluster client/admin Application data or approved CLUSTER commands Implicit permission to every node; Cluster-bus trust

3. Prove the application, monitoring, and operator policies

The common users.acl already defines three distinct human/workload roles. The monitor cannot read AtlasMart keys because no key patterns or data commands are granted. The operator has selected introspection/control-plane reads rather than +@all. Verify exact commands with ACL DRYRUN; treat the output as a contract tied to this Redis version.

Shell · role contract tests
A="docker exec -e REDISCLI_AUTH=AtlasMart-Ch22-Admin-Lab-Only-2026 atlasmart-redis-ch22-acl redis-cli --user academy-admin"$A ACL DRYRUN atlasmart-monitor PING$A ACL DRYRUN atlasmart-monitor INFO memory$A ACL DRYRUN atlasmart-monitor GET atlasmart:ch22:catalog:sku42$A ACL DRYRUN atlasmart-operator CONFIG GET maxmemory$A ACL DRYRUN atlasmart-operator CONFIG SET maxmemory 1mb$A ACL DRYRUN atlasmart-operator ACL GETUSER atlasmart-app$A ACL DRYRUN atlasmart-operator ACL SETUSER atlasmart-app off

4. Replication has a documented minimal ACL surface

Redis documents that a replica authenticating to a protected primary needs PSYNC, REPLCONF, and PING; it does not need key access. The Chapter 22 replica-sync user contains exactly those commands. The TLS lab later configures masteruser/masterauth and proves master_link_status:up.

Shell · prove the replica identity permissions without starting replication
A="docker exec -e REDISCLI_AUTH=AtlasMart-Ch22-Admin-Lab-Only-2026 atlasmart-redis-ch22-acl redis-cli --user academy-admin"$A ACL DRYRUN replica-sync PING$A ACL DRYRUN replica-sync REPLCONF listening-port 6379$A ACL DRYRUN replica-sync PSYNC ? -1$A ACL DRYRUN replica-sync GET atlasmart:ch22:catalog:sku42$A ACL GETUSER replica-sync

5. Sentinel needs control commands, not data keys

Current Redis Sentinel documentation provides a minimal control-user example. Sentinel does not need key access, but it does use a narrow command set and the __sentinel__:hello Pub/Sub channel. Use sentinel auth-user/sentinel auth-pass for data-node authentication. The exact Sentinel command set is operationally privileged; preserve it as its own identity and re-check official docs when upgrading.

ACL file fragment · documented Sentinel pattern
user sentinel-control on #168781817c2103868f265a1a0dff3861887620e77da89e4b059dbac0436244ce resetkeys resetchannels &__sentinel__:hello +multi +slaveof +ping +exec +subscribe +config|rewrite +role +publish +info +client|setname +client|kill +script|kill
sentinel.conf fragment · separate control credential
sentinel monitor atlasmart-primary redis-primary 6379 2sentinel auth-user atlasmart-primary sentinel-controlsentinel auth-pass atlasmart-primary AtlasMart-Ch22-Sentinel-Lab-Only-2026

6. Cluster security has two different planes

An application using Redis Cluster must authenticate to every node it may be redirected to, so compatible ACL users/rules must exist across nodes. A Cluster administrator can receive specific CLUSTER subcommands through a separate operator identity. The Cluster bus itself is not an application ACL session; protect it with private networking and tls-cluster yes when TLS is enabled. Never interpret “six authenticated client ports” as proof that the bus is secured.

7. Credential distribution and topology changes are deployment problems

A secret rotated on only one Redis Cluster node can cause redirection failures. A new replica without the replication credential cannot synchronize. Sentinel credentials must be staged across all monitored data nodes before Sentinel configuration switches. Cluster/Sentinel/replication changes therefore require an order: add new credential → verify every peer/client can use it → switch dependents → remove old credential → force/recycle stale connections as required → verify topology.

8. Deliberately wrong: generic +@admin operator

Command categories are convenient but may be broader than a role needs, and category membership can evolve. The repair is not to avoid categories entirely; it is to start from a role’s tasks, use ACL CAT/COMMAND INFO to inspect the concrete server version, add explicit exceptions, and maintain ACL DRYRUN tests. Treat module commands separately because +@all has especially broad implications.

9. Redis ACLs are not generic RBAC

Redis Open Source ACLs define Redis users and resource/command rules. They do not provide generic application roles, customer hierarchy, approval workflow, or cloud-account RBAC. Managed Redis products may expose their own role systems and may restrict ACL administration differently. Keep those product controls separate from the Redis Open Source lab and verify provider behavior before porting the commands.

10. Evidence checklist before declaring least privilege

For every identity capture ACL GETUSER, positive and negative ACL DRYRUN tests, actual authentication proof, key/channel denial evidence where applicable, and topology health after credential changes. Record which credentials are stored in configs versus injected at runtime. A green permission test is version-specific evidence, not a guarantee that future commands/categories stay identical.

11. Production judgment and bridge

Least privilege reduces blast radius and improves attribution, but too-narrow rules can cause outages during topology changes or new application features. Treat ACL policy as tested code: version it without secrets, review diffs, stage changes, monitor denials, and preserve rollback credentials. Lesson 3 adds TLS so valid identities and permissions cannot be observed or modified in transit.

Check your understanding

  1. Which commands does Redis document for a replication ACL user on the primary?
  2. Why does Sentinel need a channel rule?
  3. Does the application ACL authenticate the Redis Cluster bus?
  4. What order makes a credential rotation safer across topology components?
Review the answers

PSYNC, REPLCONF, and PING; no key access is required.

It uses the __sentinel__:hello Pub/Sub channel for Sentinel discovery/coordination on monitored nodes.

No. Application ACL sessions and the Cluster bus are different planes; protect the bus with private networking/TLS.

Add the new credential, verify it everywhere, switch dependents, remove the old credential, then force/recycle stale sessions as needed and verify health.

Summary and next step

Least Privilege for Applications, Operators, Monitoring, Replication, Sentinel, and Cluster is now connected to observable Redis behavior, bounded failure cases, and production tradeoffs. Keep the evidence and cleanup state from this lesson; next, continue with TLS for Client and Internode Traffic, Certificate Lifecycle, and Performance Considerations.

Authoritative references

Keep knowledge open

Help the academy stay free and grow.

If these tutorials save you time, a small donation supports new lessons, technical review, diagrams, examples, and long-term maintenance.

ETHEthereum / ERC-20 only
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0

Send only Ethereum or ERC-20 compatible assets to this address.