Skip to content
Skillpedia
Testing35k · #6089

performing-kubernetes-cis-benchmark-with-kube-bench

Lets your agent audit Kubernetes compliance with security benchmarks, interpreting results and suggesting fixes.

What it does

This tool checks if your Kubernetes system is configured according to CIS Benchmark security best practices. It identifies weaknesses and suggests how to fix them.

When to use it

  • ✓When conducting a scheduled security audit.
  • ✓When investigating security issues.
  • ✓When testing the security of your Kubernetes cluster.

Example of what to ask your AI

“Check my Kubernetes cluster against security best practices.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

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

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-kubernetes-cis-benchmark-with-kube-bench/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool runs automated checks on your Kubernetes cluster. It compares the current configuration with security recommendations and generates a report with results (pass, fail, warn) and suggested fixes.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill performing-kubernetes-cis-benchmark-with-kube-bench

Or download just the file:

curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/performing-kubernetes-cis-benchmark-with-kube-bench/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Performing Kubernetes CIS Benchmark with kube-bench

Overview

kube-bench is an open-source Go tool by Aqua Security that runs the CIS Kubernetes Benchmark checks. It verifies control plane, etcd, worker node, and policy configurations against security best practices, producing actionable pass/fail/warn reports.

When to Use

  • When conducting security assessments that involve performing kubernetes cis benchmark with kube bench
  • When following incident response procedures for related security events
  • When performing scheduled security testing or auditing activities
  • When validating security controls through hands-on testing

Prerequisites

  • Kubernetes cluster (v1.24+)
  • kubectl with cluster-admin access
  • Node access for direct runs or privileged pod access

Installation

# Binary installation
curl -L https://github.com/aquasecurity/kube-bench/releases/download/v0.7.3/kube-bench_0.7.3_linux_amd64.tar.gz | tar xz
sudo mv kube-bench /usr/local/bin/

# Run as Kubernetes Job
kubectl apply -f https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job.yaml
kubectl logs job/kube-bench

# Run as a pod with host access
kubectl apply -f https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job-master.yaml
kubectl apply -f https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job-node.yaml

Running Benchmarks

Full Benchmark

# Run all checks (auto-detects node type)
kube-bench run

# Run with JSON output
kube-bench run --json > kube-bench-results.json

# Run with JUnit output for CI
kube-bench run --junit > kube-bench-results.xml

Component-Specific Checks

# Control plane (master) checks
kube-bench run --targets master

# Worker node checks
kube-bench run --targets node

# etcd checks
kube-bench run --targets etcd

# Policies checks
kube-bench run --targets policies

# Control plane + etcd
kube-bench run --targets master,etcd

Managed Kubernetes

# Amazon EKS
kube-bench run --benchmark eks-1.2.0

# Google GKE
kube-bench run --benchmark gke-1.4.0

# Azure AKS
kube-bench run --benchmark aks-1.0

# Red Hat OpenShift
kube-bench run --benchmark rh-1.0

Filtering Results

# Show only failures
kube-bench run --targets master | grep "\[FAIL\]"

# Run specific check
kube-bench run --check 1.2.1

# Run check group
kube-bench run --group 1.2

CIS Benchmark Sections

Section Component Key Checks
1.1 Control Plane - API Server Anonymous auth, RBAC, audit logging
1.2 Control Plane - API Server Admission controllers, encryption
1.3 Control Plane - Controller Manager Service account tokens, bind address
1.4 Control Plane - Scheduler Profiling, bind address
2.1 etcd Client cert auth, peer encryption
3.1 Control Plane - Authentication OIDC, client certs
4.1 Worker - kubelet Anonymous auth, authorization
4.2 Worker - kubelet TLS, read-only port
5.1 Policies - RBAC Cluster-admin usage, service accounts
5.2 Policies - Pod Security Privileged, host namespaces
5.3 Policies - Network Network policies per namespace
5.7 Policies - General Secrets, security context

Output Example

[INFO] 1 Control Plane Security Configuration
[INFO] 1.1 Control Plane Node Configuration Files
[PASS] 1.1.1 Ensure that the API server pod specification file permissions are set to 600
[PASS] 1.1.2 Ensure that the API server pod specification file ownership is set to root:root
[FAIL] 1.1.3 Ensure that the controller manager pod specification file permissions are set to 600
[WARN] 1.1.4 Ensure that the scheduler pod specification file permissions are set to 600

== Summary ==
45 checks PASS
12 checks FAIL
8 checks WARN
0 checks INFO

CI/CD Integration

GitHub Actions

name: CIS Benchmark
on:
  schedule:
    - cron: '0 6 * * 1'

jobs:
  kube-bench:
    runs-on: ubuntu-latest
    steps:
      - name: Configure kubectl
        uses: azure/setup-kubectl@v3

      - name: Run kube-bench
        run: |
          kubectl apply -f https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job.yaml
          kubectl wait --for=condition=complete job/kube-bench --timeout=120s
          kubectl logs job/kube-bench > kube-bench-report.txt

      - name: Check for failures
        run: |
          FAILS=$(grep -c "\[FAIL\]" kube-bench-report.txt || true)
          echo "Failed checks: $FAILS"

…
FAQ

What is the CIS Benchmark?

It's a set of widely accepted security recommendations for computing systems, including Kubernetes.

What is kube-bench?

It's a tool that automates the execution of CIS Kubernetes Benchmark checks.

Do I need special access to use it?

Yes, you need administrator access to the Kubernetes cluster and, in some cases, direct node access.

Details

Original description by the author

Turns kube-bench output into a finished CIS Kubernetes Benchmark audit: interpreting PASS/FAIL/WARN per control, judging which failures are genuine on a managed cluster, writing remediation, and packaging evidence for SOC 2 or PCI DSS. Use when conducting a scheduled compliance audit, triaging kube-bench results, deciding which controls are not applicable on EKS, GKE, or AKS, or producing hardenin

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#6089
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills