From e13967396982615c6ffd46959a7861dca23cb726 Mon Sep 17 00:00:00 2001 From: Allan Roger Reid Date: Thu, 11 Jul 2024 16:13:15 -0700 Subject: [PATCH] Audit failure in batch job key rotate (#20073) --- cmd/batch-rotate.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmd/batch-rotate.go b/cmd/batch-rotate.go index ccadaa50f..4bb0a9384 100644 --- a/cmd/batch-rotate.go +++ b/cmd/batch-rotate.go @@ -389,6 +389,17 @@ func (r *BatchJobKeyRotateV1) Start(ctx context.Context, api ObjectLayer, job Ba stopFn(result, err) batchLogIf(ctx, err) success = false + if attempts >= retryAttempts { + auditOptions := AuditLogOptions{ + Event: "KeyRotate", + APIName: "StartBatchJob", + Bucket: result.Bucket, + Object: result.Name, + VersionID: result.VersionID, + Error: err.Error(), + } + auditLogInternal(ctx, auditOptions) + } } else { stopFn(result, nil) }