Преглед изворни кода

restrict getting kubeconfig

Mohammed Nafees пре 3 година
родитељ
комит
3c06a0e2f8
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      api/server/router/cluster.go

+ 1 - 1
api/server/router/cluster.go

@@ -697,7 +697,7 @@ func getClusterRoutes(
 	// GET /api/projects/{project_id}/clusters/{cluster_id}/kubeconfig -> cluster.NewGetTemporaryKubeconfigHandler
 	getTemporaryKubeconfigEndpoint := factory.NewAPIEndpoint(
 		&types.APIRequestMetadata{
-			Verb:   types.APIVerbGet,
+			Verb:   types.APIVerbUpdate, // we do not want users with no-write access to be able to use this
 			Method: types.HTTPVerbGet,
 			Path: &types.Path{
 				Parent:       basePath,