Loading...
Loading...
Compare original and translation side by side
trailmarkdiagramming-codetrailmarkdiagramming-code| Rationalization | Why It's Wrong | Required Action |
|---|---|---|
| "The user only asked about SARIF, skip pre-analysis" | Without pre-analysis, you can't cross-reference findings with blast radius or taint | Always run |
| "Unmatched findings don't matter" | Unmatched findings may indicate parsing gaps or out-of-scope files | Report unmatched count and investigate if high |
| "One severity subgraph is enough" | Different severities need different triage workflows | Query all severity subgraphs, not just |
| "SARIF results speak for themselves" | Findings without graph context lack blast radius and taint reachability | Cross-reference with pre-analysis subgraphs |
| "weAudit and SARIF overlap, pick one" | Human auditors and tools find different things | Import both when available |
| "Tool isn't installed, I'll do it manually" | Manual analysis misses what tooling catches | Install trailmark first |
| 错误认知 | 错误原因 | 正确操作 |
|---|---|---|
| "用户只提到了SARIF,跳过预分析" | 没有预分析的话无法将发现结果与blast radius或taint交叉引用 | 增强操作前必须运行 |
| "匹配不上的发现结果不重要" | 匹配失败可能意味着解析存在漏洞或者文件不在作用域内 | 上报匹配失败的数量,如果数量较多需要排查原因 |
| "只要一个严重级别子图就够了" | 不同严重级别需要不同的分类处理流程 | 查询所有严重级别的子图,不要只查询 |
| "SARIF结果本身就能说明问题" | 没有代码图上下文的发现结果缺少blast radius和taint可达性信息 | 与预分析子图进行交叉引用 |
| "weAudit和SARIF结果有重叠,选一个就行" | 人工审计和工具能发现不同的问题 | 两者都可用时全部导入 |
| "工具没安装,我手动分析就行" | 手动分析会遗漏工具能捕捉到的问题 | 先安装trailmark |
uv run trailmarkuv pip install trailmarkuv run trailmarkuv pip install trailmarkundefinedundefinedundefinedundefinedfrom trailmark.query.api import QueryEngine
engine = QueryEngine.from_directory("{targetDir}", language="python")from trailmark.query.api import QueryEngine
engine = QueryEngine.from_directory("{targetDir}", language="python")undefinedundefinedAugmentation Progress:
- [ ] Step 1: Build graph and run pre-analysis
- [ ] Step 2: Locate SARIF/weAudit files
- [ ] Step 3: Run augmentation
- [ ] Step 4: Inspect results and subgraphs
- [ ] Step 5: Cross-reference with pre-analysisengine = QueryEngine.from_directory("{targetDir}", language="{lang}")
engine.preanalysis()semgrep --sarif -o results.sarifcodeql database analyze --format=sarif-latest.vscode/<username>.weauditengine.augment_sarif()engine.augment_weaudit()unmatched_findingsengine.findings()engine.subgraph_names()sarif:errortaintedhigh_blast_radiusprivilege_boundary增强进度:
- [ ] 步骤1:构建代码图并运行预分析
- [ ] 步骤2:定位SARIF/weAudit文件
- [ ] 步骤3:运行增强操作
- [ ] 步骤4:检查结果和子图
- [ ] 步骤5:与预分析结果交叉引用engine = QueryEngine.from_directory("{targetDir}", language="{lang}")
engine.preanalysis()semgrep --sarif -o results.sarifcodeql database analyze --format=sarif-latest.vscode/<username>.weauditengine.augment_sarif()engine.augment_weaudit()unmatched_findingsengine.findings()engine.subgraph_names()sarif:errortaintedhigh_blast_radiusprivilege_boundaryfindingaudit_notesarif:<tool_name>weaudit:<author>[SEVERITY] rule-id: message (tool)findingaudit_notesarif:<工具名称>weaudit:<作者>[严重级别] 规则ID: 消息 (工具)| Subgraph | Contents |
|---|---|
| Nodes with SARIF error-level findings |
| Nodes with SARIF warning-level findings |
| Nodes with SARIF note-level findings |
| Nodes flagged by a specific tool |
| Nodes with high-severity weAudit findings |
| Nodes with medium-severity weAudit findings |
| Nodes with low-severity weAudit findings |
| All weAudit findings (entryType=0) |
| All weAudit notes (entryType=1) |
| 子图 | 内容 |
|---|---|
| 存在SARIF错误级别发现结果的节点 |
| 存在SARIF警告级别发现结果的节点 |
| 存在SARIF提示级别发现结果的节点 |
| 特定工具标记的节点 |
| 存在高严重级别weAudit发现结果的节点 |
| 存在中严重级别weAudit发现结果的节点 |
| 存在低严重级别weAudit发现结果的节点 |
| 所有weAudit发现结果(entryType=0) |
| 所有weAudit注释(entryType=1) |
root_pathlocation.file_pathfile://root_pathlocation.file_pathfile://