Limit permissions of gardener-node-agent
instances to required objects
#10505
Labels
gardener-node-agent
instances to required objects
#10505
How to categorize this issue?
/area security
/kind enhancement
What would you like to be added:
At the moment
gardener-node-agent
on every node share their service account (gardener-node-agent
) and so also the same permissions.This means that
gardener-node-agents
have to many permissions, because they could updateNode
s andLease
s which belong to different GNAs and they can readOperatingSystemConfig
secrets of all worker groups.The permissions could be reduced way without the necessity to update the core functionality of GNA.
🎯 Goals
Node
onlyLease
onlyImplementation:
Usernames for GNA
Each instance of gardener-node-agent is using the name of its
machine
as username.It cannot use the name of the
node
, because it is created bykubelet
which is deployed by GNA.It should not use the
hostname
, because we encountered cases where the hostname changed while GNA was running.At the moment GNA does not know the name of its machine yet. That's why this feature needs an adapted
machine-controller-manager
and all provider specific implementations.node-agent-authorizer
webhookFor more granular permissions we cannot rely on the RBAC based authorization only, but could use a Webhook based approach similar to the the SeedAuthorizer we already implemented. The implementation of this
NodeAgentAuthorizer
could be simpler as there is no need for a dependency graph in this use case.The webhook is implemented in
gardener-resource-manager
because it already serves multiple webhooks for shoots.Certificate based authentication
Certificates and Certificate Signing Requests (CSR) are used to authenticate each GNA individually at the shoot kube-apiserver. The same concept is already used by gardenlet to authenticate at garden-apiserver.
GNA creates CSRs which are automatically approved under these conditions.
There is already a controller in GRM which approves CSRs for kubelet server certificates. This could be adapted for this use-case.
Tasks:
machine-name
to user data and as a node label in MCM: Introduce a feature to propagate the machine name to user data and as label to the node machine-controller-manager#919gardener/machine-controller-manager-alicloud
:gardener/machine-controller-manager-aws
: [ci:component:github.com/gardener/machine-controller-manager:v0.53.0->v0.54.0] machine-controller-manager-provider-aws#175gardener/machine-controller-manager-azure
: [ci:component:github.com/gardener/machine-controller-manager:v0.53.1->v0.54.0] machine-controller-manager-provider-azure#166gardener/machine-controller-manager-gcp
: [ci:component:github.com/gardener/machine-controller-manager:v0.53.1->v0.54.0] machine-controller-manager-provider-gcp#129gardener/machine-controller-manager-openstack
: update mcm dependency machine-controller-manager-provider-openstack#181gardener/machine-controller-manager-equinix-metal
:ironcore-dev/machine-controller-manager-provider-ironcore
: Bump MCM to v0.55.1 ironcore-dev/machine-controller-manager-provider-ironcore#442ironcore-dev/machine-controller-manager-provider-metal
: Bump github.com/gardener/machine-controller-manager from 0.53.1 to 0.54.0 ironcore-dev/machine-controller-manager-provider-ironcore-metal#20metal-stack/machine-controller-manager-provider-metal
:node-agent-authorizer
webhook ingardener-resource-mananger
: [node-agent-authorizer] Introducenode-agent-authorizer
webhook ingardener-resource-manager
#10535node-agent-authorizer
webhook #10703CSRApprover
ofgardener-resource-manager
to approve CSRs created bygardener-node-agent
: [node-agent-authorizer] auto-approvegardener-node-agent
CSRs ingardener-resource-manager
#10549gardener-node-agent
: [node-agent-authorizer] Introduce webhook based authorization togardener-node-agent
#10781NodeAgentAuthorizer
feature gate to beta:NodeAgentAuthorizer
feature gate:The text was updated successfully, but these errors were encountered: