From 2211a5f1b81b94513a3783a60ac1bbad66558a0d Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 23 Aug 2018 23:31:14 -0700 Subject: [PATCH] Avoid ListenBucket targets to be listed in ServerInfo (#6340) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In current master when you do `mc watch` you can see a dynamic ARN being listed which exposes the remote IP as well ``` mc watch play/airlines ``` On another terminal ``` mc admin info play ● play.minio.io:9000 Uptime : online since 11 hours ago Version : 2018-08-22T07:50:45Z Region : SQS ARNs : arn:minio:sqs::httpclient+51c39c3f-131d-42d9-b212-c5eb1450b9ee+73.222.245.195:33408 Stats : Incoming 30GiB, Outgoing 7.6GiB Storage : Used 7.7GiB ``` SQS ARNs listed as part of ServerInfo should be only external targets, since listing an ARN here is not useful and it cannot be re-purposed in any manner. This PR fixes this issue by filtering out httpclient from the ARN list. This is a regression introduced in #5294 0e4431725cd85236d3d18643f8fc2506c7d88c66 --- cmd/notification.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/notification.go b/cmd/notification.go index a25f53474..505a2caf9 100644 --- a/cmd/notification.go +++ b/cmd/notification.go @@ -23,6 +23,7 @@ import ( "fmt" "net/url" "path" + "strings" "sync" "time" @@ -46,7 +47,13 @@ func (sys *NotificationSys) GetARNList() []string { arns := []string{} region := globalServerConfig.GetRegion() for _, targetID := range sys.targetList.List() { - arns = append(arns, targetID.ToARN(region).String()) + // httpclient target is part of ListenBucketNotification + // which doesn't need to be listed as part of the ARN list + // This list is only meant for external targets, filter + // this out pro-actively. + if !strings.HasPrefix(targetID.ID, "httpclient+") { + arns = append(arns, targetID.ToARN(region).String()) + } } return arns