From 67b088576e0abd8cafd44e870e27e19c6abd0a42 Mon Sep 17 00:00:00 2001 From: Ronni Skansing Date: Sat, 6 Jun 2026 20:34:11 +0200 Subject: [PATCH] add audit log to update Signed-off-by: Ronni Skansing --- backend/service/update.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/service/update.go b/backend/service/update.go index 7dd5423..41aaf24 100644 --- a/backend/service/update.go +++ b/backend/service/update.go @@ -275,13 +275,15 @@ func (u *Update) RunUpdate( u.updateMutex.Lock() defer u.updateMutex.Unlock() + ae := NewAuditEvent("Update.Run", session) + isAuthorized, err := IsAuthorized(session, data.PERMISSION_ALLOW_GLOBAL) if err != nil { u.LogAuthError(err) return errs.Wrap(err) } if !isAuthorized { - // skip audit logging on this endpoint + u.AuditLogNotAuthorized(ae) return errors.New("unauthorized") } @@ -401,6 +403,8 @@ func (u *Update) RunUpdate( } u.Logger.Infow("update completed successfully", "version", details.LatestVersion) + ae.Details["version"] = details.LatestVersion + u.AuditLogAuthorized(ae) // Schedule shutdown after a brief delay to allow HTTP response to be sent go func() {