Only attach floating IPs to instances that belong to the cluster

Aperta
#329 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go, kubernetes
Ambito
cloud, security

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Go
Stelle
6
Fork
2
Merge medio
2h 47m
PR unite (30g)
6

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di oxidecomputer/oxide-cloud-controller-manager

Tutte le issue di oxidecomputer/oxide-cloud-controller-manager

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.