Token导航 LogoToken导航TokenDH.com
开发规范敏感数据github未标认证来源可访问clear审计通过

security-best-practices安全最佳实践

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

6,774

周安装

291

GitHub Stars

87

下载量

2,375
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:security-best-practices(安全最佳实践)
来源仓库:https://github.com/mindrally/skills
仓库路径:skills/security-best-practices
安装命令:
npx skills add https://github.com/mindrally/skills --skill security-best-practices
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/mindrally/skills --skill security-best-practices

简介

用于安全开发规范与最佳实践。security-best-practices 属于开发规范类 Skill,可作为该场景下的辅助能力补充。

  • 适合检查权限配置和凭据风险。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • 可生成安全复核清单或漏洞排查建议。
  • 安装方式:通过 npx 从 GitHub 仓库添加技能。
  • 涉及生产数据时应先确认最小权限。

SKILL.md

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

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenCode

28.72%
按下载量换算682

Claude Code

25.62%
按下载量换算608

Antigravity

18.24%
按下载量换算433

Codex

12.3%
按下载量换算292

Gemini CLI

8.69%
按下载量换算206

github-copilot

3.76%
按下载量换算89

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills