Run pods have open egress for a moment at start on eventually-consistent NetworkPolicy enforcement

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

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
kubernetes, python
Ambito
backend, security

Direzione di ricerca

Start with the run pod setup, the admission policy that rejects init containers, and the existing run-isolation kind test that records startup_race; the issue does not name their file paths. Compare the proposed gate with both isolated and scanner policies, then run the kind leg and check that user code cannot reach the canary at t = 0. Done means enforcement is observed before user code starts, or the run fails as lost with a namespace detail when the bound expires.

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

Descrizione

queue: k8s compute (K)

Queue: K (process compute). Found by K-6's kind leg (#14).

Problem

On a CNI whose NetworkPolicy enforcement for a new pod is eventually consistent, a run pod has open egress for a short time after it starts, even with stac-higher-runs-default-deny in place.

Measured on kind v0.33.0 (kindnet / kube-network-policies), Kubernetes 1.34: a run pod connected to the node metadata address, the API server and an external host at t = 0; the first blocked connection came about 0.5 s after start; from then on all three stayed blocked. Connections opened inside the window are not re-checked. The AWS VPC CNI documents the same behaviour in its default standard enforcing mode (strict mode starts pods default-deny).

Untrusted run code therefore gets a sub-second window in which it can reach the metadata endpoint or exfiltrate, on any cluster that is not in a strict enforcing mode. The executor's fail-closed check (K-5) proves the policy object exists, not that it is enforced yet for this pod.

Options

  1. Require strict enforcement as a cluster prerequisite (chart README, R-11 live check). Documentation only; nothing proves it per run.
  2. A start gate in the run pod: a platform init container (the runtime image, by digest) that waits until a canary connection is observed blocked, then exits; user code starts only after that. Init containers share the pod's network identity, so once the gate sees the block the policy applies to the pod. If the block never comes within a bound, the run is lost with a detail naming the namespace: a per-run proof of enforcement, which also closes the "object exists, not enforced" residual (I-183). Needs: a canary that is reachable without a policy and blocked under both the isolated and scanner policies; the admission policy's no-init-containers rule relaxed to exactly this container; a kind test that user code observes no reachable target at its own t = 0.
  3. Both.

Notes

  • No migration expected.
  • The kind leg records the window (run-isolation observation, startup_race) and asserts only the settled state; a gate would let it assert t = 0 as well.
Lingua principale
Python
Stelle
0
Fork
2
Merge medio
8h 26m
PR unite (30g)
47

Preparare l'ambiente

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 TechTraverse/stac-higher

Tutte le issue di TechTraverse/stac-higher

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.