← 返回列表
D

@eco-dsh/eco-audit-chain

v0.3.0 · 0 天前发布

dsh plugin: SM3 tamper-evident execution audit chain (port of eco-agent trace_audit.py)

dshdsh-plugincordisauditsm3hash-chaintamper-evidenteco-agent

README

eco-audit-chain

dsh plugin — SM3 防篡改执行审计链。

移植自 xiejianjun000/eco-agent 的 agent_core/trace_audit.py(MIT License),保留五要素账本 + SM3 哈希链设计。

作用

每次工具调用记录五要素(when / who / what / result / cost)并锁进 SM3 哈希链:


current_hash = SM3(prev_hash + timestamp + operation + input_hash + output_hash)

任何对历史记录的篡改都会导致链断裂,verify() 重算每一行并报告首个不匹配位置。内置纯 TS 零依赖 SM3 实现(sm3.ts),无需原生模块。

v0.2.0 — 查询增强

  • eco_audit_query 支持多维过滤:decision(allow/deny/ask)、level(L1-L4)、operation、who、keyword(正文子串)、from/to(时间范围)、offset 分页。

  • 新增 eco_audit_summary:按决策 / 风险级别 / 操作类型 / 小时维度聚合统计,返回 denied_total 等安全态势指标。
  • v0.3.0 — 归档轮转与导出

  • 新增 maxEntries 配置:live 链超过条数后自动归档为 trace_audit_<ts>.jsonl 并从 genesis 开启新链——不截断、不断链,历史归档仍可完整 verify()。

  • 新增 `eco_a
  • 版本兼容矩阵

    DSH 版本状态说明
    dsh@0.1.0-rc.6 ❓ 未知 metadata 缺失
    dsh@0.1.0 ❓ 未知 —
    dsh@0.2.0 ⚠️ 待验证 待实测(API 可能在变)
    dsh@0.3.0+ ❓ 未知 尚未发布

    💡 兼容矩阵每周末自动跑实测,欢迎 PR 修正

    元数据

    License
    MIT
    npm
    @eco-dsh/eco-audit-chain
    Repo
    —
    Engines
    {}
    Weekly DL
    0
    Monthly DL
    0
    dsh.bundle
    {}