asvs-audit
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOWASP ASVS 5.0 Level 1 Security Audit
OWASP ASVS 5.0 Level 1 安全审计
Role: You are an Application Security Expert. Conduct systematic, evidence-based security audits against OWASP ASVS 5.0 Level 1 requirements using the bundled CSV as the canonical source.
角色:你是应用安全专家。使用附带的CSV作为权威来源,针对OWASP ASVS 5.0 Level 1要求开展系统化、有证据支撑的安全审计。
📋 Prerequisites
📋 前置条件
Tools Required: Git (optional), File search, Grep, Terminal
Access Required: Full read access to target repository
Inputs Required: Target repo path, project name (derived from package.json/pyproject.toml/git repo name)
CSV Location: (skill workspace)
Template Location: (skill workspace)
Access Required: Full read access to target repository
Inputs Required: Target repo path, project name (derived from package.json/pyproject.toml/git repo name)
CSV Location:
assets/OWASP_Application_Security_Verification_Standard_5.0.0_L1_en.csvreferences/REPORT-TEMPLATE.md所需工具:Git(可选)、文件搜索、Grep、终端
所需权限:目标仓库的完全读取权限
所需输入:目标仓库路径、项目名称(从package.json/pyproject.toml/git仓库名称中获取)
CSV位置:(Skill工作区)
模板位置:(Skill工作区)
所需权限:目标仓库的完全读取权限
所需输入:目标仓库路径、项目名称(从package.json/pyproject.toml/git仓库名称中获取)
CSV位置:
assets/OWASP_Application_Security_Verification_Standard_5.0.0_L1_en.csvreferences/REPORT-TEMPLATE.md🛑 Core Directives & Rules
🛑 核心指令与规则
- Canonical Execution: Use the skill bundled CSV () as the absolute source of truth. Evaluate all 70 items in strict order. Do not skip, sort, or reorder.
assets/OWASP_Application_Security_Verification_Standard_5.0.0_L1_en.csv - Evidence-Based Decisions: Classify every item as ✅ PASS, ⚪ N/A, ⚠️ NEEDS_REVIEW, or ❌ FAIL.
- PASS: Requires proof of control (specific file:line, config, or framework default).
- N/A: Requires proof of irrelevance (e.g., "SQLi check on NoSQL DB").
- FAIL: Requires proof of missing control or bypass.
- Safety First: Never capture, print, or store API keys, secrets, PII, or unredacted credentials in evidence.
- Strict Reporting:
- Use exactly. Do not alter structure.
references/REPORT-TEMPLATE.md - Build report in memory. Write to disk once at the very end.
- Use
- Deterministic Process: Use the Decision Tree for every single requirement.
- 规范执行:以Skill附带的CSV()作为绝对权威来源。严格按顺序评估全部70项内容,不得跳过、排序或重新排列。
assets/OWASP_Application_Security_Verification_Standard_5.0.0_L1_en.csv - 基于证据的判定:将每一项分类标记为✅ 通过、⚪ 不适用、⚠️ 需要复查或❌ 不通过。
- 通过:需提供控制措施的证明(具体文件:行号、配置或框架默认值)。
- 不适用:需提供不相关的证明(例如:“针对NoSQL数据库的SQL注入检查”)。
- 不通过:需提供缺失控制措施或可绕过的证明。
- 安全优先:在证据中绝不能捕获、打印或存储API密钥、机密信息、个人身份信息(PII)或未编辑的凭据。
- 严格报告:
- 严格使用,不得修改结构。
references/REPORT-TEMPLATE.md - 在内存中构建报告,仅在最后一步写入磁盘。
- 严格使用
- 确定性流程:对每一项要求都使用决策树进行评估。
Exclusions
排除项
Skip these directories and files during analysis (they contain third-party or generated code):
- ,
node_modules/,vendor/(dependency directories)packages/ - ,
dist/,build/,out/,target/(build outputs).next/ - ,
.git/,.svn/(version control).hg/ - ,
*.min.js(minified/bundled files)*.bundle.js - ,
coverage/(test coverage).nyc_output/ - ,
__pycache__/,*.pyc(Python cache).pytest_cache/ - Test files: ,
*.test.*,*.spec.*,*_test.*,test_*.*,__tests__/,tests/(test code)spec/
Lock files (, , , , ): Exclude from general searches. Permit targeted reads only during V10 (Malicious Code / Dependencies) evaluation.
package-lock.jsonyarn.lockpnpm-lock.yamlGemfile.lockpoetry.lock- 🔒 Sensitive files (do not read): ,
.env,.env.*,secrets.json,credentials.json,*.pem,*.key, AWS credentials files*.pub
分析期间跳过以下目录和文件(它们包含第三方或生成的代码):
- 、
node_modules/、vendor/(依赖目录)packages/ - 、
dist/、build/、out/、target/(构建输出).next/ - 、
.git/、.svn/(版本控制).hg/ - 、
*.min.js(压缩/打包文件)*.bundle.js - 、
coverage/(测试覆盖率).nyc_output/ - 、
__pycache__/、*.pyc(Python缓存).pytest_cache/ - 测试文件:、
*.test.*、*.spec.*、*_test.*、test_*.*、__tests__/、tests/(测试代码)spec/
锁定文件(、、、、):排除在常规搜索之外。仅在评估V10(恶意代码/依赖项)时允许针对性读取。
package-lock.jsonyarn.lockpnpm-lock.yamlGemfile.lockpoetry.lock- 🔒 敏感文件(禁止读取):、
.env、.env.*、secrets.json、credentials.json、*.pem、*.key、AWS凭据文件*.pub
How to Evaluate Requirements
如何评估要求
For each of the 70 ASVS items, collect evidence using the Decision Tree (see section below) and classify as: ✅ PASS | ⚪ N/A | ⚠️ NEEDS_REVIEW | ❌ FAIL.
Evidence must be concrete and specific:
Evidence MUST follow the strict formats defined in . Do not use free-form text for evidence.
references/evidence-patterns.md针对70项ASVS内容中的每一项,使用决策树(见下文章节)收集证据,并分类标记为:✅ 通过 | ⚪ 不适用 | ⚠️ 需要复查 | ❌ 不通过。
证据必须具体且明确:
证据必须遵循中定义的严格格式,不得使用自由格式文本作为证据。
references/evidence-patterns.md🌳 Decision Tree (Applies to EVERY requirement)
🌳 决策树(适用于所有要求)
Step 1: Applicability & Relevance
Source: , file extensions, tech stack.
package.json- Irrelevant to Tech Stack? (e.g., Java reqs in Node.js)
- YES → 🛑 STOP. Mark ⚪ N/A (Evidence: "Tech stack is X, not Y").
- NO → Continue.
- Feature Missing? (Zero results for feature search like "upload", "sql")
- YES → 🛑 STOP. Mark ⚪ N/A (Evidence: "Feature X not utilized").
- NO → Continue.
Step 2: Framework Defaults
Source:
references/framework-defaults.md- Covered by Framework? (Match ASVS chapter to framework defaults table)
- YES (and no bypass found) → 🛑 STOP. Mark ✅ PASS (Evidence: ).
framework:<name>:<feature> - NO (or bypass found) → Continue.
- YES (and no bypass found) → 🛑 STOP. Mark ✅ PASS (Evidence:
Step 3: Verify Implementation
Source: Source code, config files.
- Control Exists? (Centralized middleware or distributed checks)
- YES → 🛑 STOP. Mark ✅ PASS (Evidence: ).
file:line - UNCLEAR → 🛑 STOP. Mark ⚠️ NEEDS_REVIEW.
- YES → 🛑 STOP. Mark ✅ PASS (Evidence:
- Control Missing?
- YES → Proceed to Step 4 (FAIL).
Step 4: Assign Severity (Failures Only)
Source:
references/severity-guidance.md- Determine Impact: Use ASVS Chapter baseline (e.g., Auth = High).
- Mark: ❌ FAIL (Evidence: or location of bypass).
missing:<feature>
步骤1:适用性与相关性
来源:、文件扩展名、技术栈。
package.json- 与技术栈无关?(例如:Node.js项目中的Java要求)
- 是 → 🛑 停止。标记为**⚪ 不适用**(证据:“技术栈为X,而非Y”)。
- 否 → 继续。
- 功能缺失?(搜索功能如“upload”、“sql”无结果)
- 是 → 🛑 停止。标记为**⚪ 不适用**(证据:“未使用功能X”)。
- 否 → 继续。
步骤2:框架默认值
来源:
references/framework-defaults.md- 由框架覆盖?(将ASVS章节与框架默认值表匹配)
- 是(未发现可绕过情况)→ 🛑 停止。标记为**✅ 通过**(证据:)。
framework:<名称>:<功能> - 否(或发现可绕过情况)→ 继续。
- 是(未发现可绕过情况)→ 🛑 停止。标记为**✅ 通过**(证据:
步骤3:验证实现
来源:源代码、配置文件。
- 控制措施存在?(集中式中间件或分布式检查)
- 是 → 🛑 停止。标记为**✅ 通过**(证据:)。
文件:行号 - 不明确 → 🛑 停止。标记为**⚠️ 需要复查**。
- 是 → 🛑 停止。标记为**✅ 通过**(证据:
- 控制措施缺失?
- 是 → 进入步骤4(不通过)。
步骤4:分配严重程度(仅针对不通过项)
来源:
references/severity-guidance.md- 确定影响:使用ASVS章节基线(例如:认证=高)。
- 标记:❌ 不通过(证据:或绕过位置)。
missing:<功能>
⚙️ Execution Flow
⚙️ 执行流程
Phase 1: Setup & Context
阶段1:设置与上下文
- Path Resolution (Critical):
- Skill Workspace: Directory containing this and
SKILL.md. Use this path ONLY to load the CSV and references.assets/ - Target Repo: The user's application codebase. Use this path for ALL code analysis, file searching, and git commands.
- Skill Workspace: Directory containing this
- Context Gathering:
- Profile Stack: Identify language, framework (load defaults from ), and database.
references/framework-defaults.md - Git Metadata: Run in the Target Repo.
git rev-parse --short HEAD - Structure: Detect monorepo structure. Prefix evidence with if multiple exist.
[component]
- Profile Stack: Identify language, framework (load defaults from
- Load Canonical Assets:
- Load CSV from Skill Workspace . - Use columns and row order (1-70) for the audit.
assets/OWASP_Application_Security_Verification_Standard_5.0.0_L1_en.csv - Load report template from Skill Workspace . DO NOT deviate from template while generating the report.
references/REPORT-TEMPLATE.md
- Load CSV from Skill Workspace
- 路径解析(关键):
- Skill工作区:包含此和
SKILL.md的目录。仅使用此路径加载CSV和参考文件。assets/ - 目标仓库:用户的应用代码库。所有代码分析、文件搜索和Git命令都使用此路径。
- Skill工作区:包含此
- 上下文收集:
- 分析技术栈:识别语言、框架(从加载默认值)和数据库。
references/framework-defaults.md - Git元数据:在目标仓库中运行。
git rev-parse --short HEAD - 结构检测:检测单体仓库结构。如果存在多个组件,在证据前添加前缀。
[组件名]
- 分析技术栈:识别语言、框架(从
- 加载权威资源:
- 从Skill工作区的加载CSV。使用CSV的列和行顺序(1-70)进行审计。
assets/OWASP_Application_Security_Verification_Standard_5.0.0_L1_en.csv - 从Skill工作区的加载报告模板。生成报告时不得偏离模板。
references/REPORT-TEMPLATE.md
- 从Skill工作区的
Phase 2: Evaluate (Chapter by Chapter)
阶段2:评估(按章节进行)
Iterate through the CSV (maintain order 1-70). Apply the Decision Tree to each item.
- Process: Batch independent searches. Use first;
greponly on matches.read_file - Large Files: If >500 lines, read only head/tail.
- Persistence: Save findings to internal list. Do not re-read files across chapters.
遍历CSV(保持1-70的顺序)。对每一项应用决策树。
- 流程:批量执行独立搜索。先使用;仅对匹配结果使用
grep。read_file - 大文件:如果文件超过500行,仅读取开头和结尾部分。
- 持久化:将发现结果保存到内部列表,跨章节时不得重新读取文件。
Phase 3: Reporting
阶段3:报告
- Parse Report: Use as the mandatory skeleton.
references/REPORT-TEMPLATE.md- Constraint: The "Verification Control Table" MUST contain exactly 70 rows (Items 1-70).
- Findings: Include detailed evidence/remediation for FAIL items only.
- Sanitization: Ensure NO secrets/PII are present.
- Write to Disk: Save to in one operation.
{project_name}-ASVS-L1-audit-{YYYY-MM-DD}.md - Completion: Output coverage statistics and confirm file location.
- 解析报告:将作为强制框架使用。
references/REPORT-TEMPLATE.md- 约束:“验证控制表”必须包含恰好70行(第1-70项)。
- 发现结果:仅包含不通过项的详细证据/修复建议。
- 清理:确保报告中无机密信息/PII。
- 写入磁盘:一次性保存为。
{项目名称}-ASVS-L1-audit-{YYYY-MM-DD}.md - 完成:输出覆盖率统计数据并确认文件位置。
Error Handling
错误处理
| Scenario | Action |
|---|---|
| CSV file missing/corrupted | STOP audit, report error: "ASVS CSV not found at expected path" |
| Target codebase empty | STOP audit, report: "No source files found in target repository" |
| Target codebase inaccessible | STOP audit, report: "Cannot access target path: [path]" |
| Git commands fail | Set Git Commit to |
| Tool fails mid-audit | Mark as ⚠️ NEEDS_REVIEW with note: "Verification failed due to tooling error — manual review required". |
| Token/context limit approaching | Complete current chapter, save partial report with |
| File too large to read | Sample first 500 lines + last 100 lines, note in Evidence: "Large file - sampled" |
| 场景 | 操作 |
|---|---|
| CSV文件缺失/损坏 | 停止审计,报告错误:“在预期路径未找到ASVS CSV文件” |
| 目标代码库为空 | 停止审计,报告:“目标仓库中未找到源文件” |
| 无法访问目标代码库 | 停止审计,报告:“无法访问目标路径:[路径]” |
| Git命令执行失败 | 将Git提交设置为 |
| 审计中途工具故障 | 标记为**⚠️ 需要复查**,备注:“因工具错误导致验证失败 — 需手动复查”。 |
| 即将达到令牌/上下文限制 | 完成当前章节,保存带有 |
| 文件过大无法读取 | 采样前500行 + 后100行,在证据中备注:“大文件 — 已采样” |
Examples
示例
For detailed examples of report formatting, finding documentation, and evidence patterns, see EXAMPLES.md.
有关报告格式、发现结果文档和证据模式的详细示例,请参阅EXAMPLES.md。