用于架构设计与代码实现阶段的安全审查,识别威胁、漏洞与合规风险。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "security-review" 技能: 1. 下载 https://raw.githubusercontent.com/microsoft/devsquad-copilot/main/.github/plugins/devsquad/skills/security-review/SKILL.md 2. 保存为 ~/.claude/skills/security-review/SKILL.md 3. 装好后重载技能,告诉我可以用了
请以架构安全审查模式评估这个系统设计:用户通过 Web 前端访问 API 网关,后端包含身份认证服务、订单服务和 PostgreSQL 数据库,部署在 Azure 上,并通过第三方支付接口处理付款。请按 STRIDE 分析主要威胁、指出高风险设计点,并给出缓解建议,不要做泛泛的代码质量评论。
输出按威胁类别整理的架构安全风险清单、风险等级及对应缓解方案。
请以代码安全审查模式检查以下 API 实现,重点关注认证授权、输入校验、敏感信息泄露、依赖风险和常见 OWASP 漏洞,并给出需要修改的代码位置与修复建议: [在这里粘贴代码或 Pull Request 说明]
输出具体安全缺陷列表、受影响代码点、风险说明及可执行修复建议。
请结合以下信息做一次安全复核:GitHub Security Alerts 显示两个高危依赖漏洞,Azure 部署配置启用了公有访问存储,项目还处理用户个人信息。请判断哪些问题最紧急,分别属于实现问题还是架构问题,并给出修复优先级与处置顺序。
输出按优先级排序的问题清单,并区分架构层与实现层的处置建议。
| Principle | Application |
|---|---|
| CIA Triad | Confidentiality, Integrity, Availability in every assessment |
| Defense in Depth | Multiple layers; never rely on a single control |
| Least Privilege | Minimum permissions for each component |
| Secure by Default | Default configurations must be secure |
| Zero Trust | Never trust, always verify |
| Shift Left | Detect issues early in design, not in production |
Determine the operating mode from the calling agent's context:
Architectural Mode (called from plan):
plan agent after ADR creationCode Mode (called from implement or review):
implement agent after implementationThis mode is mandatory when the feature involves:
| Trigger | Description |
|---|---|
| Authentication/Authorization | Access control, identity, permissions |
| Sensitive data | Information requiring protection (credentials, personal data) |
| External integrations | Communication with systems outside the trust boundary |
| Exposed endpoints | Interfaces accessible by users or external systems |
| Data persistence | Storage of information that crosses boundaries |
Read design artifacts:
plan.md - Stack and architecturedocs/architecture/decisions/*.md - ADRsspec.md - Requirements and user storiesIdentify attack surface:
## Attack Surface
| Component | Exposure | Data | Initial Risk |
|-----------|----------|------|--------------|
| [endpoint] | [public/internal] | [data type] | [low/medium/high] |
Map trust boundaries:
Apply STRIDE (simplified):
| Threat | Question | Typical Control |
|---|---|---|
| Spoofing | Can someone impersonate another? | Strong authentication |
| Tampering | Can data be altered? | Integrity, signatures |
| Repudiation | Can actions be denied? | Logging, audit trail |
| Info Disclosure | Can data leak? | Encryption, ACLs |
| Denial of Service | Can the system be taken down? | Rate limiting, quotas |
| Elevation | Can privileges be escalated? | Least privilege, RBAC |
Evaluate ADRs:
microsoft_docs_search to check security best practices and known service vulnerabilitiesmicrosoft_docs_fetch to get the complete security hardening guide when a relevant gap is identifiedValidate Azure compliance:
azure/policy tool to verify whether the proposed infrastructure complies with the organization's policiesazure/role tool to verify whether the access model follows least privilege (RBAC)azure/wellarchitectedframework tool for each Azure service in the architecture to get the security pillar guidanceGenerate report:
# Security Review - [Feature]
**Mode**: Architectural
**Date**: [date]
**Reviewer**: Copilot Security Agent
## Executive Summary
**Verdict**: [APPROVED | APPROVED_WITH_CONTROLS | BLOCKED]
[Summary in 2-3 sentences of the overall risk and main concerns]
## Attack Surface
[Components table]
## STRIDE Analysis
…
为软件架构图提供设计与审查建议,提升文档中的图示清晰度与规范性
用于统一项目 Markdown 文档的格式、结构与写作风格规范。
帮助你创建、切换并检查代码分支,确保实现前遵循正确分支策略。
基于代码差异生成规范化 Git 提交信息,并支持按逻辑分组提交
用于初始化项目或校验并生成 SDD 文档模板,确保规范齐全且为最新版本。
系统化排查测试失败、构建中断与异常运行问题,帮助快速恢复开发进度
用于代码与分支审查,综合检查正确性、兼容性、架构、测试、性能与安全问题。
对 Power Pages 站点执行端到端安全审查,并汇总生成完整 HTML 报告。
从正确性、测试、安全与性能等维度进行深入代码审查并给出改进建议
基于代码仓库梳理威胁边界、攻击路径与缓解措施,生成精炼威胁模型。
用于按七步法系统审查架构设计,识别风险、权衡并产出改进建议。
针对 Python、JS/TS 与 Go 提供安全最佳实践审查与改进建议