security-best-practices · mindrally — скилл для Claude Code: как установить
Скилл задаёт правила безопасной разработки бэкенда и микросервисов. Помогает выстроить проверку пользовательского ввода, защиту API и аутентификацию без утечек секретов или стектрейсов.
npx skills add Mindrally/skills --skill security-best-practices -a claude-codeЧто делает security-best-practices
Скилл добавляет в контекст агента свод правил для серверного кода и микросервисов. В фокусе — валидация параметров через белые списки на границе приложения, подготовленные выражения для SQL-запросов и экранирование HTML от XSS. Для защиты сессий и паролей документ требует использовать стойкие алгоритмы вроде bcrypt и Argon2, а токены JWT снабжать сроком жизни и механизмами обновления.
В инструкциях подробно расписана устойчивость архитектуры. Агент учится внедрять таймауты, экспоненциальные задержки при повторах внешних вызовов, ограничивать частоту запросов через Redis и изолировать операции по ролевой модели (RBAC). Важное требование — никогда не отдавать внутренние стектрейсы клиенту в проде и не хранить API-ключи в коде проекта.
Скилл требует настроенных переменных среды или менеджера секретов. Это повод проверить текущие заголовки вроде HSTS и CSP, ведь документ запрещает небезопасные значения по умолчанию.
Какие задачи решает
- закрыть уязвимости к SQL-инъекциям через параметризованные запросы
- настроить безопасную обработку токенов JWT и сессионных cookie
- добавить ограничение частоты запросов и таймауты для внешних сервисов
- скрыть детали стектрейсов и системных ошибок от пользователей
Примеры запросов агенту
- Проверь эндпоинт авторизации на соответствие security-best-practices
- Добавь rate limiting через Redis и валидацию входящих параметров схемы
- Настрой ротацию секретов и заголовки CSP для нового сервиса
Как установить security-best-practices
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill security-best-practices -a claude-code2Вручную: положить файлы
~/.claude/skills/security-best-practices/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/security-best-practices/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill security-best-practices -a codex2Вручную: положить файлы
.agents/skills/security-best-practices/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill security-best-practices -a cursor2Вручную: положить файлы
.cursor/skills/security-best-practices/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills security-best-practices2Вручную: положить файлы
.github/skills/security-best-practices/SKILL.md1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill security-best-practices -a gemini-cli2Командой платформы
gemini skills install https://github.com/Mindrally/skills --path security-best-practicesВручную: положить файлы
.devin/skills/security-best-practices/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill security-best-practices -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора168
Другие версии security-best-practices
Похожие
Рядом в теме «Безопасность»
Всё по теме «Безопасность» →Вопросы о security-best-practices
Как установить security-best-practices в Claude Code?
Выполните команду npx skills add Mindrally/skills --skill security-best-practices -a claude-code. Также можно вручную сохранить файл в ~/.claude/skills/security-best-practices/SKILL.md.
Для чего нужен скилл security-best-practices?
Он направляет агента при написании бэкенда, требуя валидировать внешние параметры, защищать пароли через bcrypt или Argon2 и закрывать уязвимости XSS, CSRF и SQL Injection.
Какие требования к защите API выдвигает этот набор правил?
Правила предписывают внедрять лимиты на размер запросов, настраивать распределённый rate limiting, проверять заголовки Content-Type и логировать доступ к эндпоинтам.
Исходный текст
SKILL.md · Apache-2.0
--- name: security-best-practices description: Security best practices for backend development, microservices, and secure coding patterns with emphasis on input validation and authentication metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # Security Best Practices Apply these security principles when developing backend services, microservices, and any code handling sensitive data or external inputs. ## Input Validation and Sanitization - Apply input validation and sanitization rigorously, especially on inputs from external sources - Validate all user inputs at the boundary of your application - Use allowlists over denylists when validating input - Sanitize data before storing or displaying to prevent injection attacks - Implement strict type checking and schema validation ## Authentication and Authorization - Use secure defaults for JWT, cookies, and configuration settings - Implement proper token expiration and refresh mechanisms - Store secrets securely using environment variables or secret management services - Never hardcode credentials or API keys in source code - Use secure password hashing algorithms (bcrypt, Argon2) ## Permission Boundaries - Isolate sensitive operations with clear permission boundaries - Apply the principle of least privilege throughout the system - Implement role-based access control (RBAC) where appropriate - Audit and log access to sensitive resources - Use separate service accounts for different components ## Resilience and Protection - Implement retries, exponential backoff, and timeouts on all external calls - Deploy circuit breakers and rate limiting for service protection - Consider distributed rate-limiting to prevent abuse across services (e.g., using Redis) - Implement request throttling to prevent denial of service - Use connection pooling with appropriate limits ## Secure Configuration - Use HTTPS/TLS for all network communications - Configure secure HTTP headers (HSTS, CSP, X-Frame-Options) - Disable verbose error messages in production - Keep dependencies updated and scan for vulnerabilities - Use secure defaults and fail securely ## Error Handling - Implement comprehensive error handling throughout the application - Never expose stack traces or internal details to end users - Log security-relevant events with appropriate detail - Propagate context appropriately for debugging while maintaining security - Handle authentication and authorization failures gracefully ## Secrets Management - Use environment variables or dedicated secrets managers - Rotate credentials and keys regularly - Implement proper key management practices - Avoid logging sensitive information - Use encryption at rest for sensitive data storage ## SQL Injection Prevention - Use parameterized queries or prepared statements - Never concatenate user input into SQL queries - Use ORM features that automatically escape values - Validate and sanitize all database inputs - Limit database user permissions ## Cross-Site Scripting (XSS) Prevention - Escape all output rendered in HTML - Use Content Security Policy headers - Sanitize user-generated content before display - Use framework-provided escaping functions - Avoid innerHTML and similar dangerous APIs ## Cross-Site Request Forgery (CSRF) Prevention - Implement CSRF tokens for state-changing operations - Verify origin and referer headers - Use SameSite cookie attribute - Require re-authentication for sensitive actions - Implement proper session management ## API Security - Implement API authentication (JWT, API keys, OAuth) - Use rate limiting to prevent abuse - Validate request content types - Implement request size limits - Log API access for auditing ## Dependency Security - Regularly audit dependencies for vulnerabilities - Use lockfiles to ensure consistent versions - Remove unused dependencies - Monitor security advisories for your stack - Implement automated vulnerability scanning in CI/CD
© Mindrally · Apache-2.0 · Mindrally/skills