implementing-container-network-policies-with-calico
できること
このツールは、Calicoを使って、仮想の箱(コンテナ)の中で動くプログラム同士のネットワーク通信を制御するのに役立ちます。どのコンテナ同士が通信できるかを決めるセキュリティルールを作成したり、サーバー自体を守ったり、ウェブサイト名を指定してインターネットへのアクセスを制御したりできます。
使う場面
- ✓複数のネームスペース(「部屋」のようなもの)にまたがって、セキュリティルールを適用したいとき。
- ✓コンテナを動かしている「メインサーバー」(ホスト)を守りたいとき。
- ✓特定のウェブサイト(google.comのように名前で指定)だけにインターネットアクセスを許可したいとき。
スキルのリンク
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-container-network-policies-with-calico/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“営業チームのコンテナだけがデータベースにアクセスでき、それ以外のコンテナはニュースサイトにのみアクセスできるよう、ルールを作成してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このツールは、calicoctlという特別なコマンドを使って、ネットワークルールの作成や確認を行います。これらのルールによって、コンテナネットワーク内でどのコンテナが誰と通信できるかを定義します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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.
よくある質問
「ネームスペース」とは何ですか?
ネームスペースは、サーバー内で分けられた「部屋」のようなものと考えてください。異なるアプリケーションやチームを整理し、互いに分離するのに役立ちます。
「calicoctl」とは何ですか?
Calicoのネットワークルールを管理するためのコマンドラインツールです。ネットワークセキュリティのリモコンのようなものです。
「default-deny」とはどういう意味ですか?
初期設定では何も許可しないことを意味します。必要なものだけを許可する具体的なルールを作成することで、ネットワークをより安全にします。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 35k
- ランキング
- #8020
- ライセンス
- Apache-2.0
- 更新日
- 2026/8/31
コメント
- …
このリポジトリの他のスキル
abusing-dpapi-for-credential-access
35k特定のタスク向けに用意された指示をAIエージェントに与え、より良く、より速く作業できるようにします。
abusing-shadow-credentials-for-privesc
35kAIエージェントに、明確で構成のしっかりした文章の書き方を教えます。
achieving-cmmc-level-2-compliance
35kエージェントがCMMC Level 2への準拠に向けた環境を整えられるようにします。セキュリティ要件を実装し、必要なドキュメントを管理します。
acquiring-disk-image-with-dd-and-dcfldd
35kエージェントがハードディスクの完全なコピーを作成できるようにします。調査中に情報が失われたり改変されたりしないようにするのに役立ちます。
似ているスキル
openclaw-update
394k既存のOpenClaw Gatewayを更新するようエージェントを支援します。インストール方法に合った更新方法を選び、セッションを動かし続けます。
diagnose-gateway
394k設定、チャンネル、ポートを確認して、OpenClaw Gatewayが失敗している理由を、何も変更せずに突き止めるようエージェントを支援します。
crabbox-apps
394k一時的なクラウドマシン上でアプリを開いて実行し、そのビューをチャットのサイドパネルに表示するようエージェントを支援します。