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

implementing-runtime-security-with-tetragon

できること

Tetragonは、Kubernetes上で動作するアプリケーションを監視し、保護するためのツールです。プログラムがファイルにアクセスしたり、ネットワークに接続したりする動作を監視し、オペレーティングシステムのレベルで危険な操作を直接防ぐことができます。

使う場面

  • ✓Kubernetesでランタイムセキュリティをインストールまたは設定するとき。
  • ✓アプリケーションが特定のセキュリティルールに従うようにしたいとき。
  • ✓コンテナ内で不審な活動を検出して遮断したいとき。

スキルのリンク

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-runtime-security-with-tetragon/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

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

AIへの頼み方の例

“プログラムが /etc/shadow ファイルにアクセスしようとしたら、Tetragonで通知してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

Tetragonは、eBPFと呼ばれる技術を使用します。この技術により、Linuxカーネル内で起きていることを監視し、制御できます。イベントを監視するルールを定義し、プログラムの終了や操作のブロックなどの処理を実行できます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Implementing Runtime Security with Tetragon

Overview

Tetragon is a CNCF project under Cilium that provides flexible Kubernetes-aware security observability and runtime enforcement using eBPF. By operating at the Linux kernel level, Tetragon can monitor and enforce policies on process execution, file access, network connections, and system calls with less than 1% performance overhead -- far more efficient than traditional user-space security agents.

When to Use

  • When deploying or configuring implementing runtime security with tetragon 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 v1.24+ with Helm 3.x installed
  • Linux kernel 5.4+ (5.10+ recommended for full eBPF feature support)
  • kubectl access with cluster-admin privileges
  • Familiarity with eBPF concepts and Kubernetes security primitives

Core Concepts

eBPF-Based Security

Tetragon attaches eBPF programs directly to kernel functions, enabling:

  • Process lifecycle tracking: Monitor every process creation, execution, and termination across all pods
  • File integrity monitoring: Detect unauthorized reads/writes to sensitive files
  • Network observability: Track all TCP/UDP connections with full pod context
  • System call filtering: Enforce policies on dangerous syscalls like ptrace, mount, or unshare

TracingPolicy Custom Resources

Tetragon uses TracingPolicy CRDs to define what kernel events to observe and what actions to take:

apiVersion: cilium.io/v1alpha1
kind: TracingPolicy
metadata:
  name: detect-privilege-escalation
spec:
  kprobes:
    - call: "security_bprm_check"
      syscall: false
      args:
        - index: 0
          type: "linux_binprm"
      selectors:
        - matchBinaries:
            - operator: "In"
              values:
                - "/bin/su"
                - "/usr/bin/sudo"
                - "/usr/bin/passwd"
          matchNamespaces:
            - namespace: Pid
              operator: NotIn
              values:
                - "host_ns"
          matchActions:
            - action: Post

Enforcement Actions

Tetragon can take three types of actions directly in the kernel:

  1. Sigkill: Immediately terminate the offending process
  2. Signal: Send a configurable signal to the process
  3. Override: Override the return value of a kernel function to deny an operation

Installation and Configuration

Step 1: Install Tetragon with Helm

helm repo add cilium https://helm.cilium.io
helm repo update

helm install tetragon cilium/tetragon \
  --namespace kube-system \
  --set tetragon.enableProcessCred=true \
  --set tetragon.enableProcessNs=true \
  --set tetragon.grpc.address="localhost:54321"

Step 2: Install the Tetragon CLI

GOOS=$(go env GOOS)
GOARCH=$(go env GOARCH)
curl -L --remote-name-all \
  https://github.com/cilium/tetragon/releases/latest/download/tetra-${GOOS}-${GOARCH}.tar.gz
tar -xzvf tetra-${GOOS}-${GOARCH}.tar.gz
sudo install tetra /usr/local/bin/

Step 3: Verify Installation

kubectl get pods -n kube-system -l app.kubernetes.io/name=tetragon
tetra status

Practical Implementation

Detecting Container Escape Attempts

Create a TracingPolicy to detect processes attempting to escape container namespaces:

apiVersion: cilium.io/v1alpha1
kind: TracingPolicy
metadata:
  name: detect-container-escape
spec:
  kprobes:
    - call: "__x64_sys_setns"
      syscall: true
      args:
        - index: 0
          type: "int"
        - index: 1
          type: "int"
      selectors:
        - matchNamespaces:
            - namespace: Pid
              operator: NotIn
              values:
                - "host_ns"
          matchActions:
            - action: Sigkill

Monitoring Sensitive File Access

Detect reads of sensitive credentials:

apiVersion: cilium.io/v1alpha1
kind: TracingPolicy
metadata:
  name: monitor-sensitive-files
spec:
  kprobes:
    - call: "security_file_open"
      syscall: false
      args:
        - index: 0
          type: "file"
      selectors:
        - matchArgs:
            - index: 0
              operator: "Prefix"
              values:
                - "/etc/shadow"
                - "/etc/kubernetes/pki"

…
よくある質問

eBPFとは何ですか?

eBPFは、カーネルのコードを変更することなく、小さなプログラムをLinuxカーネル内で安全に実行できるようにする技術です。これにより、非常に効率的なシステムの監視と制御が可能になります。

「syscall」とは何ですか?

システムコールは、プログラムがファイルの読み込みや新しいプロセスの作成などの作業をオペレーティングシステムに依頼する仕組みです。Tetragonはこれらの呼び出しを監視し、ブロックすることさえできます。

「TracingPolicy」とは何ですか?

TracingPolicyは、Tetragonにどのイベントを監視し、発生したときにどう処理するかを伝えるために作成する設定ファイルです。Tetragonへの具体的な指示を与えるようなものです。

詳細

作者による元の説明

Implements eBPF-based runtime observability and in-kernel enforcement in Kubernetes with Cilium Tetragon, monitoring process execution, file access, network connections, and syscalls, and blocking dangerous calls at the kernel level. Use when deploying Tetragon to detect or block syscalls such as ptrace, mount, and unshare, enforcing kernel-level policy, or adding low-overhead runtime detection to

repo: mukul975/Anthropic-Cybersecurity-Skills

人気

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

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

0

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

コメント

  • …

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

似ているスキル