Logo: Auditing Network Policy Segmentation Gaps

Auditing Network Policy Segmentation Gaps

Organisatioun
UnboundCompute
auditing-network-policy-segmentation-gaps

Audit cluster network segmentation for the reachability a workload should not have: a namespace with no default-deny so every pod can reach every other pod, a missing egress policy that lets a compromised pod call out to the internet or the cloud metadata endpoint, an overly broad selector that admits more sources than intended, and a policy that governs one direction while the other stays open. Covers Kubernetes network policies and equivalent segmentation where pod-to-pod, pod-to-service, and pod-to-external reachability is meant to be constrained. Use when network policy is the control limiting lateral movement and egress in a cluster. The reachable source pod is the source, the pod, service, or external endpoint it can reach is the sink, and the segmentation gap that permits the reach is the bug.

Iwwersiicht

EditeurUnboundCompute
Repositorysecurity-agent-skills
Skill-Nummauditing-network-policy-segmentation-gaps
Stären
27
Forks
8
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    UnboundCompute huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Auditing Network Policy Segmentation Gaps an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-network-policy-segmentation-gaps
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/UnboundCompute/security-agent-skills.git /tmp/security-agent-skills
mkdir -p .claude/skills
cp -r /tmp/security-agent-skills/skills/auditing-network-policy-segmentation-gaps .claude/skills/auditing-network-policy-segmentation-gaps
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Auditing Network Policy Segmentation Gaps an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Auditing Network Policy Segmentation Gaps automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Auditing Network Policy Segmentation Gaps net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Auditing network segmentation gaps: when every pod can reach every pod

Kubernetes networking is open by default: without a policy, every pod can talk to every other pod, every service, and often the internet and the cloud metadata endpoint. Network policy is what closes that down, so segmentation is not a property the cluster has, it is a property each namespace earns by having policies that actually constrain reachability in both directions. The gaps are predictable: a namespace with no default-deny where the whole open default still applies, a missing egress rule that lets a compromised pod exfiltrate or reach the node metadata endpoint, a selector broad enough to admit sources it never meant to, and a policy that locks ingress while egress stays wide open. Lateral movement and egress are exactly what an attacker does after a foothold, and segmentation is what limits both. You audit this by checking, per namespace and per workload, what can actually reach what.

When to use

  • Network policy is the control meant to limit pod-to-pod, pod-to-service, or pod-to-external reachability.
  • Namespaces may lack a default-deny, so the open-by-default reachability still applies.
  • Egress may be unconstrained, letting a compromised pod reach the internet or the cloud metadata endpoint.

Scope check

Test segmentation only on clusters you own or are authorized to assess, on non-production namespaces. Probing reachability sends traffic between real pods and possibly outbound, so keep probes benign and inside the authorized namespaces, and do not exfiltrate through any egress gap you find. If you can't name the authorization, stop.

The loop

  1. Establish the intended reachability first. Name, per workload, what it should be able to reach and what should be able to reach it: which services, which namespaces, what egress. This is the false-positive killer: a namespace with a default-deny and explicit allow rules that match exactly the intended reachability is correctly segmented. Name the intended graph, then compare actual reachability to it.

  2. Check for a default-deny per namespace. Determine whether each namespace has a default-deny for ingress and egress, or whether the open default applies. A namespace without default-deny gives every pod full reachability regardless of any specific allow rules, so the absence of default-deny is the first and biggest gap.

  3. Audit egress explicitly. For each workload, check whether egress is constrained. Unconstrained egress lets a compromised pod call out to the internet to exfiltrate or fetch a payload, and reach the cloud metadata endpoint to grab node credentials. Egress is frequently forgotten while ingress is locked; confirm both directions.

  4. Check selector breadth on allow rules. For each allow policy, read the pod, namespace, and IP selectors and confirm they admit only the intended sources or destinations. A selector broader than needed, an empty selector that matches everything, or a namespace label an attacker workload can wear, admits more than intended.

  5. Reconcile both directions and cross-namespace paths. Confirm that ingress and egress policies agree and that cross-namespace reachability matches intent: a service meant to be internal is not reachable from a namespace that should be walled off, and a policy governing one direction is not undone by the other staying open. Map the effective reachability graph, not each rule in isolation.

  6. Confirm and record. Confirm by reaching, from a source pod, a pod, service, or external endpoint it should not be able to reach, on non-production namespaces and without exfiltrating. Kill the lead if every namespace has a default-deny, egress is constrained (including to the metadata endpoint), selectors admit only intended sources, and both directions agree with the intended graph. Record the source pod, the reached sink, and the segmentation gap that permitted it.

Where segmentation gaps leak

  • No default-deny means fully open. A namespace without default-deny keeps the open-by-default reachability, so specific allow rules add nothing.
  • Unconstrained egress enables exfiltration and metadata theft. A pod with open egress can reach the internet and the cloud metadata endpoint after a compromise.
  • A broad selector admits extra sources. An overly wide or empty selector, or one keyed on an attacker-wearable label, lets in more than the intended source set.
  • One-directional policy leaves the other open. Locking ingress while egress stays open, or vice versa, leaves half the reachability unconstrained.
  • Cross-namespace reachability is the lateral path. An internal service reachable from a namespace that should be isolated is the move an attacker makes after a foothold.

Worked example (a confirm and a kill)

Confirm. An application namespace has ingress policies on its front-end service but no default-deny and no egress policy. A pod in that namespace, standing in for a compromised workload, reaches the cloud metadata endpoint and an internal database in another namespace that the front end never needed. Confirmed segmentation gap enabling lateral reach and metadata access, high, remediation = apply a default-deny for ingress and egress in the namespace, add explicit egress rules that exclude the metadata endpoint and the internet, and scope cross-namespace allow rules to the exact services required.

Kill. Every namespace has a default-deny for both directions, egress is restricted to the specific destinations each workload needs with the metadata endpoint blocked, allow selectors match only the intended pods and namespaces on labels the cluster controls, and ingress and egress agree with the intended graph. A source pod reaches only its permitted destinations. Killed, kill_reason = "default-deny in every namespace with constrained egress, metadata blocked, and tight selectors in both directions; no pod reaches anything outside the intended reachability graph."

Rationalizations to reject

  • "We have network policies." → Confirm a default-deny exists; without it the open default applies and your allow rules only add to a fully open baseline.
  • "Ingress is locked down." → Check egress too; an open egress lets a compromised pod exfiltrate and reach the metadata endpoint regardless of ingress.
  • "The cluster is internal." → Internal still has lateral movement and a metadata endpoint; segmentation limits an attacker who already has one foothold.
  • "The selector targets our app." → Confirm the selector cannot be matched by another workload's labels; a broad or wearable selector admits more than your app.
  • "Nothing sensitive is in that namespace." → Cross-namespace reachability is the lateral path; a reachable internal service is a target even if the source namespace looks unimportant.

Executing this in practice

You need, per namespace, whether a default-deny exists; per workload, the ingress and egress allow rules and their selectors; the egress posture toward the internet and the metadata endpoint; and the intended reachability graph. For each workload, compute what it can actually reach in both directions and compare to intent. Reading the policies shows the intended segmentation; reaching a should-be-unreachable endpoint from a source pod shows whether it holds.

Related

  • mapping-pod-to-cloud-credential-reach - open egress to the metadata endpoint is how a pod reaches the node role; segmentation and credential reach compound here.
  • auditing-namespace-as-tenant-boundary - network policy is one of the controls a namespace-as-tenant boundary depends on; audit segmentation as part of that boundary.
  • auditing-service-mesh-mtls-and-authz-trust - mesh authorization is the layer-7 companion to layer-3/4 network policy; the two together define who can reach whom.
  • mapping-attack-surface - use it to enumerate the services and external endpoints reachable from a namespace before auditing the policies that should constrain them.
  • FINDING-SCHEMA.md - source = the reachable source pod, sink = the pod, service, or external endpoint it reaches, evidence = the segmentation gap that permitted the reach.

Heefeg gestallte Froen

Wat mécht de KI-Skill Auditing Network Policy Segmentation Gaps?

Audit cluster network segmentation for the reachability a workload should not have: a namespace with no default-deny so every pod can reach every other pod, a missing egress policy that lets a compromised pod call out to the internet or the cloud metadata endpoint, an overly broad selector that admits more sources than intended, and a policy that governs one direction while the other stays open. Covers Kubernetes network policies and equivalent segmentation where pod-to-pod, pod-to-service, and pod-to-external reachability is meant to be constrained. Use when network policy is the control l...

Firwat Auditing Network Policy Segmentation Gaps op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Auditing Network Policy Segmentation Gaps besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Auditing Network Policy Segmentation Gaps an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-network-policy-segmentation-gaps an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Auditing Network Policy Segmentation Gaps benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Auditing Network Policy Segmentation Gaps benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Auditing Network Policy Segmentation Gaps domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Auditing Network Policy Segmentation Gaps gratis?

Jo. UnboundCompute huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇