本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)35k · #8020

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がスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-container-network-policies-with-calico/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

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 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.

よくある質問

「ネームスペース」とは何ですか?

ネームスペースは、サーバー内で分けられた「部屋」のようなものと考えてください。異なるアプリケーションやチームを整理し、互いに分離するのに役立ちます。

「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

repo: mukul975/Anthropic-Cybersecurity-Skills

人気

GitHubのスター
35k
ランキング
#8020
ライセンス
Apache-2.0
更新日
2026/8/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル