Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)35k · #8110

implementing-runtime-security-with-tetragon

Skill này làm gì

Tetragon là công cụ giám sát và bảo vệ các ứng dụng chạy trong Kubernetes. Nó theo dõi chương trình đang làm gì (như truy cập tệp hoặc kết nối mạng) và có thể ngăn các hành động nguy hiểm ngay ở tầng hệ điều hành.

Khi nào nên dùng

  • ✓Khi cài đặt hoặc cấu hình bảo mật thời gian chạy trong Kubernetes.
  • ✓Khi bạn muốn bảo đảm ứng dụng tuân theo các quy tắc bảo mật cụ thể.
  • ✓Khi phát hiện và chặn các hoạt động đáng ngờ trong container.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-runtime-security-with-tetragon/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi muốn Tetragon cảnh báo cho tôi nếu bất kỳ chương trình nào cố truy cập tệp /etc/shadow.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Tetragon dùng công nghệ eBPF, cho phép nó quan sát và kiểm soát những gì xảy ra bên trong nhân Linux. Công cụ định nghĩa quy tắc để giám sát các sự kiện và có thể thực hiện hành động như dừng chương trình hoặc chặn một thao tác.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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"

…
Câu hỏi thường gặp

eBPF là gì?

eBPF là công nghệ cho phép chạy các chương trình nhỏ một cách an toàn bên trong nhân Linux, mà không cần sửa mã nhân. Điều này giúp giám sát và kiểm soát hệ thống rất hiệu quả.

“Syscalls” là gì?

System calls là cách chương trình yêu cầu hệ điều hành thực hiện tác vụ, như đọc tệp hoặc tạo tiến trình mới. Tetragon có thể giám sát và thậm chí chặn các lệnh gọi này.

“TracingPolicy” là gì?

TracingPolicy là tệp cấu hình bạn tạo để báo cho Tetragon biết sự kiện nào cần theo dõi và cần làm gì khi chúng xảy ra. Nó giống như đưa cho Tetragon những chỉ dẫn cụ thể.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#8110
Giấy phép
Apache-2.0
Cập nhật
31/8/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự