audit-redis-config
Audit a live Redis instance's config — maxmemory + eviction, persistence (RDB/AOF), replication, slow-log, ACL, TLS. Audits existing settings; not cache design (design-cache-layer).
- License 许可
- MIT
- 最近更新
- 2026-10-29
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- audit-redis-config
- description
- Audit a live Redis instance's config — maxmemory + eviction, persistence (RDB/AOF), replication, slow-log, ACL, TLS. Audits existing settings; not cache design (design-cache-layer).
03 SKILL.md 正文
audit-redis-config
Sanity-check a Redis deployment against the workload. Output: parameter findings + concrete changes.
Mode: analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked [TBD] or [VERIFY], never filled in.
When to use
- A Redis instance is evicting unexpectedly, running out of memory, slow, or about to take more load.
- A security review needs the instance's auth/TLS/exposure posture.
Inputs
- Effective settings:
CONFIG GET *andINFO(memory,persistence,replication,clients), plus the version. Managed services (ElastiCache, Memorystore, Azure Cache) often disable or renameCONFIG— read their parameter group / console instead. - The workload role: pure cache, session store, queue, or primary store.
Read-only. Never run CONFIG SET, CONFIG REWRITE, FLUSH*, DEBUG, or KEYS * against a live instance — recommend; the owner applies.
Procedure
- Memory.
maxmemoryset explicitly, not "no limit". Without a cap, Redis OOMs the host.maxmemory-policymatches the workload:allkeys-lru(pure cache),volatile-lru(mixed),noeviction(queue / store).
- Persistence.
- RDB snapshots — point-in-time + fast load. Lose up-to-snapshot-interval on crash.
- AOF — append-only log; choose
appendfsync everysec(1s window) oralways(sync per write, slow). - For caches: persistence often off (just warm up from origin).
- For queues / sessions: AOF + RDB hybrid is the usual.
- Replication.
replicaofmaster:port if a replica.replica-read-only yes— replicas should not accept writes.repl-diskless-sync yesfor big setups (avoids the disk-write during full sync).
- Slow log.
slowlog-log-slower-than 10000(10 ms, in µs) — logs every command slower than the threshold (a fixed cutoff, not a percentile).slowlog-max-len 1024— small ring buffer.
- Client connections.
maxclientsshould match the connecting application's connection pool.timeout(idle client disconnect) — 0 by default; set 300s in shared environments.
- ACL.
- Default user disabled or non-default password.
- Per-application ACLs with command + key-prefix scoping.
requirepass(legacy) is single-user; ACLs are the modern way.
- Exposure.
protected-mode yesandbindlimited to private interfaces — never0.0.0.0on a reachable network without auth.- Dangerous commands (
FLUSHALL,FLUSHDB,KEYS,CONFIG,DEBUG) denied to application users via ACL categories (-@dangerous), or renamed on older versions.
- TLS.
tls-portenabled in any non-trusted network.tls-cert-file/tls-key-file+tls-auth-clientsfor mTLS.
- Cluster vs single. Cluster mode (
cluster-enabled yes) shards across nodes; consumers must use cluster-aware clients (noKEYS *across slots).
Output
audit-redis-config
Host: cache-1.refund-prod
Version: 7.2
Memory
✓ maxmemory = 8gb
⚠ maxmemory-policy = noeviction; workload is cache. Recommend allkeys-lru.
Persistence
RDB: snapshots every 1h.
AOF: off.
✓ Acceptable for pure cache.
Replication
✓ Two replicas, replica-read-only = yes.
Slow log
⚠ slowlog-log-slower-than = -1 (disabled). Set to 10000.
ACL
✗ default user enabled with empty password.
Fix: disable default; create per-app users with key-prefix scoping.
TLS
✗ TLS not configured; cluster on a private VPC may still benefit.
Recommendation: 3 changes (eviction policy, slow-log, ACL hygiene).
Anti-patterns to avoid
noevictionon a workload that exceeds maxmemory. Writes start failing instead of evicting.- AOF disabled + RDB at 24h interval on a session store. Up to 24h of session loss on crash.
- Single shared password across all clients. Compromise of one client compromises all.
KEYS *recommended anywhere. Blocks the server; useSCANfor iteration.
04 同仓库更多 Skills
runbook
Write or refresh an operational runbook for an alert/symptom; structured as TL;DR + Pre-checks + Steps + Verification + Rollback + Escalation.
rfc
Draft a lightweight design RFC to docs/rfcs/<slug>.md; Summary, Motivation, Detailed design, Drawbacks, Alternatives, Unresolved questions. A proposal to debate, not a recorded decision (adr).
editorial-pass
Review and tighten prose in a Markdown artifact for a target tone (terse, formal, friendly) without dropping information; preserve quotations and load-bearing constraints.
architecture-review-facilitation
Run an architecture review as a process — entry criteria, reviewer checklist, decision log, and follow-up actions — pairing the design artifact with a red-team pass.
architecture-doc
Write a C4-style architecture document; System Context + Containers (+ Components when interesting) with mermaid diagrams. Describes structure, not a decision (adr) or proposal (rfc).
adr
Write an Architecture Decision Record (Michael Nygard format) to docs/adrs/NNNN-<slug>.md; frontmatter validated by the ADR artifact schema. Records a made decision, not a proposal to debate (rfc).