diff --git a/weed/admin/dash/worker_grpc_server.go b/weed/admin/dash/worker_grpc_server.go index 96e1f2f40..a55e6d7da 100644 --- a/weed/admin/dash/worker_grpc_server.go +++ b/weed/admin/dash/worker_grpc_server.go @@ -188,6 +188,10 @@ func (s *WorkerGrpcServer) Stop() error { func (s *WorkerGrpcServer) WorkerStream(stream worker_pb.WorkerService_WorkerStreamServer) error { ctx := stream.Context() + if err := security.CheckGrpcAdminPeer(ctx, security.SigningKey(util.GetViper().GetString("jwt.filer_signing.key"))); err != nil { + return err + } + // get client address address := findClientAddress(ctx) diff --git a/weed/admin/plugin/plugin.go b/weed/admin/plugin/plugin.go index e94e0fc79..8ea35d415 100644 --- a/weed/admin/plugin/plugin.go +++ b/weed/admin/plugin/plugin.go @@ -14,6 +14,8 @@ import ( "github.com/seaweedfs/seaweedfs/weed/glog" "github.com/seaweedfs/seaweedfs/weed/pb/plugin_pb" + "github.com/seaweedfs/seaweedfs/weed/security" + "github.com/seaweedfs/seaweedfs/weed/util" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -267,6 +269,10 @@ func (r *Plugin) Shutdown() { } func (r *Plugin) WorkerStream(stream plugin_pb.PluginControlService_WorkerStreamServer) error { + if err := security.CheckGrpcAdminPeer(stream.Context(), security.SigningKey(util.GetViper().GetString("jwt.filer_signing.key"))); err != nil { + return err + } + first, err := stream.Recv() if err != nil { if errors.Is(err, io.EOF) {