Agent skill

Managing Network Policies

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Execute use when managing Kubernetes network policies and firewall rules.

MITAuto-check passedDevOps & Cloud

Install Managing Network Policies

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-network-policies -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace managing-network-policies --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/managing-network-policies .claude/skills/managing-network-policies && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
managing-network-policies
GitHub stars
2.8k
Token cost
~1.2k tokens
SKILL.md length
516 words
Files
6 (incl. scripts, references, assets)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Execute use when managing Kubernetes network policies and firewall rules.

  • Works in 9 steps: Map the application communication… → Start with a default-deny policy for… → Add explicit allow rules for each… → …
  • Managing Kubernetes network policies and firewall rules
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 3 more sections
  • Runs Python scripts from its folder; calls kubectl

What it does

Managing Network Policies is an agent skill from jeremylongshore/tons-of-skills-marketplace. Execute use when managing Kubernetes network policies and firewall rules. Trigger with phrases like "create network policy", "configure firewall rules", "restrict pod communication", or "setup ingress/egress rules". Generates Kubernetes NetworkPolicy manifests following least privilege and zero-trust principles.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 8 other files, including scripts, reference files and assets (for example `assets/README.md`, `assets/network_policy_template.yaml` and `references/README.md`). Compatibility notes: Designed for Claude Code

It sits in DevOps & Cloud, covering Cloud networking and Container orchestration. It works with Kubernetes. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Managing Kubernetes network policies and firewall rules
  • With phrases like create network policy
  • Configure firewall rules
  • Restrict pod communication

Example prompts

  • “create network policy”
  • “configure firewall rules”
  • “restrict pod communication”
  • “/managing-network-policies”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Grep, Glob, Bash(kubectl:*)

Workflow steps

9 steps, taken from the first numbered list in SKILL.md.

  1. Map the application communication patterns: identify all service-to-service, service-to-database, and service-to-external connections
  2. Start with a default-deny policy for both ingress and egress in each namespace to establish zero-trust baseline
  3. Add explicit allow rules for each legitimate communication path: specify source pod labels, destination pod labels, and ports
  4. Always include a DNS egress rule allowing traffic to kube-system namespace on UDP/TCP port 53 for CoreDNS
  5. Define egress rules for external API access: use CIDR blocks or namespaceSelector for known external services
  6. Apply policies to a test namespace first and verify connectivity with kubectl exec curl/wget commands
  7. Monitor for blocked traffic in the CNI plugin logs (Calico: calicoctl node status, Cilium: cilium monitor)
  8. Iterate on policies: add missing allow rules for any legitimate traffic that gets blocked
  9. Document each policy with annotations explaining the business reason for the allowed communication

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Grep
    • Glob
    • Bash(kubectl:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • kubectl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • kubernetes.io
    • docs.tigera.io
    • docs.cilium.io
    • editor.networkpolicy.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Managing Network Policies loads about 1.2k tokens when it runs, and up to ~1.2k if it reads all its reference files. Until then it costs about 85 tokens; SKILL.md has 516 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~85
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 516 words, ~1,158 tokens.

Download SKILL.mdSave it as .claude/skills/managing-network-policies/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
managing-network-policies
description
Execute use when managing Kubernetes network policies and firewall rules. Trigger with phrases like "create network policy", "configure firewall rules", "restrict pod communication", or "setup ingress/egress rules". Generates Kubernetes NetworkPolicy manifests following least privilege and zero-trust principles.
allowed-tools
Read, Write, Edit, Grep, Glob, Bash(kubectl:*)
compatibility
Designed for Claude Code
version
1.25.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
devops, kubernetes, network-policies

Managing Network Policies

Overview

Create and manage Kubernetes NetworkPolicy manifests to enforce zero-trust networking between pods, namespaces, and external endpoints. Generate ingress and egress rules with label selectors, namespace selectors, CIDR blocks, and port specifications following the principle of least privilege.

Prerequisites

  • Kubernetes cluster with a CNI plugin that supports NetworkPolicy (Calico, Cilium, Weave Net)
  • kubectl configured with permissions to create and manage NetworkPolicy resources
  • Pod labels consistently defined across deployments for accurate selector targeting
  • Service communication map documenting which pods need to talk to which pods on which ports
  • Understanding of DNS requirements (pods need egress to kube-dns on port 53 for name resolution)

Instructions

  1. Map the application communication patterns: identify all service-to-service, service-to-database, and service-to-external connections
  2. Start with a default-deny policy for both ingress and egress in each namespace to establish zero-trust baseline
  3. Add explicit allow rules for each legitimate communication path: specify source pod labels, destination pod labels, and ports
  4. Always include a DNS egress rule allowing traffic to kube-system namespace on UDP/TCP port 53 for CoreDNS
  5. Define egress rules for external API access: use CIDR blocks or namespaceSelector for known external services
  6. Apply policies to a test namespace first and verify connectivity with kubectl exec curl/wget commands
  7. Monitor for blocked traffic in the CNI plugin logs (Calico: calicoctl node status, Cilium: cilium monitor)
  8. Iterate on policies: add missing allow rules for any legitimate traffic that gets blocked
  9. Document each policy with annotations explaining the business reason for the allowed communication

Output

  • Default-deny NetworkPolicy manifests for ingress and egress per namespace
  • Allow-list NetworkPolicy manifests for each service communication path
  • DNS egress policy allowing pod name resolution
  • External access egress policies with CIDR blocks
  • Connectivity test commands for validation
Show full SKILL.md (226 more words)Show less

Error Handling

ErrorCauseSolution
All traffic blocked after applying policyDefault-deny applied without corresponding allow rulesApply allow rules before or simultaneously with deny policies; verify with kubectl exec tests
DNS resolution fails after network policyMissing egress rule for kube-dns/CoreDNSAdd egress policy allowing UDP and TCP port 53 to kube-system namespace
Policy not targeting intended podsLabel mismatch between policy selector and pod labelsVerify labels with kubectl get pods --show-labels; match selectors exactly
Traffic still allowed despite deny policyCNI plugin does not support NetworkPolicy or policy in wrong namespaceVerify CNI support with kubectl get networkpolicy -A; ensure policy is in the correct namespace
Intermittent connection failuresPolicy allows traffic but connection pool or timeout settings too aggressiveCheck if the issue is network policy or application-level; test with kubectl exec during failures

Examples

  • "Create a default-deny policy for the production namespace, then add allow rules so only the ingress controller can reach web pods on port 443."
  • "Generate egress policies that restrict the API pods to communicate only with PostgreSQL (port 5432), Redis (port 6379), and external HTTPS APIs."
  • "Build a complete set of network policies for a 3-tier app: frontend -> API (8080), API -> database (5432), API -> cache (6379), all pods -> DNS (53)."

Resources

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (scripts, references, assets) in skills/.curated/managing-network-policies of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • assets/README.md
  • assets/network_policy_template.yaml
  • references/README.md
  • scripts/README.md
  • scripts/generate_network_policy.py

Open the folder on GitHubat commit cfae287

Compare with similar skills

Managing Network Policies next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Managing Network Policies compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Managing Network Policies this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.2kAutomated safety check: PassMIT
Kubeshark KFL2 Filter Referencekubeshark/kubeshark12k—~3.6kAutomated safety check: PassApache-2.0
Nginx To Higress Migrationhigress-group/higress9.5k—~3.9kAutomated safety check: PassApache-2.0
NGINX Ingress Controller Feature Checklistsnginx/kubernetes-ingress5.1k—~1.4kAutomated safety check: PassApache-2.0
NGINX Ingress Policy CRD Guidenginx/kubernetes-ingress5.1k—~2kAutomated safety check: PassApache-2.0
Aks Deployment Skilltimothywarner/chatgptclass143—~916Automated safety check: PassCustom licence

Similar skills

  • Syntax reference for KFL2, the CEL-based display filter language used to search Kubernetes network traffic captured by Kubeshark, loaded before any filter is written.

    12k GitHub stars~3.6k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Nginx To Higress Migration

    higress-group/higress

    Migrate from ingress-nginx to Higress in Kubernetes environments.

    9.5k GitHub stars~3.9k tokensUpdated 3 days ago
    DevOps & CloudAuto-check passed
  • Gives step-by-step checklists for adding Ingress annotations, VirtualServer fields and Helm values to the NGINX Kubernetes Ingress Controller, with common gotchas.

    5.1k GitHub stars~1.4k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • NGINX Ingress Policy CRD Guide

    nginx/kubernetes-ingress

    Step-by-step checklist for adding a new Policy CRD type to the NGINX Ingress Controller, from the Go types and validation to config generation and templates.

    5.1k GitHub stars~2k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Aks Deployment Skill

    timothywarner/chatgptclass

    Deploy and operate workloads on Azure Kubernetes Service (AKS) the safe way.

    143 GitHub stars~916 tokensUpdated 21 days ago
    DevOps & CloudAuto-check passed
  • KubeSphere Gateway Management

    kubesphere/kubesphere

    Installs, uninstalls, checks and troubleshoots the KubeSphere Gateway extension built on ingress-nginx, including gateways stuck in bad states and Helm or pod failures.

    17k GitHub stars~2.9k tokensUpdated 2 mo ago
    DevOps & CloudAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Managing Network Policies

What does Managing Network Policies do?

Execute use when managing Kubernetes network policies and firewall rules. Managing Network Policies is an agent skill from jeremylongshore/tons-of-skills-marketplace. Execute use when managing Kubernetes network policies and firewall rules.

When should I use Managing Network Policies?

Managing Network Policies fits situations like: managing Kubernetes network policies and firewall rules; with phrases like create network policy; configure firewall rules; restrict pod communication.

How do I install Managing Network Policies in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-network-policies -a claude-code`. Or copy the skill folder (skills/.curated/managing-network-policies in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/managing-network-policies in your project. Claude Code loads it when a task matches its description.

How do I install Managing Network Policies in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-network-policies -a codex`. Or copy the skill folder (skills/.curated/managing-network-policies in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/managing-network-policies in your project. Codex loads it when a task matches its description.

Can I use Managing Network Policies in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill managing-network-policies -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/managing-network-policies, .gemini/skills/managing-network-policies, .github/skills/managing-network-policies and .opencode/skills/managing-network-policies in your project.

What does Managing Network Policies need to run?

Going by SKILL.md and its folder, Managing Network Policies needs Python for the scripts in its folder and the command-line tools its instructions call (kubectl). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Glob, Bash(kubectl:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Managing Network Policies access the network?

SKILL.md names 4 domains. As links in the text: kubernetes.io, docs.tigera.io, docs.cilium.io and editor.networkpolicy.io. This is read from the text; nothing was executed.

Is Managing Network Policies safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Managing Network Policies use?

Managing Network Policies is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Managing Network Policies use?

About 1.2k tokens (SKILL.md is roughly 4.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 17 tokens, read only when the agent opens those files.

What are the alternatives to Managing Network Policies?

Skills that share tags, products or a category with Managing Network Policies: Kubeshark KFL2 Filter Reference (kubeshark/kubeshark, 12k stars), Nginx To Higress Migration (higress-group/higress, 9.5k stars), NGINX Ingress Controller Feature Checklists (nginx/kubernetes-ingress, 5.1k stars) and NGINX Ingress Policy CRD Guide (nginx/kubernetes-ingress, 5.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Managing Network Policies?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.