Commit Graph
6 Commits
Author SHA1 Message Date
BaaRai e233c02314 Translate all Chinese text to English
Comments, doc comments, UI labels, log and error messages, LLM prompt
strings, markdown docs, test data and assertions. Identifiers, enum
keys, routes, placeholders and code structure are unchanged.

Notes:
- docs/漏洞流量证据.md renamed to docs/vulnerability-traffic-evidence.md
- tests that exercised CJK specific handling (GBK zip names, Chinese
  full text search) now use ASCII equivalents; go build passes and the
  test suite matches the pre translation baseline (remaining failures
  need a PostgreSQL DSN and fail identically on the original)
- frontend mention syntax now uses English kinds (finding, asset, ...)
  matching the backend, chat mentions tests pass
2026-10-08 23:14:34 +02:00
Autumn-27 56538bc3ef fix(assets): ip 字段拒收主机名,并告诉调用方该怎么改
上一次修复让非法 ip 不再打挂企业归属重算,但脏数据仍在持续产生。这次从源头
拦住:assets.ip 会被转成 inet 参与网段归属,存主机名的资产对所有 IP/CIDR
范围规则都是隐形的。

- db 层新增 ValidateAssetIP + ErrAssetIPInvalid,在 UpsertIP /
  UpsertHTTPService / UpsertOtherService / UpsertEndpoint 四个入口校验。
  放在 db 层是因为 Agent 工具和资产 API 都经由它们,不必写两遍;内部调用方
  (enrich 的解析结果、task_assets 的 ParseCIDR 输出、RecordValue 已 ParseIP
  过滤的分支)传的本就是合法地址,不受影响。
- 错误信息给的是改法而不只是「非法」:带上收到的原值,并指出主机名应改用
  type=subdomain 填 domain,或先解析 A/AAAA 记录再填 ip。insert_assets 的
  错误是逐条返回的({index, error}),同批其余资产照常入库,Agent 拿到后能
  定位到具体那条并在下一轮自行修正。
- 同步收紧 insert_assets 的工具描述与 ip 字段说明,在提示层先挡一道。
- 空 ip 仍然合法:service / endpoint 的 ip 是可选字段。

验证: 新增 db 层四类型拒收测试与 agent 层「一批混入一条非法、其余照常入库」
测试,均连 PG 实跑通过;干净库 go test -p 1 ./... 无新增失败(仅剩既有的
TestCompanyScopeInvalid)。
2026-08-24 10:32:10 -04:00
pphua 980cf82282 feat(assets): add editable company and task scopes 2026-08-24 19:29:14 +08:00
Autumn-27andClaude Opus 4.8 88e536f30c feat(asset): 新增按 host 精确删除资产的工具 delete_assets_by_host
DeleteByHost(host):DomainKey 归一化后按 domain/root_domain/ip 精确等值删除,
连带该 host 下的 service/endpoint;传根域名会连带其子域名。exploration_anchors
为 ON DELETE CASCADE,删除不被外键阻塞。工具层 delete_assets_by_host 返回按类型
分组的删除计数。硬删除、作用于全局资产库、不可撤销。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-09 04:18:21 -04:00
Autumn-27andClaude Opus 5 3e5b9a907f fix(asset): insert_assets 由程序权威赋 task_id + service/endpoint 补建 subdomain/root_domain
- insert_assets 不再把 task_id 暴露给模型/依赖模型传:schema 去掉 task_id,handler 直接用 SetTaskID 设的 t.taskID,避免模型漏传/错传导致资产未归任务或归错任务。
- UpsertHTTPService/UpsertOtherService/UpsertEndpoint 新增 side effect linkHostAssets:把 host 反向登记为独立 root_domain + subdomain 资产(非 apex、非 IP 才建 subdomain);endpoint 原来无任何 side effect,现补建 root_domain/subdomain/IP。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-08 07:54:17 -04:00
Autumn-27andClaude Opus 4.8 0ef8561411 chore: ARTEX 初始化
ARTEX — AI 自主渗透测试系统(Go 后端 + Next.js 前端,单二进制内嵌)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 04:27:45 -04:00