Only attach floating IPs to instances that belong to the cluster

Ouverte
#329 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
72/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
go, kubernetes
Domaine
cloud, security

Piste de recherche

Read internal/provider/load_balancer.go and internal/provider/instances_v2.go, starting with EnsureLoadBalancer, UpdateLoadBalancer, and getInstance. Trace how the configured project and node identity are available when checking the ProviderID instance. Done when out-of-project or node-mismatched instances cannot receive floating IPs, and the ProviderID lookup rejects instances outside the configured project.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Kubernetes Cloud Controller Manager (CCM)

Context

EnsureLoadBalancer and UpdateLoadBalancer (internal/provider/load_balancer.go) pick the first node by name and pass the instance ID from its Spec.ProviderID straight to FloatingIpAttach. Nothing checks that the instance belongs to the cluster. Anyone who can register a Node with a name that sorts first can point every LoadBalancer floating IP at an instance of their choosing.

Nexus already rejects attaching a floating IP to an instance in another project, so the reachable targets are other instances in the CCM's project.

getInstance (internal/provider/instances_v2.go) has a related gap. When a node has a ProviderID, it looks up the instance by ID without a project. That means InstanceExists, InstanceShutdown, and InstanceMetadata accept an instance from any project the token can see.

Scope

  • Before attaching a floating IP, confirm the target instance is in the configured project and corresponds to the node, for example by checking that the instance name matches the node name.
  • In getInstance, check the instance's project against the configured project on the ProviderID path too.

Done when

A node whose ProviderID points at an instance outside the configured project, or at an instance that doesn't match the node, never receives a floating IP and isn't reported as existing.

Langage dominant
Go
Étoiles
6
Forks
2
Merge moyen
2 h 47 min
PR mergées (30 j)
6

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de oxidecomputer/oxide-cloud-controller-manager

Toutes les issues de oxidecomputer/oxide-cloud-controller-manager

Issues similaires

Plus d'issues Go

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.