npx skills add https://github.com/cincinnati-associates/skills --skill security-design-patterns构建安全应用程序的安全架构模式和防御性编码实践。涵盖 TypeScript/Node.js、Python 和 Java 中的身份验证、授权、密码学、密钥管理、输入验证、速率限制和零信任架构。
这些规则在设计和编写代码时自动应用。当您检测到以下任何模式时,请立即应用相应的指导。
当您检测到 JWT 创建、验证或中间件时:
none 算法。优先使用 RS256 或 ES256 而非 HS256(HS256 需要共享密钥;非对称算法允许公钥分发)iss(签发者)、aud(受众)、exp(过期时间)、iat(签发时间)和 nbf(不早于)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
当您检测到密码存储、比较或重置逻辑时:
当您检测到 CORS 设置时:
origin: '*' 与 credentials: true 一起使用(浏览器会阻止此操作,但配置错误的代理可能不会)Access-Control-Allow-Methods 限制为仅需要的部分Access-Control-Max-Age 以缓存预检响应当您检测到中间件或过滤器链配置时,强制执行此顺序:
当您检测到配置加载或环境变量使用时:
.env 文件是否在 .gitignore 中当您检测到会话或 cookie 配置时:
true(防止 JavaScript 访问)true(仅限 HTTPS)Strict(如果需要跨站 GET,则使用 Lax)。没有充分理由,切勿使用 None__Host- 前缀以获得最高安全性当您检测到访问控制逻辑时:
当您检测到 API 密钥处理时:
当您检测到从用户输入构建文件路径时:
../、..\\、空字节)path.resolve() 并验证结果在允许的目录内fs 操作或 open()当您检测到使用用户输入构造传出 HTTP 请求时:
当明确要求执行安全审计时,评估以下领域并生成报告。
身份验证架构
授权模型
数据保护
基础设施模式
密钥管理
安全开发生命周期
# 安全架构报告
## 摘要
整体态势:[良好 / 需要改进 / 存在关键缺陷]
日期:YYYY-MM-DD
范围:[审查的内容]
## 发现
### 身份验证
- [评级] 发现描述
- 当前状态:...
- 建议:...
### 授权
- [评级] 发现描述
- 当前状态:...
- 建议:...
### 数据保护
- [评级] 发现描述
- 当前状态:...
- 建议:...
### 基础设施
- [评级] 发现描述
- 当前状态:...
- 建议:...
### 密钥管理
- [评级] 发现描述
- 当前状态:...
- 建议:...
### SDLC 安全
- [评级] 发现描述
- 当前状态:...
- 建议:...
## 优先行动项
1. [关键] ...
2. [高] ...
3. [中] ...
## 评级说明
- 通过:控制措施已正确实施
- 警告:部分实施或可改进
- 失败:缺失或存在严重错误配置
每周安装数
1
仓库
首次出现
1 天前
安全审计
安装于
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
Security architecture patterns and defensive coding practices for building secure applications. Covers authentication, authorization, cryptography, secrets management, input validation, rate limiting, and zero trust architecture across TypeScript/Node.js, Python, and Java.
These rules apply automatically while designing or writing code. When you detect any of the following patterns, apply the corresponding guidance immediately.
When you detect JWT creation, validation, or middleware:
none algorithm. Prefer RS256 or ES256 over HS256 (HS256 requires shared secrets; asymmetric algorithms allow public key distribution)iss (issuer), aud (audience), exp (expiry), iat (issued at), and nbf (not before)When you detect password storage, comparison, or reset logic:
When you detect CORS setup:
origin: '*' with credentials: true (browsers block this, but misconfigured proxies may not)Access-Control-Allow-Methods to only what is neededAccess-Control-Max-Age to cache preflight responsesWhen you detect middleware or filter chain configuration, enforce this order:
When you detect config loading or environment variable usage:
.env files are in .gitignoreWhen you detect session or cookie configuration:
true (prevents JavaScript access)true (HTTPS only)Strict (or Lax if cross-site GET is needed). Never None without a strong reason__Host- prefix for maximum securityWhen you detect access control logic:
When you detect API key handling:
When you detect file path construction from user input:
../, ..\\, null bytes)path.resolve() and verify the result is within the allowed directoryfs operations or open() without sanitizationWhen you detect outgoing HTTP requests constructed with user input:
When explicitly asked to perform a security audit, evaluate the following areas and generate a report.
Authentication Architecture
Authorization Model
Data Protection
Infrastructure Patterns
Secrets Management
Secure Development Lifecycle
# Security Architecture Report
## Summary
Overall posture: [Strong / Needs Improvement / Critical Gaps]
Date: YYYY-MM-DD
Scope: [what was reviewed]
## Findings
### Authentication
- [rating] Description of finding
- Current state: ...
- Recommendation: ...
### Authorization
- [rating] Description of finding
- Current state: ...
- Recommendation: ...
### Data Protection
- [rating] Description of finding
- Current state: ...
- Recommendation: ...
### Infrastructure
- [rating] Description of finding
- Current state: ...
- Recommendation: ...
### Secrets Management
- [rating] Description of finding
- Current state: ...
- Recommendation: ...
### SDLC Security
- [rating] Description of finding
- Current state: ...
- Recommendation: ...
## Priority Actions
1. [Critical] ...
2. [High] ...
3. [Medium] ...
## Rating Key
- Pass: Control is properly implemented
- Warning: Partially implemented or could be improved
- Fail: Missing or critically misconfigured
Weekly Installs
1
Repository
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSnykPass
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
xdrop 文件传输脚本:Bun 环境下安全上传下载工具,支持加密分享
28,800 周安装