5C DB audit 邊界分析

返回文件索引

5C 的目標是先固定 DB audit 的事件語意、資料邊界、候選程式位置、測試策略與停止線。使用者完成七項確認前,不修改程式 repo,不新增 audit table,不執行 DDL / ALTER TABLE / formal Apply,也不對真實 DB 寫入資料。

0. 文件狀態

項目內容
文件狀態已建立,等待 5C 七項確認
建立日期2026-06-07
對應節點第五階段 5C DB audit
程式基準1f635d6,5B config schema 已完成
本次是否修改程式 repo否,只做唯讀檢查、測試基準與文件整理

1. 5C 目標

目標說明
固定 audit event 語意先定義 PluginLoader / external DLL / config gate / manual verification 的安全 audit event。
建立資料最小化原則只記錄安全摘要、決策、錯誤碼、操作者摘要、時間與關聯 id。
先 fake writer第一版建議先做 Application 層 audit writer contract 與 fake writer 測試。
分離 DDL 與真實 DB 寫入audit table schema、DDL dry-run、manual DB write / read / cleanup 必須拆成後續確認。

2. 事件範圍草案

事件類型建議用途是否納入 5C 最小實作
PluginMetadataReviewed記錄 metadata 被接受、拒絕或需人工確認。可納入 fake writer。
ExternalDllManualVerificationRequested記錄外部 DLL manual-only 驗證請求摘要。可納入 fake writer,但不保存檔案路徑。
ConfigSchemaValidated記錄 5B config schema 驗證結果摘要。可納入 fake writer,但不保存原始設定內容。

3. 唯讀檢查與測試

項目結果
程式 repo 狀態poc/nmodbus-tcp...origin/poc/nmodbus-tcp,乾淨。
現有 audit modelPluginAuditRecord 已存在於 Application 層,僅保存安全摘要,不負責 DB 寫入。
Infrastructure.MySql tests89 passed / 0 failed / 0 skipped。
Solution tests516 passed / 0 failed / 0 skipped。

4. 明確排除

5. 下一步

請先確認 5C DB audit 實作前確認表 七項。確認前,只能停留在文件、唯讀檢查與測試基準。