Files
aiops/backend/model/audit_setting.go
T
Logan.Li e0d652d211 feat: 完善堡垒机与 Agent 智能运维能力
- 支持 Windows Agent 构建、安装脚本和统一上报协议

- 增强 RDP 剪贴板、虚拟盘和文件传输能力

- 新增 AIOps 上下文工具、告警 RCA trace 落库和回放接口

- 重构 docs 模块文档并补充终端、堡垒机、监控、AI Agent 设计
2026-07-05 23:49:36 +08:00

37 lines
1.7 KiB
Go

package model
import "time"
// AuditSettings 审计策略配置(单行) // Logan.Li
type AuditSettings struct {
ID uint `gorm:"primarykey" json:"id"`
RetentionDays int `gorm:"default:180;not null" json:"retention_days"`
RecordAll bool `gorm:"default:true" json:"record_all"`
SessionWatermarkEnabled bool `gorm:"default:true;not null" json:"session_watermark_enabled"`
SessionRecordEnabled bool `gorm:"default:true;not null" json:"session_record_enabled"`
ClipboardEnabled bool `gorm:"default:true;not null" json:"clipboard_enabled"`
FileUploadEnabled bool `gorm:"default:true;not null" json:"file_upload_enabled"`
FileDownloadEnabled bool `gorm:"default:true;not null" json:"file_download_enabled"`
CommandPolicyEnabled bool `gorm:"default:false;not null" json:"command_policy_enabled"`
ApprovalRequired bool `gorm:"default:false;not null" json:"approval_required"`
LastCleanupAt *time.Time `json:"last_cleanup_at,omitempty"`
LastCleanupSummary string `gorm:"size:500" json:"last_cleanup_summary,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
func (AuditSettings) TableName() string { return "sys_audit_settings" }
// AllowedAuditRetentionDays 允许的日志保留天数 // Logan.Li
var AllowedAuditRetentionDays = []int{7, 15, 30, 90, 180, 365}
// IsValidRetentionDays 校验保留天数 // Logan.Li
func IsValidRetentionDays(days int) bool {
for _, d := range AllowedAuditRetentionDays {
if d == days {
return true
}
}
return false
}