Skip to content
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

Replicated Secrets can pick up secrets from outside of their own namespace #1282

Closed
Miles-Garnsey opened this issue Apr 15, 2024 · 0 comments · Fixed by #1283
Closed

Replicated Secrets can pick up secrets from outside of their own namespace #1282

Miles-Garnsey opened this issue Apr 15, 2024 · 0 comments · Fixed by #1283
Assignees
Labels
bug Something isn't working done Issues in the state 'done'

Comments

@Miles-Garnsey
Copy link
Member

What happened?

ReplicatedSecrets currently pick up secrets from outside their own namespace. For example, a ReplicatedSecret like this:

repSecret := api.ReplicatedSecret{
		ObjectMeta: metav1.ObjectMeta{
			Namespace: localNamespaceLocalCluster,
			Name:      "replicated-secret",
		},
		Spec: api.ReplicatedSecretSpec{
			Selector: &metav1.LabelSelector{
				MatchLabels: map[string]string{
					"pickme": "true",
				},
			},
			ReplicationTargets: []api.ReplicationTarget{
				{
					//Local cluster local namespace
					TargetPrefix: "targetprefix-",
					Namespace:    localNamespaceLocalCluster,
					DropLabels:   []string{"dropme", "pickme"},
					AddLabels: map[string]string{
						"addMe": "true",
					},
				},
			},
		},
	}

Would feasibly pick up secrets from both the namespace localNamespaceLocalCluster but also from all other namespaces within the control plane cluster.

Did you expect to see something different?

Yes. ReplicatedSecrets are not supposed to replicate secrets from outside their own namespace. This is a unexpected behaviour from a security perspective, since it means that a user permissioned to create a ReplicatedSecret in any namespace gets access to all secrets throughout the cluster (because they can replicate them to any namespace that they are permissioned for.)

How to reproduce it (as minimally and precisely as possible):

Environment

  • K8ssandra Operator version:

    Insert image tag or Git SHA here

  • Kubernetes version information:

    kubectl version

  • Kubernetes cluster kind:

    insert how you created your cluster: kops, bootkube, etc.

  • Manifests:

insert manifests relevant to the issue
  • K8ssandra Operator Logs:
insert K8ssandra Operator logs relevant to the issue here

Anything else we need to know?:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working done Issues in the state 'done'
Projects
No open projects
Archived in project
2 participants