redis-security — скилл для Claude Code: защита Redis
Настраивает защиту Redis через аутентификацию, TLS, ACL и сетевые ограничения. Нужен при развёртывании или аудите Redis в production.
npx skills add redis/agent-skills --skill redis-security -a claude-codeЧто делает redis-security
Скилл задаёт агенту чек-лист защиты Redis: пароль или ACL-пользователи, TLS для соединений, ограничение интерфейсов через bind, protected-mode и правила firewall. Он также разбирает отключение команд FLUSHALL, DEBUG и CONFIG.
Для приложений предлагается заводить отдельные ACL-учётные записи с нужными шаблонами ключей и разрешёнными командами. Есть примеры для пользователя чтения кэша, пользователя записи без опасных операций и администратора. Общий requirepass рассматривается как сокращённый вариант для пользователя default.
Скилл показывает конфигурации redis.conf, вызовы ACL SETUSER, подключение через Python-клиент redis.Redis и правила iptables. Связка bind 0.0.0.0 с protected-mode no открывает Redis для всей сети, поэтому это повод проверить текущую конфигурацию.
Какие задачи решает
- настроить пароль и TLS для Redis
- создать ACL-пользователей с минимальными правами
- ограничить доступ к Redis через
bindи firewall - отключить разрушительные команды Redis
- проверить Redis на публичную сетевую доступность
Примеры запросов агенту
- Проверь мой
redis.confна защиту Redis для production. - Создай ACL-пользователя для чтения ключей
cache:*без прав на опасные команды. - Настрой TLS-подключение к Redis в Python через
redis.Redis.
Как установить redis-security
1Через Skills CLI (Vercel)
npx skills add redis/agent-skills --skill redis-security -a claude-code2Вручную: положить файлы
~/.claude/skills/redis-security/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/redis-security/
1Через Skills CLI (Vercel)
npx skills add redis/agent-skills --skill redis-security -a codex2Вручную: положить файлы
.agents/skills/redis-security/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add redis/agent-skills --skill redis-security -a cursor2Вручную: положить файлы
.cursor/skills/redis-security/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install redis/agent-skills redis-security2Вручную: положить файлы
.github/skills/redis-security/SKILL.md1Через Skills CLI (Vercel)
npx skills add redis/agent-skills --skill redis-security -a gemini-cli2Командой платформы
gemini skills install https://github.com/redis/agent-skills --path skills/redis-securityВручную: положить файлы
.devin/skills/redis-security/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add redis/agent-skills --skill redis-security -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о redis-security
Как установить redis-security в Claude Code?
Выполните npx skills add redis/agent-skills --skill redis-security -a claude-code, затем повторите npx skills add redis/agent-skills --skill redis-security -a claude-code. Файл скилла находится в ~/.claude/skills/redis-security/SKILL.md.
Что делает redis-security?
Скилл помогает настроить аутентификацию, TLS, ACL и ограничение сетевого доступа Redis. В нём есть примеры redis.conf, ACL-команд, iptables и Python-подключения.
Зачем отдельные ACL-пользователи вместо requirepass?
ACL позволяет выдать каждому приложению только нужные команды и шаблоны ключей. requirepass использует общий пароль пользователя default.
Исходный текст
SKILL.md · MIT
---
name: redis-security
description: Redis security guidance covering authentication (requirepass and ACL users), TLS, ACL-based least-privilege access control, restricting network exposure via bind and protected-mode, firewall rules, and disabling dangerous commands. Use when deploying Redis to production, defining ACL users for an application, configuring TLS connections, locking down a Redis instance behind a firewall, or auditing a Redis deployment for security hardening.
license: MIT
metadata:
author: Redis, Inc.
version: "0.1.0"
---
# Redis Security
Production hardening for Redis: authentication, ACL-based access control, and network exposure. Cover all three together — any one of them on its own leaves an exploitable gap.
## When to apply
- Deploying or reviewing a Redis instance destined for production.
- Setting up application credentials beyond a shared password.
- Auditing a Redis deployment against a security checklist.
- Receiving "Redis exposed to the internet" findings from a scanner.
## 1. Always authenticate (and use TLS)
Never run a production Redis without a password. Pair authentication with TLS so credentials and data aren't sent in clear text.
```
# redis.conf
requirepass your-strong-password
tls-port 6380
tls-cert-file /path/to/redis.crt
tls-key-file /path/to/redis.key
```
```python
r = redis.Redis(
host="localhost",
port=6380,
password="your-strong-password",
ssl=True,
ssl_cert_reqs="required",
)
```
If you can use ACL users (next section) instead of the single `requirepass`, do — `requirepass` is effectively the legacy "default user" shortcut.
See [references/auth.md](references/auth.md).
## 2. ACLs for least-privilege access
The `default` user with a shared password is fine for development. For production, give each application a dedicated ACL user with only the commands and key patterns it actually needs.
```
# Cache-only reader
ACL SETUSER app_readonly on >password ~cache:* +get +mget +scan
# Writer that can't run dangerous ops
ACL SETUSER app_writer on >password ~* +@all -@dangerous
# Admin (use sparingly, never for application traffic)
ACL SETUSER admin on >strong-password ~* +@all
```
Useful command categories:
| Category | What it covers |
|---|---|
| `@read` | Read commands (`GET`, `MGET`, `HGET`, ...) |
| `@write` | Write commands (`SET`, `DEL`, `XADD`, ...) |
| `@dangerous` | `FLUSHALL`, `DEBUG`, `KEYS`, etc. |
| `@admin` | Administrative commands |
If app credentials leak, a tight ACL bounds the blast radius — the attacker can't `FLUSHALL` your DB just because they grabbed a cache reader's password.
See [references/acls.md](references/acls.md).
## 3. Restrict network access
The most common Redis breach is a public-internet Redis with no auth. Avoid that with three layers:
```
# redis.conf — bind to specific interfaces, keep protected-mode on
bind 127.0.0.1 192.168.1.100
protected-mode yes
```
```bash
# Firewall — allow only application subnets
iptables -A INPUT -p tcp --dport 6379 -s 192.168.1.0/24 -j ACCEPT
iptables -A INPUT -p tcp --dport 6379 -j DROP
```
Anti-pattern: `bind 0.0.0.0` + `protected-mode no` — exposes Redis to the whole network without protection.
Optional but recommended: rename or disable destructive commands so a compromised client can't trash the DB:
```
rename-command FLUSHALL ""
rename-command DEBUG ""
rename-command CONFIG ""
```
See [references/network.md](references/network.md).
## References
- [Redis: Security](https://redis.io/docs/latest/operate/oss_and_stack/management/security/)
- [Redis: ACL](https://redis.io/docs/latest/operate/oss_and_stack/management/security/acl/)
© Redis, Inc. · MIT · redis/agent-skills