Перейти к содержанию
Skillpedia
Деплой и облако (DevOps)35k · #7688

benchmarking-kubernetes-with-kube-bench

Что он делает

Проверяет, настроен ли ваш кластер Kubernetes безопасно в соответствии с рекомендациями CIS. Он анализирует ключевые компоненты и выводит отчёт о проблемах с советами по их исправлению.

Когда использовать

  • ✓Когда вы впервые настраиваете новый кластер Kubernetes.
  • ✓Для регулярных аудитов безопасности.
  • ✓Чтобы убедиться, что исправления безопасности применены правильно.

Ссылка на скилл

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/benchmarking-kubernetes-with-kube-bench/SKILL.md

Скопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.

Как использовать

Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.

Готовое сообщение для вставки

Используй этот скилл, чтобы помочь мне: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/benchmarking-kubernetes-with-kube-bench/SKILL.md Прочитай файл SKILL.md по этой ссылке и следуй его инструкциям в моей задаче.
Хотите, чтобы ваш ИИ сам находил такие скиллы?Установите бесплатный MCP Skillpedia: одна строка, и перед каждой задачей он ищет среди 15 000+ скиллов.Установить за 1 минуту →

Пример запроса к вашему ИИ

“Проверь мой кластер Kubernetes по лучшим практикам безопасности CIS.”

5 новых скиллов в неделю. 1 минута чтения.

Как это работает

Kube-bench это инструмент, который запускает заранее заданные проверки вашего кластера. Он сравнивает текущую конфигурацию с стандартами безопасности и формирует отчёт, в котором указано, что соответствует требованиям (PASS), а что нужно исправить (FAIL, WARN).

Технический текст (оригинальный SKILL.md)

Оригинальный текст автора на английском, прямо с GitHub.

Benchmarking Kubernetes with kube-bench

Overview

kube-bench (by Aqua Security) is an open-source tool that checks whether a Kubernetes cluster is deployed securely by running the checks documented in the CIS Kubernetes Benchmark. It inspects the control-plane components (API server, controller manager, scheduler, etcd), the kubelet and worker-node configuration, and cluster-wide policy settings, then reports each check as PASS, FAIL, WARN, or INFO with a remediation recommendation drawn directly from the CIS guidance. Tests are configuration-driven YAML files, so kube-bench tracks new Kubernetes versions and benchmark revisions and supports managed distributions (EKS, GKE, AKS, ACK, OpenShift, RKE, k3s).

Hardening a cluster against the CIS Benchmark directly reduces the attack surface for T1610 (Deploy Container), where an adversary deploys a container to execute code or evade defenses — for example by abusing privileged containers, host namespaces, anonymous API access, or insecure kubelet settings that an unhardened cluster leaves exposed.

kube-bench can run as a standalone binary on a node, inside a container, or — most commonly — as a Kubernetes Job whose pod has the host filesystem mounted so it can read the relevant config files. Output is available as human-readable text, JSON, JUnit, or AWS Security Finding Format (ASFF) and can be pushed to a PostgreSQL database for trend tracking.

When to Use

  • When establishing a security baseline for a new Kubernetes cluster against the CIS Kubernetes Benchmark.
  • When performing periodic compliance audits of control-plane and node hardening.
  • When validating remediation after applying hardening changes (re-run to confirm checks now PASS).
  • When integrating cluster compliance scanning into CI/CD or a continuous monitoring pipeline.
  • When preparing evidence for SOC 2, PCI DSS, or internal hardening compliance.

Prerequisites

  • Access to the cluster: either SSH access to a control-plane/worker node (binary mode) or kubectl with permission to create Jobs (in-cluster mode).
  • Knowledge of the cluster's Kubernetes version (kube-bench auto-detects, or specify with --version / --benchmark).
  • Install kube-bench (Aqua Security official methods):
# Binary release (Linux)
KB_VERSION=0.10.7
curl -L -o kube-bench.tgz \
  "https://github.com/aquasecurity/kube-bench/releases/download/v${KB_VERSION}/kube-bench_${KB_VERSION}_linux_amd64.tar.gz"
tar -xzf kube-bench.tgz
sudo mv kube-bench /usr/local/bin/
sudo cp -R cfg /etc/kube-bench/cfg

# Via Go install
go install github.com/aquasecurity/kube-bench@latest

# Run as a one-off container directly on a node (mounts host config)
docker run --rm --pid=host \
  -v /etc:/etc:ro -v /var:/var:ro \
  -t docker.io/aquasec/kube-bench:latest run --targets node

# Verify
kube-bench version

Objectives

  • Run kube-bench against the appropriate benchmark for the cluster's Kubernetes version.
  • Scan control-plane (master), node, etcd, control-plane policies, and managed-service targets.
  • Produce machine-readable JSON/JUnit output for pipelines and dashboards.
  • Triage FAIL and WARN results and apply CIS remediation guidance.
  • Re-run to validate that remediations now PASS.

MITRE ATT&CK Mapping

Technique ID Name Tactic Relevance
T1610 Deploy Container Execution / Defense Evasion CIS Benchmark hardening enforced by kube-bench restricts privileged/host-namespace deployments, anonymous API access, and insecure kubelet settings that adversaries abuse when deploying malicious containers.

Workflow

1. Run the default scan (auto-detect)

Run all applicable targets, letting kube-bench detect the Kubernetes version and benchmark:

sudo kube-bench

2. Run as a Kubernetes Job (in-cluster)

Apply the provided Job manifest from the kube-bench repo and read the results from the pod logs:

# General-purpose job
kubectl apply -f https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job.yaml

# Wait, then retrieve results
kubectl get pods -l app=kube-bench
kubectl logs -l app=kube-bench

# Platform-specific jobs are available, e.g. EKS:
kubectl apply -f https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job-eks.yaml

3. Target specific components

Use run --targets to scope the scan to particular component groups:

# Control-plane (API server, scheduler, controller manager)

…
Частые вопросы

Что такое CIS Kubernetes Benchmark?

Это набор рекомендаций по безопасности, созданный Центром интернет-безопасности (Center for Internet Security), который помогает защитить вашу инфраструктуру Kubernetes.

Какие части Kubernetes он проверяет?

Он проверяет основные компоненты (например, API server), рабочие узлы (kubelet) и другие важные настройки кластера.

Можно ли использовать его в облаках AWS, Google Cloud или Azure?

Да, kube-bench поддерживает конфигурации для управляемых кластеров в этих облаках, например EKS, GKE и AKS.

Подробности

Оригинальное описание автора

Installs and runs the kube-bench tool against a Kubernetes cluster as a Job, DaemonSet, or standalone binary, selecting the correct benchmark version and targets (control plane, etcd, kubelet, worker nodes) and emitting JSON or JUnit output for pipelines. Use when setting kube-bench up for the first time, choosing which benchmark version and node targets to run, wiring it into CI, or troubleshooti

repo: mukul975/Anthropic-Cybersecurity-Skills

Популярность

Звёзды на GitHub
35k
Место в рейтинге
#7688
Лицензия
Apache-2.0
Обновлён
31.08.2026

Полезен ли этот скилл?

0

Войдите , чтобы голосовать.

Комментарии

  • …

Другие скиллы из этого репозитория

Похожие скиллы