Loading...
Loading...
Compare original and translation side by side
| Scan Type | Trigger Files | MCP Tool |
|---|---|---|
| SAST (Code) | Source files: | |
| SCA (Dependencies) | Manifests: | |
| IaC | Infrastructure: | |
.md.txt.rst| 扫描类型 | 触发文件 | MCP工具 |
|---|---|---|
| SAST(代码扫描) | 源代码文件: | |
| SCA(依赖扫描) | 清单文件: | |
| IaC | 基础设施文件: | |
.md.txt.rstgit diff --name-only HEAD
git diff --name-only --cached # staged files
git status --porcelaingit diff --name-only HEAD
git diff --name-only --cached # 已暂存文件
git status --porcelainapiVersionkindAWSTemplateFormatVersionapiVersionkindAWSTemplateFormatVersionsnyk_code_scansnyk_code_scanpathseverity_threshold"medium"pathseverity_threshold"medium"snyk_sca_scansnyk_sca_scanpathall_projectstrueseverity_threshold"medium"pathall_projectstrueseverity_threshold"medium"snyk_iac_scansnyk_iac_scanpathseverity_threshold"medium"pathseverity_threshold"medium"git diff -U0@@ -X,Y +A,B @@git diff -U0@@ -X,Y +A,B @@| Mode | Block On | Warn On | Allow |
|---|---|---|---|
| Strict | Low+ | - | - |
| Standard | High+ | Medium | Low |
| Relaxed | Critical only | High | Medium, Low |
| 模式 | 阻止条件 | 警告条件 | 允许条件 |
|---|---|---|---|
| 严格模式 | 低及以上级别 | - | - |
| 标准模式 | 高及以上级别 | 中级别 | 低级别 |
| 宽松模式 | 仅严重级别 | 高级别 | 中、低级别 |
undefinedundefined| Scan Type | New Issues | Blocked |
|---|---|---|
| Code (SAST) | X | Yes/No |
| Dependencies (SCA) | Y | Yes/No |
| Infrastructure (IaC) | Z | Yes/No |
| 扫描类型 | 新问题数量 | 是否阻止 |
|---|---|---|
| 代码扫描(SAST) | X | 是/否 |
| 依赖扫描(SCA) | Y | 是/否 |
| 基础设施扫描(IaC) | Z | 是/否 |
| Severity | Type | File | Line | Description |
|---|---|---|---|---|
| High | SQL Injection | src/db.ts | 45 | User input in query |
| 严重级别 | 类型 | 文件 | 行号 | 描述 |
|---|---|---|---|---|
| 高 | SQL注入 | src/db.ts | 45 | 用户输入直接用于查询 |
| Severity | Package | Vulnerability | Fix Version |
|---|---|---|---|
| Critical | lodash@4.17.15 | Prototype Pollution | 4.17.21 |
| 严重级别 | 包名 | 漏洞类型 | 修复版本 |
|---|---|---|---|
| 严重 | lodash@4.17.15 | 原型污染 | 4.17.21 |
| Severity | Resource | Issue | Recommendation |
|---|---|---|---|
| High | aws_s3_bucket | Public access enabled | Set block_public_access |
| 严重级别 | 资源 | 问题描述 | 修复建议 |
|---|---|---|---|
| 高 | aws_s3_bucket | 开启了公共访问权限 | 设置block_public_access |
/snyk-fix SNYK-JS-LODASH-1234src/db.ts:45/snyk-fix SNYK-JS-LODASH-1234src/db.ts:45undefinedundefinedIf any NEW issue severity >= threshold:
BLOCKED - do not proceed until fixed
Provide specific fix commands
Else:
ALLOWED - safe to proceed
Note any warnings for future attention如果存在任何新增问题的严重级别 >= 阈值:
阻止提交 - 修复完成前不允许继续
提供具体修复命令
否则:
允许提交 - 可安全继续
记录需后续关注的警告信息snyk_send_feedbackpathpreventedIssuesCountfixedExistingIssuesCount0snyk_send_feedbackpathpreventedIssuesCountfixedExistingIssuesCount0file + content_hash.snykignore:
SNYK-JS-EXAMPLE-12345:
- '*':
reason: 'False positive - input is validated upstream'
expires: 2025-12-31file + content_hash.snykignore:
SNYK-JS-EXAMPLE-12345:
- '*':
reason: '误报 - 输入已在上游验证'
expires: 2025-12-31| Situation | Action |
|---|---|
| Authentication error | Run |
| Scan timeout | Retry once with smaller scope; report partial results if still failing |
| No changes detected | Report "No code changes detected - nothing to scan"; offer full project scan on request |
| Unsupported files only | Report "No scannable files in changes" with a list of skipped file types and reasons |
| 场景 | 处理动作 |
|---|---|
| 认证错误 | 运行 |
| 扫描超时 | 缩小范围重试一次;若仍失败则报告部分结果 |
| 未检测到变更 | 报告“未检测到代码变更 - 无需扫描”;应用户请求可提供全项目扫描 |
| 仅包含不支持的文件 | 报告“变更中无可扫描文件”,并列出跳过的文件类型及原因 |