Only attach floating IPs to instances that belong to the cluster

Aberta
#329 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
72/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
go, kubernetes
Domínio
cloud, security

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Go
Estrelas
6
Forks
2
Merge médio
2h 47min
PRs com merge (30d)
6

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de oxidecomputer/oxide-cloud-controller-manager

Todas as issues de oxidecomputer/oxide-cloud-controller-manager

Issues semelhantes

Mais issues de Go

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.