Skip to content
Skillpedia
Deploy & cloud (DevOps)35k · #5857

implementing-container-network-policies-with-calico

Helps your agent manage complex network policies in Kubernetes environments using Calico, allowing advanced control over traffic between namespaces and to the host itself.

What it does

This tool helps control network traffic between your containers (programs running in virtual boxes) using Calico. It allows you to create security rules to decide which containers can talk to each other, protect the server itself, and control internet access by website name.

When to use it

  • ✓When you need a security rule to affect multiple 'rooms' (namespaces) at once.
  • ✓When you want to protect the 'main server' (host) where containers run.
  • ✓When you need to allow internet access only to specific websites (by name, like google.com).

Example of what to ask your AI

“Create rules so that only containers from the sales team can access the database, and all others can only access the news website.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-container-network-policies-with-calico/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-container-network-policies-with-calico/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool uses special commands (calicoctl) to create and check network rules. These rules define who can talk to whom within your container network.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill implementing-container-network-policies-with-calico

Or download just the file:

curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/implementing-container-network-policies-with-calico/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Implementing Container Network Policies with Calico

Overview

Calico provides Kubernetes-native and extended network policy enforcement through its CNI plugin. This skill covers creating and auditing Calico NetworkPolicy and GlobalNetworkPolicy resources to implement pod-to-pod traffic control, namespace isolation, egress restrictions, and DNS-based policy rules using calicoctl and the Kubernetes API.

When to Use

  • When deploying or configuring implementing container network policies with calico 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

Prerequisites

  • Kubernetes cluster with Calico CNI installed
  • Python 3.9+ with kubernetes client library
  • calicoctl CLI tool installed and configured
  • kubectl access with RBAC permissions for network policy management

Steps

Step 1: Audit Existing Network Policies

Use calicoctl and kubectl to inventory current network policies and identify unprotected namespaces.

Step 2: Implement Default-Deny Policies

Create default-deny ingress and egress policies per namespace as a zero-trust baseline.

Step 3: Create Workload-Specific Allow Rules

Define granular allow rules for legitimate pod-to-pod and pod-to-service communication.

Step 4: Validate Policy Enforcement

Test connectivity between pods to verify policies are correctly enforced.

Expected Output

JSON audit report listing all network policies, unprotected namespaces, policy rule counts, and connectivity test results.

FAQ

What are 'namespaces'?

Think of namespaces as separate 'rooms' within your server. They help organize and isolate different applications or teams.

What is 'calicoctl'?

It's a command-line tool you use to manage Calico's network rules, like a remote control for network security.

What does 'default-deny' mean?

It means that by default, nothing is allowed. You need to create specific rules to permit what's necessary, making the network more secure.

Details

Original description by the author

Uses Calico's own policy CRDs beyond the upstream Kubernetes API - GlobalNetworkPolicy, HostEndpoint, NetworkSet, policy tiers, and DNS-based egress rules - applied and audited with calicoctl. Use when a policy must span namespaces or protect the host itself, when egress has to be expressed by domain name, or when ordering policies into tiers. Keywords: calicoctl, GlobalNetworkPolicy, HostEndpoint

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#5857
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills