implementing-network-policies-for-kubernetes

implementing-network-policies-for-kubernetes is a skill for Claude Code, Codex from xalgorix/xalgorix. It costs 43 tokens per session (1,721 once invoked), scanned C, original, Apache-2.0.

A guide to controlling which network connections Kubernetes pods may make and receive. Network policies divide workloads into smaller protected areas, but they require a network plugin that enforces them.

In plain words
What is it for?
Use it to define ingress and egress rules, create default-deny policies, and verify that the cluster network plugin actually enforces them.
Why use it?
It reduces unwanted traffic between workloads, namespaces, and outside systems, limiting lateral movement after a compromise.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to define ingress and egress rules, create default-deny policies, and verify that the cluster network plugin actually enforces them.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/xalgorix/xalgorix/implementing-network-policies-for-kubernetes
About the project

xalgorix/xalgorix is a self-hosted AI penetration-testing tool in which an LLM agent performs reconnaissance, looks for vulnerabilities, and coordinates exploitation, while a separate verifier re-tests findings before reporting them. It is for security teams, ethical hackers, and bug bounty work using a private, bring-your-own-LLM setup. The catalogue skills extend the agent's pentesting workflow.

xalgorix/xalgorix · 1,531 stars · on GitHub · xalgorix.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add xalgorix/xalgorix --skill implementing-network-policies-for-kubernetes
Clone the repo
git clone --depth 1 https://github.com/xalgorix/xalgorix

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for implementing-network-policies-for-kubernetes

README.md
[![agentmods](https://agentmods.dev/badge/skills/xalgorix/xalgorix/implementing-network-policies-for-kubernetes/github.svg)](https://agentmods.dev/skills/xalgorix/xalgorix/implementing-network-policies-for-kubernetes)
Your own site
<a href="https://agentmods.dev/skills/xalgorix/xalgorix/implementing-network-policies-for-kubernetes"><img src="https://agentmods.dev/badge/skills/xalgorix/xalgorix/implementing-network-policies-for-kubernetes/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for implementing-network-policies-for-kubernetes

Your own site · 80×15
<a href="https://agentmods.dev/skills/xalgorix/xalgorix/implementing-network-policies-for-kubernetes"><img src="https://agentmods.dev/badge/skills/xalgorix/xalgorix/implementing-network-policies-for-kubernetes.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,721 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Server-Side Request Forgery · line 218
    Code accesses a cloud instance metadata endpoint (e.g. 169.254.169.254). A single request can return temporary IAM credentials, making this a high-value SSRF target for credential theft.
    Fix: Remove access to cloud metadata endpoints unless strictly required. If metadata is needed, restrict it (e.g. IMDSv2 with hop limit) and never expose returned credentials.
  • high Server-Side Request Forgery · line 219
    Code accesses a cloud instance metadata endpoint (e.g. 169.254.169.254). A single request can return temporary IAM credentials, making this a high-value SSRF target for credential theft.
    Fix: Remove access to cloud metadata endpoints unless strictly required. If metadata is needed, restrict it (e.g. IMDSv2 with hop limit) and never expose returned credentials.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00043 $0.01721
Opus 5.5 $0.00017 $0.00688
Sonnet 5.5 $0.00009 $0.00344
Haiku 4.5 $0.00004 $0.00172

Measured 2mo ago against content hash 5cdb7fa5e4ed, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

implementing-network-policies-for-kubernetes scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Cloud metadata endpointhighServer-side request forgery

One request to 169.254.169.254 can return temporary IAM credentials.

- **Cloud metadata not blocked:** an egress policy that doesn't `except` `169.254.169.254/32` (AWS/GCP) and `169.254.169.254`/`100.100.100.200` (Azure) leaves the SSRF→IMDS credential path open.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- **Verify enforcement, not just creation:** `kubectl get netpol -n production`, then a blocked test: `kubectl run t --image=busybox --restart=Never -n production -- wget -qO- --timeout=2 http://db-svc:5432` must time ou
internal/tools/skills/data/container-security/implementing-network-policies-for-kubernetes/SKILL.md · 243 lines

How it starts

The opening of the file, as written. The whole thing — 243 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Implementing Network Policies for Kubernetes

Overview

Kubernetes NetworkPolicies provide pod-level network segmentation by defining ingress and egress rules that control traffic flow between pods, namespaces, and external endpoints. Combined with CNI plugins like Calico or Cilium, network policies enforce zero-trust microsegmentation to prevent lateral movement within the cluster.

When to Use

  • When deploying or configuring implementing network policies for kubernetes capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation

Common Misconfigurations & Verification

  • No default-deny: NetworkPolicy is default-allow and additive. Without a podSelector: {} deny-all for Ingress and Egress per namespace, the allow rules below don't actually segment anything.
  • CNI doesn't implement NetworkPolicy: plain flannel ignores NetworkPolicy objects, so kubectl apply succeeds but nothing is enforced. Confirm the CNI supports it (Calico, Cilium, Antrea) and that policies take effect.
  • Egress deny without DNS allow: dropping egress without the kube-system UDP/TCP 53 rule breaks name resolution; operators then strip the egress policy, losing all egress control.
  • Cloud metadata not blocked: an egress policy that doesn't except 169.254.169.254/32 (AWS/GCP) and 169.254.169.254/100.100.100.200 (Azure) leaves the SSRF→IMDS credential path open.
  • Selector scope mistakes: podSelector: {} applies to the whole namespace (often intended for deny-all); a labelled selector with a typo silently matches no pods.
  • Verify enforcement, not just creation: kubectl get netpol -n production, then a blocked test: kubectl run t --image=busybox --restart=Never -n production -- wget -qO- --timeout=2 http://db-svc:5432 must time out, while a correctly-labelled app=frontend pod reaches the backend.

Read the full file on GitHub · 243 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 243 lines · 43 tokens per session scan C 5cdb7fa5e4ed

Subscribe to this mod's changes

implementing-network-policies-for-kubernetes is a skill published in the GitHub repository xalgorix/xalgorix (1,531 stars, last pushed yesterday), licensed Apache-2.0. It adds 43 tokens to every session and 1,721 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it C with 2 findings (cloud metadata endpoint, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

implementing-network-policies-for-kubernetes compared with skills from other repositories

implementing-network-policies-for-kubernetes next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
implementing-network-policies-for-kubernetesxalgorix/xalgorixSkill1.5kyesterdayApache-2.0C43Claude Code, Codex
cis-aws-foundations-2.1.1CyberStrikeus/CyberStrikeSkill3.8ktodayAGPL-3.0A19Claude Code, Codex
cis-aws-foundations-2.15CyberStrikeus/CyberStrikeSkill3.8ktodayAGPL-3.0A23Claude Code, Codex
cis-aws-foundations-2.4CyberStrikeus/CyberStrikeSkill3.8ktodayAGPL-3.0A20Claude Code, Codex
cis-aws-foundations-2.7CyberStrikeus/CyberStrikeSkill3.8ktodayAGPL-3.0A24Claude Code, Codex
cis-aws-database-3.1CyberStrikeus/CyberStrikeSkill3.8ktodayAGPL-3.0A17Claude Code, Codex
cis-aws-foundations-4.2CyberStrikeus/CyberStrikeSkill3.8ktodayAGPL-3.0A18Claude Code, Codex