granttrace 2.5.0__tar.gz → 2.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {granttrace-2.5.0 → granttrace-2.5.2}/CHANGELOG.md +23 -0
- {granttrace-2.5.0/granttrace.egg-info → granttrace-2.5.2}/PKG-INFO +53 -18
- {granttrace-2.5.0 → granttrace-2.5.2}/README.md +52 -17
- {granttrace-2.5.0 → granttrace-2.5.2}/VERIFICATION.md +332 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/api_sentinel.py +55 -27
- {granttrace-2.5.0 → granttrace-2.5.2}/core/__init__.py +1 -1
- {granttrace-2.5.0 → granttrace-2.5.2}/core/auditor.py +4 -2
- {granttrace-2.5.0 → granttrace-2.5.2}/core/config_validator.py +178 -1
- {granttrace-2.5.0 → granttrace-2.5.2}/core/diff.py +36 -7
- {granttrace-2.5.0 → granttrace-2.5.2}/core/evidence.py +21 -9
- {granttrace-2.5.0 → granttrace-2.5.2}/core/generator.py +93 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/core/onboarding.py +3 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/core/parameters.py +57 -1
- {granttrace-2.5.0 → granttrace-2.5.2}/core/parser.py +25 -2
- {granttrace-2.5.0 → granttrace-2.5.2}/core/reporter.py +3 -2
- {granttrace-2.5.0 → granttrace-2.5.2}/core/reproduction.py +5 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/core/transactions.py +21 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/docs/advanced.md +5 -1
- {granttrace-2.5.0 → granttrace-2.5.2}/docs/configuration.md +7 -1
- granttrace-2.5.2/docs/release-checklist.md +492 -0
- granttrace-2.5.2/docs/windows-portable.md +73 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/examples/sample_report.html +123 -123
- {granttrace-2.5.0 → granttrace-2.5.2}/examples/sample_result.json +126 -126
- {granttrace-2.5.0 → granttrace-2.5.2/granttrace.egg-info}/PKG-INFO +53 -18
- {granttrace-2.5.0 → granttrace-2.5.2}/granttrace.egg-info/SOURCES.txt +7 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/pyproject.toml +1 -1
- granttrace-2.5.2/scripts/build_windows_portable.py +134 -0
- granttrace-2.5.2/scripts/verify_windows_portable.py +290 -0
- granttrace-2.5.2/tests/test_cli_report_boundaries.py +206 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_diff_hardening.py +54 -0
- granttrace-2.5.2/tests/test_merge_patch_recovery.py +199 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_onboarding.py +3 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_onboarding_cli.py +3 -1
- granttrace-2.5.2/tests/test_parameter_compatibility.py +179 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_parameter_serialization.py +191 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_parser_generator_hardening.py +12 -1
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_rc2_security_hardening.py +1 -1
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_report_usability.py +8 -6
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_schema_regressions.py +97 -0
- granttrace-2.5.2/tests/test_spec_config_cross_checks.py +333 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_v22_auditor_hardening.py +15 -2
- granttrace-2.5.0/docs/release-checklist.md +0 -282
- {granttrace-2.5.0 → granttrace-2.5.2}/CONTRIBUTING.md +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/LICENSE +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/MANIFEST.in +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/SECURITY.md +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/config.example.json +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/config.schema.json +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/core/config_scaffold.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/core/demo.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/core/demo_assets/__init__.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/core/demo_assets/demo-config.json +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/core/demo_assets/mock-data.json +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/core/demo_assets/openapi.json +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/core/models.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/core/sarif.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/docs/assets/report-preview.png +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/docs/business-scenarios.md +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/docs/parameter-serialization.md +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/examples/README.md +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/granttrace.egg-info/dependency_links.txt +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/granttrace.egg-info/entry_points.txt +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/granttrace.egg-info/requires.txt +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/granttrace.egg-info/top_level.txt +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/mock_server/__init__.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/mock_server/server.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/openapi.json +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/scripts/verify_business_scenarios.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/scripts/verify_examples.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/scripts/verify_install.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/setup.cfg +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/test_suite.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_auditor_integration.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_business_authorization.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_config_scaffold.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_config_validation.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_curl_report.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_demo.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_diff.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_evidence.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_first_run_guidance.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_rc3_hardening.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_release_bola.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_release_config.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_release_evidence.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_release_identity.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_release_transactions.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_reproduction.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_sarif.py +0 -0
- {granttrace-2.5.0 → granttrace-2.5.2}/tests/test_sarif_cli.py +0 -0
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.5.2 - 2026-10-05
|
|
4
|
+
|
|
5
|
+
### Maintenance
|
|
6
|
+
|
|
7
|
+
- Documentation / distribution metadata maintenance release: package the current
|
|
8
|
+
README for the PyPI project page, retaining the corrected Windows download,
|
|
9
|
+
unsigned-program notice, macOS / Linux installation and workflow explanation.
|
|
10
|
+
- Align package/runtime versions and Windows portable filenames, launcher,
|
|
11
|
+
bundled instructions and release workflow metadata at `2.5.2`.
|
|
12
|
+
- No changes to BOLA / IDOR / Mass Assignment detection, the security model,
|
|
13
|
+
default read-only behavior, CLI semantics or core implementation.
|
|
14
|
+
|
|
15
|
+
## 2.5.1 - 2026-10-05
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Reject unsafe Merge Patch probes before writes when the original state cannot be restored exactly.
|
|
20
|
+
- Preserve array record associations during BOLA comparison to avoid overstating confirmed authorization bypasses.
|
|
21
|
+
- Harden report target/metadata redaction for known credentials and prevent report outputs from overwriting specification, configuration, or loaded local `$ref` inputs.
|
|
22
|
+
- Improve local and conditional schema resolution plus configuration-to-spec operation validation.
|
|
23
|
+
- Preserve legacy v2.5.0 scalar parameter configurations while applying strict schema-aware normalization and validation for canonical integer, number, and boolean values.
|
|
24
|
+
- Preserve Swagger 2.0 `uniqueItems` parameter constraints during schema extraction so duplicate configured arrays fail validation before requests.
|
|
25
|
+
|
|
3
26
|
## 2.5.0 - 2026-10-04
|
|
4
27
|
|
|
5
28
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: granttrace
|
|
3
|
-
Version: 2.5.
|
|
3
|
+
Version: 2.5.2
|
|
4
4
|
Summary: Safety-first OpenAPI authorization auditing tool for BOLA, IDOR and Mass Assignment testing
|
|
5
5
|
Author: GrantTrace contributors
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -28,28 +28,36 @@ Dynamic: license-file
|
|
|
28
28
|
# GrantTrace
|
|
29
29
|
|
|
30
30
|

|
|
31
|
+
[](https://pypi.org/project/granttrace/)
|
|
31
32
|

|
|
32
33
|

|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
**源码 / 包元数据版本:2.5.2** · [GitHub Releases](https://github.com/ysc070528/granttrace/releases) · [PyPI](https://pypi.org/project/granttrace/)
|
|
36
|
+
|
|
37
|
+
Windows 便携版已正式提供;已发布版本与下载资产以官方 GitHub Release / PyPI 页面实际列出的版本为准。
|
|
35
38
|
|
|
36
39
|
An OpenAPI authorization auditor that compares identities, verifies persisted changes, and reports restoration evidence.
|
|
37
40
|
|
|
38
41
|
安全优先、证据驱动的 OpenAPI 权限审计工具。检查 BOLA / IDOR 与 Mass Assignment,输出身份对比、持久化变更及恢复核验的 HTML / JSON 报告。默认只读;主动写测试须显式开启并配置允许清单与独立读回。
|
|
39
42
|
|
|
40
|
-
|
|
43
|
+
仅对明确获得授权的系统进行测试;主动写测试仅应在可丢弃、隔离的测试资源上启用。
|
|
41
44
|
|
|
42
|
-
##
|
|
45
|
+
## Windows 用户:解压后双击体验
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
- **Verify real side effects**:通过独立读回验证状态是否真正持久化,不只看 HTTP 状态码。
|
|
46
|
-
- **Restore safely**:主动 PATCH 测试使用显式 allowlist、原始状态快照、恢复与恢复验证。
|
|
47
|
+
**推荐 Windows 10 / 11(64 位),便携包无需安装 Python。** 从官方 [GitHub Release](https://github.com/ysc070528/granttrace/releases/latest) 选择对应版本下载:
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
1. 下载 Release 中的 Windows x64 ZIP(2.5.2 对应文件名为 **`GrantTrace-v2.5.2-Windows-x64.zip`**),将整个 ZIP 解压到一个普通文件夹。
|
|
50
|
+
2. 打开解压后的文件夹,双击 **`Start-Demo.bat`**;保留旁边的程序和依赖文件。
|
|
51
|
+
3. 查看自动打开的 HTML 报告;若未打开,按启动器打印的 HTML 路径手动打开。HTML / JSON 保存在解压目录的 `granttrace-demo/session-*/run-*/`。Demo 只使用内置、可丢弃的 `127.0.0.1` 靶场,结束时关闭靶场并核验数据恢复。
|
|
49
52
|
|
|
50
|
-
|
|
53
|
+
不要直接在 ZIP 内运行启动器。便携包版本以包内 `README.txt` 和 `.\granttrace.exe --version` 为准;程序、启动器和报告在解压目录内使用,不需要修改系统 PATH。维护者的构建与验收步骤见 [Windows 便携包说明](docs/windows-portable.md)。
|
|
51
54
|
|
|
52
|
-
|
|
55
|
+
Windows 便携程序尚未进行代码签名,部分系统可能显示 Microsoft Defender SmartScreen 或“发布者未知”提示。请只从官方 GitHub Release 下载,并使用同一 Release 的 **`SHA256SUMS.txt`** 核对完整性。
|
|
56
|
+
|
|
57
|
+
## macOS / Linux 用户:使用 Python 安装
|
|
58
|
+
|
|
59
|
+
需要 **Python 3.9+**;当前不提供 macOS / Linux standalone binary,Windows ZIP 仅适用于 Windows。
|
|
60
|
+
已有 Python 的 Windows 用户也可沿用此方式:
|
|
53
61
|
|
|
54
62
|
```bash
|
|
55
63
|
python -m pip install --upgrade granttrace
|
|
@@ -57,11 +65,38 @@ granttrace --version
|
|
|
57
65
|
granttrace demo
|
|
58
66
|
```
|
|
59
67
|
|
|
68
|
+
[Python 五分钟体验](#五分钟体验) · [完整示例报告](https://github.com/ysc070528/granttrace/blob/main/examples/sample_report.html) · [配置指南](https://github.com/ysc070528/granttrace/blob/main/docs/configuration.md) · [命令行与迁移](https://github.com/ysc070528/granttrace/blob/main/docs/advanced.md) · [验收记录](https://github.com/ysc070528/granttrace/blob/main/VERIFICATION.md) · [发布自检](https://github.com/ysc070528/granttrace/blob/main/docs/release-checklist.md)
|
|
69
|
+
|
|
70
|
+
## 为什么是 GrantTrace / Why GrantTrace
|
|
71
|
+
|
|
72
|
+
- **Compare identities**:比较 Owner / Visitor / Anonymous 等身份访问同一资源的结果。
|
|
73
|
+
- **Verify real side effects**:通过独立读回验证状态是否真正持久化,不只看 HTTP 状态码。
|
|
74
|
+
- **Restore safely**:主动 PATCH 测试使用显式 allowlist、原始状态快照、恢复与恢复验证。
|
|
75
|
+
|
|
76
|
+
## 10 秒看懂 GrantTrace
|
|
77
|
+
|
|
78
|
+
```mermaid
|
|
79
|
+
flowchart TD
|
|
80
|
+
A["OpenAPI Spec + Owner / Visitor / Anonymous"] --> B["GrantTrace"]
|
|
81
|
+
B --> C["只读身份差异比较(默认)"]
|
|
82
|
+
C --> R["HTML / JSON(可选 SARIF)"]
|
|
83
|
+
B -->|显式开启并满足写入安全条件| W["PATCH 测试"]
|
|
84
|
+
W --> D["独立 GET 读回"]
|
|
85
|
+
D --> E["恢复并验证"]
|
|
86
|
+
E --> R
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
<img src="https://raw.githubusercontent.com/ysc070528/granttrace/v2.5.1/docs/assets/report-preview.png" alt="GrantTrace 报告:身份访问摘要、修复建议和端点筛选" width="900">
|
|
90
|
+
|
|
91
|
+
## 五分钟体验
|
|
92
|
+
|
|
93
|
+
使用上方 Windows 启动器或 Python 安装命令,即可体验内置 `granttrace demo`。
|
|
94
|
+
|
|
60
95
|
安装后可在任意目录运行,无需 clone、准备配置、另开终端或访问外部 API。Demo 自动启动动态端口的 `127.0.0.1` 靶场,比较身份访问、演示 BOLA / IDOR 与 Mass Assignment,并通过独立读回与恢复核验展示 PATCH 测试证据。**主动写操作仅发生在内置、可丢弃的本机靶场**;demo 不接受外部 target 或用户凭据,结束时关闭靶场。
|
|
61
96
|
|
|
62
97
|
HTML / JSON 报告保留在当前目录的 `granttrace-demo/` 唯一子目录,终端会输出绝对路径,不覆盖已有报告。可选用 `granttrace demo --output-dir PATH` 指定报告父目录,或 `granttrace demo --read-only` 仅体验只读身份访问,发送 **0 PATCH**。
|
|
63
98
|
|
|
64
|
-
完整离线示例:[HTML 报告](examples/sample_report.html)(下载后用浏览器打开)与 [JSON 结果](examples/sample_result.json)。
|
|
99
|
+
完整离线示例:[HTML 报告](https://github.com/ysc070528/granttrace/blob/main/examples/sample_report.html)(下载后用浏览器打开)与 [JSON 结果](https://github.com/ysc070528/granttrace/blob/main/examples/sample_result.json)。
|
|
65
100
|
|
|
66
101
|
## 接入自己的 API
|
|
67
102
|
|
|
@@ -96,22 +131,22 @@ granttrace --spec your-openapi.yaml --target https://authorized-test.example \
|
|
|
96
131
|
|
|
97
132
|
6. **以后需要时再考虑主动 PATCH**:只有在专用可丢弃资源、独立 GET readback、字段映射、一致性和恢复路径均经人工确认后,才配置明确的 `write_allowlist` 并在真实扫描中单独添加 `--allow-write-tests`。允许清单存在不表示写测试已开启,运行时仍须满足写入与恢复条件。
|
|
98
133
|
|
|
99
|
-
OpenAPI 和离线验证不能证明资源归属、业务授权策略、合法测试权限、生产读回一致性或实际恢复能力;检查通过只代表配置结构及支持的语义通过当前检查。账户、API Key / Cookie、合法共享和管理员访问见 [配置指南](docs/configuration.md),输出与自动化兼容性见 [命令行说明](docs/advanced.md)。支持的数组、布尔值及 `style` / `explode` 编码见 [参数规则](docs/parameter-serialization.md)。接入实测前请核对 [安全边界](SECURITY.md)。
|
|
134
|
+
OpenAPI 和离线验证不能证明资源归属、业务授权策略、合法测试权限、生产读回一致性或实际恢复能力;检查通过只代表配置结构及支持的语义通过当前检查。账户、API Key / Cookie、合法共享和管理员访问见 [配置指南](https://github.com/ysc070528/granttrace/blob/main/docs/configuration.md),输出与自动化兼容性见 [命令行说明](https://github.com/ysc070528/granttrace/blob/main/docs/advanced.md)。支持的数组、布尔值及 `style` / `explode` 编码见 [参数规则](https://github.com/ysc070528/granttrace/blob/main/docs/parameter-serialization.md)。接入实测前请核对 [安全边界](https://github.com/ysc070528/granttrace/blob/main/SECURITY.md)。
|
|
100
135
|
|
|
101
136
|
## SARIF 导出
|
|
102
137
|
|
|
103
|
-
`--export-sarif PATH` 可与 HTML / JSON
|
|
138
|
+
`--export-sarif PATH` 可与 HTML / JSON 同时使用。启动下方仓库 mock 后,在明确授权、可丢弃的本机靶场执行;此命令会发送读取请求,默认 **0 PATCH**:
|
|
104
139
|
|
|
105
140
|
```bash
|
|
106
|
-
granttrace --spec
|
|
141
|
+
granttrace --spec openapi.json --target http://127.0.0.1:8080 --config config.example.json \
|
|
107
142
|
--export-json result.local.json --export-sarif granttrace.sarif -o report.html
|
|
108
143
|
```
|
|
109
144
|
|
|
110
|
-
SARIF 2.1.0 **只包含 CONFIRMED 的 BOLA / IDOR 与 Mass Assignment**;SUSPICIOUS / INCONCLUSIVE 不升级为漏洞,完整状态仍见 HTML / JSON。SARIF 始终脱敏且不导出原始响应或 headers,不能与 `--dry-run` 同用;各输出路径须独立。当前工作目录内的真实 OpenAPI spec 会作为相对 artifact location,不伪造源码行号,API endpoint 仍放在 message / properties。在 GitHub Actions 中从 checkout 的仓库根目录运行,再用 `upload-sarif` 上传;workspace 外的 spec 省略 location,绝不导出本机绝对路径,其结果无法展示为 GitHub Code Scanning alert。详见 [兼容说明](docs/advanced.md#sarif-导出)。
|
|
145
|
+
SARIF 2.1.0 **只包含 CONFIRMED 的 BOLA / IDOR 与 Mass Assignment**;SUSPICIOUS / INCONCLUSIVE 不升级为漏洞,完整状态仍见 HTML / JSON。SARIF 始终脱敏且不导出原始响应或 headers,不能与 `--dry-run` 同用;各输出路径须独立。当前工作目录内的真实 OpenAPI spec 会作为相对 artifact location,不伪造源码行号,API endpoint 仍放在 message / properties。在 GitHub Actions 中从 checkout 的仓库根目录运行,再用 `upload-sarif` 上传;workspace 外的 spec 省略 location,绝不导出本机绝对路径,其结果无法展示为 GitHub Code Scanning alert。详见 [兼容说明](https://github.com/ysc070528/granttrace/blob/main/docs/advanced.md#sarif-导出)。
|
|
111
146
|
|
|
112
147
|
## cURL 复现模板
|
|
113
148
|
|
|
114
|
-
HTML 确认漏洞卡片可提供安全的 POSIX shell cURL 模板和“复制 cURL”按钮。所有认证值均为 Visitor 占位符,即使使用 `--include-sensitive-evidence` 也不会放入模板。请只在明确授权的测试环境中填入自己的测试凭据;脱敏值需人工补全,信息不足时不提供按钮。离线报告支持复制 fallback,也可直接选择命令文本。详见 [复现说明](docs/advanced.md#curl-复现模板)。
|
|
149
|
+
HTML 确认漏洞卡片可提供安全的 POSIX shell cURL 模板和“复制 cURL”按钮。所有认证值均为 Visitor 占位符,即使使用 `--include-sensitive-evidence` 也不会放入模板。请只在明确授权的测试环境中填入自己的测试凭据;脱敏值需人工补全,信息不足时不提供按钮。离线报告支持复制 fallback,也可直接选择命令文本。详见 [复现说明](https://github.com/ysc070528/granttrace/blob/main/docs/advanced.md#curl-复现模板)。
|
|
115
150
|
|
|
116
151
|
## 从源码开发 / 运行仓库 mock
|
|
117
152
|
|
|
@@ -148,8 +183,8 @@ python scripts/verify_business_scenarios.py
|
|
|
148
183
|
python scripts/verify_install.py
|
|
149
184
|
```
|
|
150
185
|
|
|
151
|
-
测试直接使用仓库中的 `config.example.json`,无需创建本地凭据文件。[业务场景验收](docs/business-scenarios.md) 单独记录团队共享、管理员读取、跨租户拒绝和故意越权的真值、误报与漏报;[验收记录](VERIFICATION.md) 标明实际测试环境和范围。
|
|
186
|
+
测试直接使用仓库中的 `config.example.json`,无需创建本地凭据文件。[业务场景验收](https://github.com/ysc070528/granttrace/blob/main/docs/business-scenarios.md) 单独记录团队共享、管理员读取、跨租户拒绝和故意越权的真值、误报与漏报;[验收记录](https://github.com/ysc070528/granttrace/blob/main/VERIFICATION.md) 标明实际测试环境和范围。
|
|
152
187
|
|
|
153
|
-
“没有确认漏洞”不等于系统安全。检查覆盖率、错误、可疑和不确定项;显式授权预期只适用于本次身份与资源组合。仅在具备专用测试账户、独立读回和恢复方案的隔离环境启用写测试。远程 `$ref`、GraphQL、gRPC、自动 OAuth / mTLS 登录以及 POST / PUT 主动测试尚未实现。更多规则与迁移说明见 [操作指南](docs/advanced.md)。
|
|
188
|
+
“没有确认漏洞”不等于系统安全。检查覆盖率、错误、可疑和不确定项;显式授权预期只适用于本次身份与资源组合。仅在具备专用测试账户、独立读回和恢复方案的隔离环境启用写测试。远程 `$ref`、GraphQL、gRPC、自动 OAuth / mTLS 登录以及 POST / PUT 主动测试尚未实现。更多规则与迁移说明见 [操作指南](https://github.com/ysc070528/granttrace/blob/main/docs/advanced.md)。
|
|
154
189
|
|
|
155
190
|
Apache License 2.0。
|
|
@@ -1,28 +1,36 @@
|
|
|
1
1
|
# GrantTrace
|
|
2
2
|
|
|
3
3
|

|
|
4
|
+
[](https://pypi.org/project/granttrace/)
|
|
4
5
|

|
|
5
6
|

|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
**源码 / 包元数据版本:2.5.2** · [GitHub Releases](https://github.com/ysc070528/granttrace/releases) · [PyPI](https://pypi.org/project/granttrace/)
|
|
9
|
+
|
|
10
|
+
Windows 便携版已正式提供;已发布版本与下载资产以官方 GitHub Release / PyPI 页面实际列出的版本为准。
|
|
8
11
|
|
|
9
12
|
An OpenAPI authorization auditor that compares identities, verifies persisted changes, and reports restoration evidence.
|
|
10
13
|
|
|
11
14
|
安全优先、证据驱动的 OpenAPI 权限审计工具。检查 BOLA / IDOR 与 Mass Assignment,输出身份对比、持久化变更及恢复核验的 HTML / JSON 报告。默认只读;主动写测试须显式开启并配置允许清单与独立读回。
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
仅对明确获得授权的系统进行测试;主动写测试仅应在可丢弃、隔离的测试资源上启用。
|
|
14
17
|
|
|
15
|
-
##
|
|
18
|
+
## Windows 用户:解压后双击体验
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
- **Verify real side effects**:通过独立读回验证状态是否真正持久化,不只看 HTTP 状态码。
|
|
19
|
-
- **Restore safely**:主动 PATCH 测试使用显式 allowlist、原始状态快照、恢复与恢复验证。
|
|
20
|
+
**推荐 Windows 10 / 11(64 位),便携包无需安装 Python。** 从官方 [GitHub Release](https://github.com/ysc070528/granttrace/releases/latest) 选择对应版本下载:
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
1. 下载 Release 中的 Windows x64 ZIP(2.5.2 对应文件名为 **`GrantTrace-v2.5.2-Windows-x64.zip`**),将整个 ZIP 解压到一个普通文件夹。
|
|
23
|
+
2. 打开解压后的文件夹,双击 **`Start-Demo.bat`**;保留旁边的程序和依赖文件。
|
|
24
|
+
3. 查看自动打开的 HTML 报告;若未打开,按启动器打印的 HTML 路径手动打开。HTML / JSON 保存在解压目录的 `granttrace-demo/session-*/run-*/`。Demo 只使用内置、可丢弃的 `127.0.0.1` 靶场,结束时关闭靶场并核验数据恢复。
|
|
22
25
|
|
|
23
|
-
|
|
26
|
+
不要直接在 ZIP 内运行启动器。便携包版本以包内 `README.txt` 和 `.\granttrace.exe --version` 为准;程序、启动器和报告在解压目录内使用,不需要修改系统 PATH。维护者的构建与验收步骤见 [Windows 便携包说明](docs/windows-portable.md)。
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
Windows 便携程序尚未进行代码签名,部分系统可能显示 Microsoft Defender SmartScreen 或“发布者未知”提示。请只从官方 GitHub Release 下载,并使用同一 Release 的 **`SHA256SUMS.txt`** 核对完整性。
|
|
29
|
+
|
|
30
|
+
## macOS / Linux 用户:使用 Python 安装
|
|
31
|
+
|
|
32
|
+
需要 **Python 3.9+**;当前不提供 macOS / Linux standalone binary,Windows ZIP 仅适用于 Windows。
|
|
33
|
+
已有 Python 的 Windows 用户也可沿用此方式:
|
|
26
34
|
|
|
27
35
|
```bash
|
|
28
36
|
python -m pip install --upgrade granttrace
|
|
@@ -30,11 +38,38 @@ granttrace --version
|
|
|
30
38
|
granttrace demo
|
|
31
39
|
```
|
|
32
40
|
|
|
41
|
+
[Python 五分钟体验](#五分钟体验) · [完整示例报告](https://github.com/ysc070528/granttrace/blob/main/examples/sample_report.html) · [配置指南](https://github.com/ysc070528/granttrace/blob/main/docs/configuration.md) · [命令行与迁移](https://github.com/ysc070528/granttrace/blob/main/docs/advanced.md) · [验收记录](https://github.com/ysc070528/granttrace/blob/main/VERIFICATION.md) · [发布自检](https://github.com/ysc070528/granttrace/blob/main/docs/release-checklist.md)
|
|
42
|
+
|
|
43
|
+
## 为什么是 GrantTrace / Why GrantTrace
|
|
44
|
+
|
|
45
|
+
- **Compare identities**:比较 Owner / Visitor / Anonymous 等身份访问同一资源的结果。
|
|
46
|
+
- **Verify real side effects**:通过独立读回验证状态是否真正持久化,不只看 HTTP 状态码。
|
|
47
|
+
- **Restore safely**:主动 PATCH 测试使用显式 allowlist、原始状态快照、恢复与恢复验证。
|
|
48
|
+
|
|
49
|
+
## 10 秒看懂 GrantTrace
|
|
50
|
+
|
|
51
|
+
```mermaid
|
|
52
|
+
flowchart TD
|
|
53
|
+
A["OpenAPI Spec + Owner / Visitor / Anonymous"] --> B["GrantTrace"]
|
|
54
|
+
B --> C["只读身份差异比较(默认)"]
|
|
55
|
+
C --> R["HTML / JSON(可选 SARIF)"]
|
|
56
|
+
B -->|显式开启并满足写入安全条件| W["PATCH 测试"]
|
|
57
|
+
W --> D["独立 GET 读回"]
|
|
58
|
+
D --> E["恢复并验证"]
|
|
59
|
+
E --> R
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
<img src="https://raw.githubusercontent.com/ysc070528/granttrace/v2.5.1/docs/assets/report-preview.png" alt="GrantTrace 报告:身份访问摘要、修复建议和端点筛选" width="900">
|
|
63
|
+
|
|
64
|
+
## 五分钟体验
|
|
65
|
+
|
|
66
|
+
使用上方 Windows 启动器或 Python 安装命令,即可体验内置 `granttrace demo`。
|
|
67
|
+
|
|
33
68
|
安装后可在任意目录运行,无需 clone、准备配置、另开终端或访问外部 API。Demo 自动启动动态端口的 `127.0.0.1` 靶场,比较身份访问、演示 BOLA / IDOR 与 Mass Assignment,并通过独立读回与恢复核验展示 PATCH 测试证据。**主动写操作仅发生在内置、可丢弃的本机靶场**;demo 不接受外部 target 或用户凭据,结束时关闭靶场。
|
|
34
69
|
|
|
35
70
|
HTML / JSON 报告保留在当前目录的 `granttrace-demo/` 唯一子目录,终端会输出绝对路径,不覆盖已有报告。可选用 `granttrace demo --output-dir PATH` 指定报告父目录,或 `granttrace demo --read-only` 仅体验只读身份访问,发送 **0 PATCH**。
|
|
36
71
|
|
|
37
|
-
完整离线示例:[HTML 报告](examples/sample_report.html)(下载后用浏览器打开)与 [JSON 结果](examples/sample_result.json)。
|
|
72
|
+
完整离线示例:[HTML 报告](https://github.com/ysc070528/granttrace/blob/main/examples/sample_report.html)(下载后用浏览器打开)与 [JSON 结果](https://github.com/ysc070528/granttrace/blob/main/examples/sample_result.json)。
|
|
38
73
|
|
|
39
74
|
## 接入自己的 API
|
|
40
75
|
|
|
@@ -69,22 +104,22 @@ granttrace --spec your-openapi.yaml --target https://authorized-test.example \
|
|
|
69
104
|
|
|
70
105
|
6. **以后需要时再考虑主动 PATCH**:只有在专用可丢弃资源、独立 GET readback、字段映射、一致性和恢复路径均经人工确认后,才配置明确的 `write_allowlist` 并在真实扫描中单独添加 `--allow-write-tests`。允许清单存在不表示写测试已开启,运行时仍须满足写入与恢复条件。
|
|
71
106
|
|
|
72
|
-
OpenAPI 和离线验证不能证明资源归属、业务授权策略、合法测试权限、生产读回一致性或实际恢复能力;检查通过只代表配置结构及支持的语义通过当前检查。账户、API Key / Cookie、合法共享和管理员访问见 [配置指南](docs/configuration.md),输出与自动化兼容性见 [命令行说明](docs/advanced.md)。支持的数组、布尔值及 `style` / `explode` 编码见 [参数规则](docs/parameter-serialization.md)。接入实测前请核对 [安全边界](SECURITY.md)。
|
|
107
|
+
OpenAPI 和离线验证不能证明资源归属、业务授权策略、合法测试权限、生产读回一致性或实际恢复能力;检查通过只代表配置结构及支持的语义通过当前检查。账户、API Key / Cookie、合法共享和管理员访问见 [配置指南](https://github.com/ysc070528/granttrace/blob/main/docs/configuration.md),输出与自动化兼容性见 [命令行说明](https://github.com/ysc070528/granttrace/blob/main/docs/advanced.md)。支持的数组、布尔值及 `style` / `explode` 编码见 [参数规则](https://github.com/ysc070528/granttrace/blob/main/docs/parameter-serialization.md)。接入实测前请核对 [安全边界](https://github.com/ysc070528/granttrace/blob/main/SECURITY.md)。
|
|
73
108
|
|
|
74
109
|
## SARIF 导出
|
|
75
110
|
|
|
76
|
-
`--export-sarif PATH` 可与 HTML / JSON
|
|
111
|
+
`--export-sarif PATH` 可与 HTML / JSON 同时使用。启动下方仓库 mock 后,在明确授权、可丢弃的本机靶场执行;此命令会发送读取请求,默认 **0 PATCH**:
|
|
77
112
|
|
|
78
113
|
```bash
|
|
79
|
-
granttrace --spec
|
|
114
|
+
granttrace --spec openapi.json --target http://127.0.0.1:8080 --config config.example.json \
|
|
80
115
|
--export-json result.local.json --export-sarif granttrace.sarif -o report.html
|
|
81
116
|
```
|
|
82
117
|
|
|
83
|
-
SARIF 2.1.0 **只包含 CONFIRMED 的 BOLA / IDOR 与 Mass Assignment**;SUSPICIOUS / INCONCLUSIVE 不升级为漏洞,完整状态仍见 HTML / JSON。SARIF 始终脱敏且不导出原始响应或 headers,不能与 `--dry-run` 同用;各输出路径须独立。当前工作目录内的真实 OpenAPI spec 会作为相对 artifact location,不伪造源码行号,API endpoint 仍放在 message / properties。在 GitHub Actions 中从 checkout 的仓库根目录运行,再用 `upload-sarif` 上传;workspace 外的 spec 省略 location,绝不导出本机绝对路径,其结果无法展示为 GitHub Code Scanning alert。详见 [兼容说明](docs/advanced.md#sarif-导出)。
|
|
118
|
+
SARIF 2.1.0 **只包含 CONFIRMED 的 BOLA / IDOR 与 Mass Assignment**;SUSPICIOUS / INCONCLUSIVE 不升级为漏洞,完整状态仍见 HTML / JSON。SARIF 始终脱敏且不导出原始响应或 headers,不能与 `--dry-run` 同用;各输出路径须独立。当前工作目录内的真实 OpenAPI spec 会作为相对 artifact location,不伪造源码行号,API endpoint 仍放在 message / properties。在 GitHub Actions 中从 checkout 的仓库根目录运行,再用 `upload-sarif` 上传;workspace 外的 spec 省略 location,绝不导出本机绝对路径,其结果无法展示为 GitHub Code Scanning alert。详见 [兼容说明](https://github.com/ysc070528/granttrace/blob/main/docs/advanced.md#sarif-导出)。
|
|
84
119
|
|
|
85
120
|
## cURL 复现模板
|
|
86
121
|
|
|
87
|
-
HTML 确认漏洞卡片可提供安全的 POSIX shell cURL 模板和“复制 cURL”按钮。所有认证值均为 Visitor 占位符,即使使用 `--include-sensitive-evidence` 也不会放入模板。请只在明确授权的测试环境中填入自己的测试凭据;脱敏值需人工补全,信息不足时不提供按钮。离线报告支持复制 fallback,也可直接选择命令文本。详见 [复现说明](docs/advanced.md#curl-复现模板)。
|
|
122
|
+
HTML 确认漏洞卡片可提供安全的 POSIX shell cURL 模板和“复制 cURL”按钮。所有认证值均为 Visitor 占位符,即使使用 `--include-sensitive-evidence` 也不会放入模板。请只在明确授权的测试环境中填入自己的测试凭据;脱敏值需人工补全,信息不足时不提供按钮。离线报告支持复制 fallback,也可直接选择命令文本。详见 [复现说明](https://github.com/ysc070528/granttrace/blob/main/docs/advanced.md#curl-复现模板)。
|
|
88
123
|
|
|
89
124
|
## 从源码开发 / 运行仓库 mock
|
|
90
125
|
|
|
@@ -121,8 +156,8 @@ python scripts/verify_business_scenarios.py
|
|
|
121
156
|
python scripts/verify_install.py
|
|
122
157
|
```
|
|
123
158
|
|
|
124
|
-
测试直接使用仓库中的 `config.example.json`,无需创建本地凭据文件。[业务场景验收](docs/business-scenarios.md) 单独记录团队共享、管理员读取、跨租户拒绝和故意越权的真值、误报与漏报;[验收记录](VERIFICATION.md) 标明实际测试环境和范围。
|
|
159
|
+
测试直接使用仓库中的 `config.example.json`,无需创建本地凭据文件。[业务场景验收](https://github.com/ysc070528/granttrace/blob/main/docs/business-scenarios.md) 单独记录团队共享、管理员读取、跨租户拒绝和故意越权的真值、误报与漏报;[验收记录](https://github.com/ysc070528/granttrace/blob/main/VERIFICATION.md) 标明实际测试环境和范围。
|
|
125
160
|
|
|
126
|
-
“没有确认漏洞”不等于系统安全。检查覆盖率、错误、可疑和不确定项;显式授权预期只适用于本次身份与资源组合。仅在具备专用测试账户、独立读回和恢复方案的隔离环境启用写测试。远程 `$ref`、GraphQL、gRPC、自动 OAuth / mTLS 登录以及 POST / PUT 主动测试尚未实现。更多规则与迁移说明见 [操作指南](docs/advanced.md)。
|
|
161
|
+
“没有确认漏洞”不等于系统安全。检查覆盖率、错误、可疑和不确定项;显式授权预期只适用于本次身份与资源组合。仅在具备专用测试账户、独立读回和恢复方案的隔离环境启用写测试。远程 `$ref`、GraphQL、gRPC、自动 OAuth / mTLS 登录以及 POST / PUT 主动测试尚未实现。更多规则与迁移说明见 [操作指南](https://github.com/ysc070528/granttrace/blob/main/docs/advanced.md)。
|
|
127
162
|
|
|
128
163
|
Apache License 2.0。
|