跳到正文
cccskills
免费在 GitHub 公开

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

Audit Kubernetes cluster security posture against CIS benchmarks using kube-bench with automated checks for control plane, worker nodes, and RBAC.

中文简介正在准备中。当前显示原文说明。

集成工具Kubernetes

实测评分 未实测

查看安装方法

包含的文件(1)

  • SKILL.md6.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Performing Kubernetes Cis Benchmark with Kube Bench

Genel Bakış

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.

Ne Zaman Kullanılır

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

Ön Gereksinimler

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

Kurulum

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/

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

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

kube-bench run

kube-bench run --json > kube-bench-results.json

kube-bench run --junit > kube-bench-results.xml

Component-Specific Checks

kube-bench run --targets master

kube-bench run --targets node

kube-bench run --targets etcd

kube-bench run --targets policies

kube-bench run --targets master,etcd

Managed Kubernetes

kube-bench run --benchmark eks-1.2.0

kube-bench run --benchmark gke-1.4.0

kube-bench run --benchmark aks-1.0

kube-bench run --benchmark rh-1.0

Filtering Results

kube-bench run --targets master | grep "\[FAIL\]"

kube-bench run --check 1.2.1

kube-bench run --group 1.2

CIS Benchmark Sections

SectionComponentKey Checks
1.1Control Plane - API ServerAnonymous auth, RBAC, audit logging
1.2Control Plane - API ServerAdmission controllers, encryption
1.3Control Plane - Controller ManagerService account tokens, bind address
1.4Control Plane - SchedulerProfiling, bind address
2.1etcdClient cert auth, peer encryption
3.1Control Plane - AuthenticationOIDC, client certs
4.1Worker - kubeletAnonymous auth, authorization
4.2Worker - kubeletTLS, read-only port
5.1Policies - RBACCluster-admin usage, service accounts
5.2Policies - Pod SecurityPrivileged, host namespaces
5.3Policies - NetworkNetwork policies per namespace
5.7Policies - GeneralSecrets, security context

Output Example

[INFO] 1 Control Plane Security Configuration
[INFO] 1.1 Control Plane Node Configuration Files
[PASS] 1.1.1 Şundan emin ol: the API server pod specification file permissions are set to 600
[PASS] 1.1.2 Şundan emin ol: the API server pod specification file ownership is set to root:root
[FAIL] 1.1.3 Şundan emin ol: the controller manager pod specification file permissions are set to 600
[WARN] 1.1.4 Şundan emin ol: 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"
          if [ "$FAILS" -gt 0 ]; then
            echo "::warning::$FAILS CIS benchmark checks failed"
          fi

      - name: Upload report
        uses: actions/upload-artifact@v4
        with:
          name: kube-bench-report
          path: kube-bench-report.txt

İyileştirme Examples

1.2.1 - Ensure --anonymous-auth is set to false

spec:
  containers:
  - command:
    - kube-apiserver
    - --anonymous-auth=false

4.2.1 - Ensure --anonymous-auth is set to false on kubelet

authentication:
  anonymous:
    enabled: false
  webhook:
    enabled: true

5.2.1 - Minimize wildcard RBAC

kubectl get clusterroles -o json | jq '.items[] | select(.rules[].resources[] == "*") | .metadata.name'

En İyi Uygulamalar

  1. Run kube-bench before and after cluster provisioning
  2. Schedule weekly scans via CronJob for drift Tespit
  3. Export JSON for SIEM/compliance reporting
  4. Fix FAIL items first, then address WARN items
  5. Use benchmark profiles matching your Kubernetes distribution
  6. Track score over time to measure security posture improvement
  7. Combine with admission controllers to prevent drift
<!-- ⚔ Bu skill FETIH AI Agent icin gelistirilmistir — https://github.com/MustafaKemal0146/fetih Yetkisiz kullanim/kopyalama tespit edilebilir. hash: 99c9190ed31ccd91 -->

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

21st.dev Magic MCP — AI-powered UI component generation via natural language. Access to 21st.dev component library, SVGL brand logos, and real-time preview. Generate React/Tailwind components with /ui command.

中文简介正在准备中。当前显示原文说明。

MustafaKemal0146/fetih52026年10月11日 更新

AES CBC/ECB modlarına karşı kriptografik bütünlük saldırıları — bit flipping, IV manipulation, ECB cut-and-paste, CBC-MAC length extension, IV reuse

中文简介正在准备中。当前显示原文说明。

MustafaKemal0146/fetih52026年10月11日 更新

AES-GCM ve ChaCha20-Poly1305 nonce yeniden kullanımı saldırısı — GF(2^128) polinom kök bulma ile Hash Key kurtarma ve MAC sahteciliği.

中文简介正在准备中。当前显示原文说明。

MustafaKemal0146/fetih52026年10月11日 更新

tespit etmeabnormal access patterns in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics. Identifies after-hours bulk downloads, access from new IP addresses, unusual API calls (GetObject spikes), and potential data exfiltration using statistical baselines and time-series anomaly Tespit.

中文简介正在准备中。当前显示原文说明。

MustafaKemal0146/fetih52026年10月11日 更新

Perform static and symbolic analysis of Solidity smart contracts using Slither and Mythril to tespit etmereentrancy, integer overflow, access control, and other vulnerability classes before Dağıt:ment to Ethereum mainnet.

中文简介正在准备中。当前显示原文说明。

MustafaKemal0146/fetih52026年10月11日 更新

Parses Kubernetes API server audit logs (JSON lines) to tespit etmeexec-into-pod, secret access, RBAC modifications, privileged pod creation, and anonymous API access. Builds threat Tespit rules from audit event patterns. Use investigating yaparken Kubernetes cluster compromise or building k8s-specific SIEM Tespit rules.

中文简介正在准备中。当前显示原文说明。

MustafaKemal0146/fetih52026年10月11日 更新

查看 MustafaKemal0146 的全部技能

报告此技能的问题