- Add internal/audit package: Event struct, FileSink, date rotation, L1 hash chain, HTTP forwarding, 3-tier redaction - Integrate with runner: emit audit event in executeInvocation defer - Add dws audit tail/export/verify command group - Register DWS_AUDIT* env vars in configmeta, enabled by default
31 lines
1001 B
Go
31 lines
1001 B
Go
package audit
|
|
|
|
import "time"
|
|
|
|
type Event struct {
|
|
Timestamp time.Time `json:"ts"`
|
|
ExecutionID string `json:"execution_id"`
|
|
AgentID string `json:"agent_id,omitempty"`
|
|
Actor Actor `json:"actor"`
|
|
Product string `json:"product"`
|
|
Command string `json:"command"`
|
|
Endpoint string `json:"endpoint"`
|
|
ParamsSummary string `json:"params_summary,omitempty"`
|
|
Result string `json:"result"`
|
|
ErrCategory string `json:"error_category,omitempty"`
|
|
ErrReason string `json:"error_reason,omitempty"`
|
|
DurationMs int64 `json:"duration_ms"`
|
|
CLIVersion string `json:"cli_version"`
|
|
OS string `json:"os"`
|
|
Arch string `json:"arch"`
|
|
PrevHash string `json:"prev_hash"`
|
|
Hash string `json:"hash"`
|
|
}
|
|
|
|
type Actor struct {
|
|
UserID string `json:"user_id"`
|
|
Name string `json:"name,omitempty"`
|
|
CorpID string `json:"corp_id"`
|
|
CorpName string `json:"corp_name,omitempty"`
|
|
}
|