implementing-container-network-policies-with-calico
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).
Skill link
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-container-network-policies-with-calico/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
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.”
5 new skills a week. 1 minute to read.
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.
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
kubernetesclient 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
Popularity
- GitHub stars
- 35k
- Ranking position
- #8020
- License
- Apache-2.0
- Updated
- 8/31/2026
Comments
- …
More skills from this repository
abusing-dpapi-for-credential-access
35kGives your AI agent ready-made instructions for a specific task, so it does it better and faster.
abusing-shadow-credentials-for-privesc
35kTeaches your AI agent to write clear, well-structured text.
achieving-cmmc-level-2-compliance
35kHelps your agent prepare an environment for CMMC Level 2 compliance. It implements security requirements and manages necessary documentation.
acquiring-disk-image-with-dd-and-dcfldd
35kHelps your agent create exact copies of hard drives. This is useful for ensuring no information is lost or altered during investigations.
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.