Skip to content
Back to skills

Implementing Container Network Policies With Calico

ASecurity

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, NetworkSet, tier, DNS egress, order. Do not use for portable upstream NetworkPolicy - use imple...

  • 67 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 4, 2026
devopspythonrustexpresskubernetesgitapisecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 4, 2026

npx -y skills add costrict-plugins-repo/mukul975-anthropic-cybersecurity-skills-cybersecurity-skills --skill implementing-container-network-policies-with-calico --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Implementing Container Network Policies With Calico?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Implementing Container Network Policies With Calico
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/costrict-plugins-repo-implementing-container-network-policies-with-calic/badge)](https://www.skillsdirectory.com/skills/costrict-plugins-repo-implementing-container-network-policies-with-calic)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: implementing-container-network-policies-with-calico
description: >-
  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, NetworkSet, tier, DNS egress, order. Do not
  use for portable upstream NetworkPolicy - use implementing-network-policies-for-kubernetes;
  for installing Calico and writing standard policy with it use
  implementing-kubernetes-network-policy-with-calico.
domain: cybersecurity
subdomain: container-security
tags:
- container-security
- kubernetes
- calico
- network-policy
- microsegmentation
- cni
version: '1.0'
author: mahipal
license: Apache-2.0
nist_csf:
- PR.PS-01
- PR.IR-01
- ID.AM-08
- DE.CM-01
mitre_attack:
- T1610
- T1611
- T1609
- T1525
---
# 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.

Files in this skill

  • LICENSE11 KB
  • SKILL.md2.7 KB
  • references/api-reference.md1.9 KB
  • scripts/agent.py7.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.