MSP-8299 - add new command - config audit

This commit is contained in:
ziminis committed 2026-11-27 17:07:39 +07:00
1 parent 7670e2bfe8
commit af75a06f9e
8 files changed
+586 -6

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
package model
import "encoding/json"
// AuditModule is a module with its raw config schema; the raw form keeps the
// x-ui-exposed keyword that a typed unmarshal may drop.
type AuditModule struct {
Id string
Name string
ConfigSchema json.RawMessage
}
// AuditViolation names a config field that violates the secret policy in the
// module's active config: a UI-exposed field referencing a SECRET variable,
// or a sensitive field holding a plain value or a non-SECRET reference.
type AuditViolation struct {
Module string
Path string
Variables []string
Reason string
}
+2
View File
@@ -11,6 +11,8 @@ const (
SecretVariableType = "SECRET"
TextVariableType = "TEXT"
ErrCodeModuleNotFound = 2001
ErrCodeConfigNotFound = 2002
ErrCodeVariableNotFound = 2006
)