security: remediate vulnerabilities and issues from codebase audit
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m15s
All checks were successful
Automated Container Build / build-and-push (push) Successful in 1m15s
This commit is contained in:
parent
b60a09196a
commit
fb3f3a3393
15 changed files with 465 additions and 208 deletions
|
|
@ -182,3 +182,9 @@ func (db *DB) AddAuditLog(action, details, ip string) error {
|
|||
_, err := db.Exec("INSERT INTO audit_log (action, details, ip_address) VALUES (?, ?, ?)", action, details, ip)
|
||||
return err
|
||||
}
|
||||
|
||||
// CleanOldAuditLogs deletes audit logs older than 30 days.
|
||||
func (db *DB) CleanOldAuditLogs() error {
|
||||
_, err := db.Exec("DELETE FROM audit_log WHERE timestamp < datetime('now', '-30 days')")
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue