skip to content

How should a team model Redis ACL users across many services sharing instances, and who should own the rule set?

level: principalimportance: should knowfreq 30%

answer

  1. what does the username attribute
  2. granularity against the size of the file
  3. categories grow on upgrade
  4. one source of truth, delivered to every node
  5. what ACLs cannot bound

basics

~20 s

Default to one user per service plus a few named human roles, built from allowlists, with default disabled. A platform team owns the reviewed rule file and its delivery to every node; service teams propose changes to their own users.

solid answer

~40 s

I default to one ACL user per service, because `ACL LOG` attributes refusals by `username` and a shared login makes that useless. Humans get a few roles, such as read-only and admin. Rules are allowlists, with `default` disabled. Categories versus named commands is the real trade-off: categories stay short but can grow when you upgrade, as 8.0 did, while named lists stay stable but need upkeep. Ownership has to fit how Redis works: users are per node, so a platform team owns one reviewed `aclfile`, its delivery and drift checks, and service teams propose their own lines. I forbid hand edits by `ACL SETUSER`, since the next `ACL LOAD` drops them. ACLs limit what a client may do, not how much it may use, and that decides when a service gets its own instance.

go deeper

for a junior

Recall that each service should log in as its own user rather than sharing one password, and that the username is what shows up in ACL LOG.

for a middle

Compare categories with named command lists for one service, and be able to explain why an allowlist fails safely where a blocklist on top of +@all does not.

for a senior

Show what follows from users being per node: one source file, deployment to every node, drift checks with ACL LIST, and a rule that emergency edits must return to the file.

for a principal

Own the policy and its costs: granularity, the review path that keeps service teams moving, how upgrades are checked against category grants, and the point where ACLs stop being enough.

## The decision ACL rules are easy to write once. The standing questions are how many users exist, what each is built from, and who may change them. There is no single right answer: it depends on how many services share an instance, how much they trust each other, and how often the rules change. ## Granularity: what one user stands for | Model | Attribution in `ACL LOG` | Blast radius of one secret | Cost | |---|---|---|---| | One shared login | None: every entry looks alike | Everything | Lowest upkeep | | One user per team | The team only | All that team's services | Low, but rules end up as a union | | One user per service | The service | That service's keys | A file that grows with the estate | | One user per job or environment | Finest | Smallest | Most lines, and easy to let drift | The per-service model usually wins for three reasons: - `ACL LOG` and `CLIENT LIST` report a `user`, so a denial or a suspicious connection can be traced to its owner. - Rules can match what the service really does, instead of the union of what a team's services do. - Retiring a service means deleting one user. `ACL DELUSER` closes its connections, and an `ACL LOAD` without the line does too. Go finer when one service has jobs with different needs. A selector can express that inside one user, but a second user is usually easier to read, and a selector cannot be edited in place. Reserve selectors for one service that needs a narrow extra grant on another key set. Humans deserve separate treatment. A few roles, such as a read-only role and an admin role with `+@all`, keep people out of service credentials, and they make `username` in the log mean something during an incident. ## What rules are built from The trade-off is mostly about change over time: - **Categories** such as `+@read -@dangerous` are short and readable, but their content is not fixed. Redis 8.0 added `@search`, `@json`, `@timeseries` and others, and its release notes say those commands also join `@read` and `@write`. - **Named commands** such as `+get +mget +ping` are stable and exact, but each new call a service starts making needs a rule change. - **`+@all` with exclusions** is the weakest option. It includes commands that modules load later, and it blocks only what was named. A reasonable policy is named lists for small jobs and categories ending in `-@dangerous` for general application services, with `ACL CAT` output reviewed at each upgrade. Whichever you pick, `default` should be off or stripped, so that forgetting a login fails closed. ## Who owns the rule set The mechanics push towards one owner, since users are per node and not replicated: 1. **One source of truth.** A reviewed `aclfile` in version control, with hashes rather than cleartext, delivered to every node and applied with `ACL LOAD`. 2. **The platform team** owns the file's format, the baseline for each kind of user, delivery, and the drift check that compares `ACL LIST` across nodes. 3. **Service teams** own their own lines, proposed through review, because they know which commands and key prefixes they use. 4. **No hand edits.** An `ACL SETUSER` made during an incident is dropped by the next `ACL LOAD`, and it never existed on other nodes, so an emergency edit needs a follow-up change to the file. The cost is real: a new service waits on review, and a loose baseline spreads everywhere at once. Small estates may do better with a simple shared template and a single reviewer. ## Where the model stops - **ACLs do not limit resource use.** No rule caps memory, CPU or connections per user, so a permitted client can still crowd out the others. Separate instances answer that need. - **Patterns depend on prefixes.** Someone has to allocate them, or two services will end up with overlapping grants. - **Key names can leak.** `SCAN` is in `@read`, so a read grant can list names across prefixes unless you remove it. - **Evidence is thin.** `ACL LOG` is capped, in memory and per node, so decide whether its entries and the `acl_access_denied_*` counters are collected elsewhere. If tenants do not trust each other, or an auditor expects strong separation, one set of ACLs on a shared process may not be enough, whatever the rules say.

  • A service team wants `+@all` on its own user because named commands keep breaking its deploys. How do you respond?
    Treat the breakage as the actual problem. Offer a category grant ending in `-@dangerous`, read `ACL LOG` from a test environment to find what is missing, and check new calls with `ACL DRYRUN` in their pipeline. `+@all` would also grant `FLUSHALL`, `CONFIG` and future module commands, which affects every other service on that instance.
  • When would you accept a shared login on an instance?
    When one service, or a small trusted group that is deployed together, is the only client and attribution adds nothing. Even then, I would use a named user with narrow rules rather than `default`, so that adding a second client later does not start from an open login.

  • One user per team gives the same ACL LOG attribution as one per service
  • Rules built on +@read keep exactly the same meaning across upgrades
  • Each service team can safely run ACL SETUSER on the nodes it uses
  • Enough ACL rules will stop one client exhausting a shared instance's memory
  • +@all minus a blocklist is as safe as an allowlist once it has been reviewed

Assumes Redis 8.10; since 8.0, categories such as @search and @json exist and those commands also join @read and @write, per its release notes.