-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
restrict RBAC for kube controller secrets to the required namespace only #3602
Conversation
Please make sure you consider the multi-tenant configuration and understand if this impacts that configuration. |
4623294
to
c588f19
Compare
Checked with the multi-tenant team, and we might not have any impact in the tenant namespace. |
pkg/render/logstorage.go
Outdated
// to get configmaps and manipulate secrets | ||
func (m managedClusterLogStorage) linseedExternalRolesAndBindings() ([]*rbacv1.ClusterRole, []*rbacv1.RoleBinding, []*rbacv1.ClusterRoleBinding) { | ||
func (m managedClusterLogStorage) externalRolesAndBindings() ([]*rbacv1.Role, []*rbacv1.ClusterRole, []*rbacv1.RoleBinding, []*rbacv1.ClusterRoleBinding) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if we kept this function scoped to Linseed, and introduced another one for the kube-controllers permissions.
pkg/render/logstorage.go
Outdated
} | ||
|
||
// Bind the secrets permission to the operator namespace. This binding now adds permissions for kube controllers to create | ||
// its public cert secret in the tigera-operator namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know why kube-controllers needs its public cert in the operator namespace? I'm struggling to recall what flow this is a part of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. management cluster only needs tigera-ee-*-elasticsearch-access secrets in the tigera-operator namespace not any public certs. Public certs are needed only in the managed cluster.
c588f19
to
ec9b169
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor comment but otherwise LGTM, thanks @vara2504 !
9690087
to
1399ffc
Compare
Removed the secrets resource from the calico-kube-controllers and es-calico-kube-controllers ClusterRole and created a new Role with secrets resource in the tigera-operator and tigera-elasticsearch namespaces. In both the enterprise and cloud environments, I see that all secrets managed by the kube-controllers belong to either of these namespaces.
Tested in standalone cluster, mgmt and managed cluster .
Description
For PR author
make gen-files
make gen-versions
For PR reviewers
A note for code reviewers - all pull requests must have the following:
kind/bug
if this is a bugfix.kind/enhancement
if this is a a new feature.enterprise
if this PR applies to Calico Enterprise only.