Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ build/
target/
audit-report/
output/
tmp/
.idea/
.vscode/
.java-audit-cache/
Expand Down
23 changes: 23 additions & 0 deletions .java-audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Java Audit Lab scans its own repository only for release hygiene.
# Deliberately vulnerable corpora, demos, packaged benchmarks, and local tooling
# are evaluated by their dedicated test commands instead of the self-scan.
scanners:
- builtin
- secrets
- taint
fail_on: "none"
cache: true
exclude_paths:
- corpus/*
- examples/*
- audit/benchmarks/*
- .venv/*
- venv/*
- .m2-test/*
- tmp/*
extra_rules: []
public_endpoints: []
report_owner: ""
authorization_ref: ""
scope_note: "Java Audit Lab 自身仓库;故意存在漏洞的语料、示例和基准样本已排除"
retention_note: "本地自检报告不提交到仓库;公开前检查路径与环境信息"
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 2.0.1(2026-10-12)

**主题:扫描范围可信度与发布收尾。**

- 默认忽略 `.venv`、`venv`、`.m2-test`、`tmp` 与 `__pycache__`,避免依赖、缓存和临时材料污染文件清单或重复产生发现
- 将 `corpus`、`benchmarks` 与 `fixtures` 明确标记为测试语料,不再误归类为生产代码
- 无基线的首次扫描显示“尚未建立基线”,不再把全部发现误称为“基线新增”
- 报告顶部按生产代码、测试语料和示例代码拆分线索,并单列人工确认漏洞数
- 扫描器图表改用归并后主来源计数,合计与最终线索一致
- 报告增加语言覆盖边界和缺少 Java 构建清单提示,明确 Python 等文件只进入清单、不进入内置 Java 规则分析
- 新增仓库自身 `.java-audit.yml`,自检时排除故意存在漏洞的语料、示例与基准样本
- 修正 PR 审计示例的安装方式并更新 v2.0.1 发布清单

## 2.0.0(2026-10-12)

**主题:验证闭环。** 从「能报出发现」到「能证明发现的质量」——内置匿名评测语料、
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ jal . --yes -f high --json-summary > summary.json
{
"schema_version": "jal-summary/1",
"status": "ok",
"tool": {"name": "java-audit-lab", "version": "2.0.0"},
"tool": {"name": "java-audit-lab", "version": "2.0.1"},
"target": "/path/to/project",
"scanners": ["builtin", "secrets", "taint"],
"counts": {"findings": 12, "by_severity": {}, "by_scanner": {}},
Expand Down Expand Up @@ -316,6 +316,7 @@ Pull Request 自动增量审计的 Actions 示例见 [`examples/github-actions/p

## 当前边界

- 内置规则与 `taint` 只分析 Java `.java`;配置凭据扫描覆盖 YAML、JSON、XML、Properties 与 `.env`。Python、JavaScript/TypeScript、Go、PHP 和 C# 文件可能出现在项目清单中,但当前不由内置代码规则分析。
- `builtin` 与 `taint` 目前不提供完整的跨方法、跨模块路径证明。
- 未识别到权限声明表示证据缺失,不代表接口一定没有访问控制。
- 反射、动态分派、运行时配置和生成源码可能降低静态分析覆盖率。
Expand Down
1 change: 1 addition & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ Roadmap priority will follow reproducible Java samples and regression tests. Ope

## Current limitations

- Built-in rules and `taint` analyze Java `.java` files only. Configuration-secret scanning covers YAML, JSON, XML, Properties, and `.env`. Python, JavaScript/TypeScript, Go, PHP, and C# files may appear in the inventory but are not analyzed by the built-in code rules.
- `builtin` and `taint` do not yet prove complete interprocedural or cross-module paths.
- Missing authorization evidence does not prove that an endpoint is unprotected.
- Reflection, dynamic dispatch, runtime configuration, and generated source may reduce coverage.
Expand Down
45 changes: 29 additions & 16 deletions RELEASE_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
# Java Audit Lab 1.9.0 发布清单
# Java Audit Lab 2.0.1 发布清单

## 发布前

- [x] 源码、包元数据和命令行版本统一为 1.9.0
- [x] 单元与回归测试通过
- [x] 内置规则基准通过
- [x] 源码、包元数据和命令行版本统一为 2.0.1
- [x] 默认排除虚拟环境、缓存与临时目录
- [x] 测试语料、示例代码与生产代码在报告中分开统计
- [x] 无基线时不再把首次发现显示为“基线新增”
- [x] 扫描器贡献按归并后主来源统计
- [x] 报告和中英文 README 明确语言覆盖边界
- [x] 仓库自身配置排除故意存在漏洞的语料、示例与基准样本
- [x] 120 项单元与回归测试全部通过
- [x] 内置规则基准通过(Precision / Recall 100%)
- [x] train + validation 严格评测通过
- [x] 独立 holdout 严格评测通过
- [x] HTML 内联 JavaScript 语法通过 Node.js 校验
- [x] 验证任务卡不生成攻击载荷,也不会自动连接目标
- [x] 配置凭据扫描不会把原值写入证据或指纹
- [x] 用独立真实 Java 项目完成复扫
- [x] 在新的虚拟环境安装 wheel,并验证版本、内置基准和验证台账可用
- [x] 检查待提交文件:项目自身配置扫描为 0,真实业务报告、本机缓存和内部复核记录均已忽略
- [x] 构建 wheel,并在隔离安装目录验证版本与内置基准
- [x] 自身仓库扫描为 0 条;完整语料扫描正确拆分为测试语料 50、示例代码 17、生产代码 0
- [x] 检查 Git 工作区,只包含计划发布的文件

## 开源平台
## GitHub 发布

- [x] 创建远程仓库并推送 `main`
- [x] 设置仓库简介、主题标签和 MIT License 展示
- [ ] 创建 `v1.9.0` 标签与 Release,附 wheel 和变更说明
- [ ] 开启 Issues 与安全漏洞私密报告
- [ ] 配置分支保护和测试工作流
- [ ] 合并修复分支到 `main`
- [ ] 确认 `main` CI 全部通过
- [ ] 创建 `v2.0.1` 标签
- [ ] 创建 GitHub Release,并附 wheel、变更说明和校验值
- [ ] 确认 README Release 徽章显示 2.0.1
- [ ] 用发布后的标签验证 `examples/github-actions/pr-audit.yml`

发布动作需要仓库地址与账号授权,本地发布候选完成后再执行。
发布附件建议包括:

- `java_audit_lab-2.0.1-py3-none-any.whl`
- `SHA256SUMS.txt`
- `CHANGELOG.md` 中的 2.0.1 说明

标签和 Release 必须在修复分支合并且 CI 通过后创建,避免发布内容与标签不一致。
2 changes: 1 addition & 1 deletion audit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Java Audit Lab."""

__version__ = "2.0.0"
__version__ = "2.0.1"
6 changes: 6 additions & 0 deletions audit/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ def load_config(path: Path | None) -> dict[str, Any]:
raise ValueError("配置文件顶层必须是对象")
result = dict(DEFAULTS)
result.update(loaded)
# YAML commonly treats the bare scalar `none` as null. For fail_on it means
# the documented "do not fail on findings" policy, not Python None.
if result.get("fail_on") is None:
result["fail_on"] = "none"
if not isinstance(result["scanners"], list):
raise ValueError("scanners 必须是列表")
if result["fail_on"] not in {"none", "critical", "high", "medium", "low"}:
raise ValueError("fail_on 必须是 none、critical、high、medium 或 low")
if not isinstance(result["exclude_paths"], list):
raise ValueError("exclude_paths 必须是列表")
if not isinstance(result["extra_rules"], list):
Expand Down
8 changes: 7 additions & 1 deletion audit/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
from pathlib import Path


IGNORED_DIRS = {".git", ".gradle", ".idea", ".mvn", ".java-audit-cache", "audit-report", "build", "dist", "node_modules", "out", "output", "target"}
IGNORED_DIRS = {
".git", ".gradle", ".idea", ".mvn", ".m2-test", ".java-audit-cache",
".venv", "venv", "__pycache__", "audit-report", "build", "dist",
"node_modules", "out", "output", "target", "tmp",
}
CONFIG_SUFFIXES = {".yml", ".yaml", ".properties", ".xml", ".json", ".env"}
SOURCE_SUFFIXES = {".java", ".kt", ".kts", ".groovy", ".scala"}
WEB_SUFFIXES = {".jsp", ".jspx", ".html", ".htm", ".js", ".ts", ".css", ".vue"}
Expand Down Expand Up @@ -121,6 +125,8 @@ def source_scope(path: str | Path) -> str:
joined = "/".join(parts)
if "generated" in parts or "build/generated" in joined or "target/generated" in joined:
return "generated"
if "corpus" in parts or any(part in {"benchmark", "benchmarks", "fixture", "fixtures"} for part in parts):
return "fixture"
if "src/test" in joined or "src/it" in joined or "test" in parts or "tests" in parts:
return "test"
if any(part in {"example", "examples", "sample", "samples", "demo", "demos"} for part in parts):
Expand Down
Loading
Loading