mirror of
https://github.com/sweetwisdom/everything-claude-code-zh.git
synced 2026-03-21 22:10:09 +00:00
docs: 完成所有文档的中文翻译并应用到项目
This commit is contained in:
@@ -1,24 +1,24 @@
|
||||
# Security Guidelines
|
||||
# 安全指南 (Security Guidelines)
|
||||
|
||||
## Mandatory Security Checks
|
||||
## 强制安全检查 (Mandatory Security Checks)
|
||||
|
||||
Before ANY commit:
|
||||
- [ ] No hardcoded secrets (API keys, passwords, tokens)
|
||||
- [ ] All user inputs validated
|
||||
- [ ] SQL injection prevention (parameterized queries)
|
||||
- [ ] XSS prevention (sanitized HTML)
|
||||
- [ ] CSRF protection enabled
|
||||
- [ ] Authentication/authorization verified
|
||||
- [ ] Rate limiting on all endpoints
|
||||
- [ ] Error messages don't leak sensitive data
|
||||
在任何提交(Commit)之前:
|
||||
- [ ] 无硬编码凭据(API 密钥、密码、令牌/Tokens)
|
||||
- [ ] 所有用户输入均已验证
|
||||
- [ ] 预防 SQL 注入(使用参数化查询)
|
||||
- [ ] 预防 XSS(对 HTML 进行净化处理/Sanitized)
|
||||
- [ ] 已启用 CSRF 保护
|
||||
- [ ] 身份验证/授权已验证
|
||||
- [ ] 所有端点均已设置速率限制(Rate limiting)
|
||||
- [ ] 错误消息不泄露敏感数据
|
||||
|
||||
## Secret Management
|
||||
## 凭据管理 (Secret Management)
|
||||
|
||||
```typescript
|
||||
// NEVER: Hardcoded secrets
|
||||
// 严禁:硬编码凭据
|
||||
const apiKey = "sk-proj-xxxxx"
|
||||
|
||||
// ALWAYS: Environment variables
|
||||
// 推荐:环境变量
|
||||
const apiKey = process.env.OPENAI_API_KEY
|
||||
|
||||
if (!apiKey) {
|
||||
@@ -26,11 +26,11 @@ if (!apiKey) {
|
||||
}
|
||||
```
|
||||
|
||||
## Security Response Protocol
|
||||
## 安全响应协议 (Security Response Protocol)
|
||||
|
||||
If security issue found:
|
||||
1. STOP immediately
|
||||
2. Use **security-reviewer** agent
|
||||
3. Fix CRITICAL issues before continuing
|
||||
4. Rotate any exposed secrets
|
||||
5. Review entire codebase for similar issues
|
||||
如果发现安全问题:
|
||||
1. 立即停止(STOP)
|
||||
2. 使用 **security-reviewer** 智能体(Agent)
|
||||
3. 在继续之前修复严重(CRITICAL)问题
|
||||
4. 轮换任何暴露的凭据
|
||||
5. 审查整个代码库是否存在类似问题
|
||||
|
||||
Reference in New Issue
Block a user