add audit log to update

Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
Ronni Skansing
2026-06-06 20:34:11 +02:00
parent bbd916a101
commit 67b088576e
+5 -1
View File
@@ -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() {