mirror of
https://github.com/minio/minio.git
synced 2025-05-23 02:21:51 -04:00
feat: Add support for audit notifications for transition (#12842)
This PR adds audit notifications for transitioning objects, similar to audit logging for expiration and replication traffic.
This commit is contained in:
parent
e7baf2d7d2
commit
a51799d9f0
@ -1354,6 +1354,8 @@ const (
|
|||||||
ILMExpiry = "ilm:expiry"
|
ILMExpiry = "ilm:expiry"
|
||||||
// ILMFreeVersionDelete - audit trail for ILM free-version delete
|
// ILMFreeVersionDelete - audit trail for ILM free-version delete
|
||||||
ILMFreeVersionDelete = "ilm:free-version-delete"
|
ILMFreeVersionDelete = "ilm:free-version-delete"
|
||||||
|
// ILMTransition - audit trail for ILM transitioning.
|
||||||
|
ILMTransition = " ilm:transition"
|
||||||
)
|
)
|
||||||
|
|
||||||
func auditLogLifecycle(ctx context.Context, oi ObjectInfo, trigger string) {
|
func auditLogLifecycle(ctx context.Context, oi ObjectInfo, trigger string) {
|
||||||
@ -1363,6 +1365,8 @@ func auditLogLifecycle(ctx context.Context, oi ObjectInfo, trigger string) {
|
|||||||
apiName = "ILMExpiry"
|
apiName = "ILMExpiry"
|
||||||
case ILMFreeVersionDelete:
|
case ILMFreeVersionDelete:
|
||||||
apiName = "ILMFreeVersionDelete"
|
apiName = "ILMFreeVersionDelete"
|
||||||
|
case ILMTransition:
|
||||||
|
apiName = "ILMTransition"
|
||||||
}
|
}
|
||||||
auditLogInternal(ctx, oi.Bucket, oi.Name, AuditLogOptions{
|
auditLogInternal(ctx, oi.Bucket, oi.Name, AuditLogOptions{
|
||||||
Trigger: trigger,
|
Trigger: trigger,
|
||||||
|
@ -1437,16 +1437,15 @@ func (er erasureObjects) TransitionObject(ctx context.Context, bucket, object st
|
|||||||
er.addPartial(bucket, object, opts.VersionID, -1)
|
er.addPartial(bucket, object, opts.VersionID, -1)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
// Notify object deleted event.
|
|
||||||
|
objInfo := fi.ToObjectInfo(bucket, object)
|
||||||
sendEvent(eventArgs{
|
sendEvent(eventArgs{
|
||||||
EventName: eventName,
|
EventName: eventName,
|
||||||
BucketName: bucket,
|
BucketName: bucket,
|
||||||
Object: ObjectInfo{
|
Object: objInfo,
|
||||||
Name: object,
|
Host: "Internal: [ILM-Transition]",
|
||||||
VersionID: opts.VersionID,
|
|
||||||
},
|
|
||||||
Host: "Internal: [ILM-Transition]",
|
|
||||||
})
|
})
|
||||||
|
auditLogLifecycle(ctx, objInfo, ILMTransition)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user