CKS之k8s安全基准工具:kube-bench,已拿意向书

kube-bench run --parallel

7. 更新CIS基准到最新版本

kube-bench download latest

8. 查看kube-bench版本

kube-bench version

kube-bench配置

1.文件格式
kube-bench的配置文件采用YAML格式,包含一系列的检查项配置。每个检查项通过唯一的id进行标识。

测试项目配置文件路径:/etc/kube-bench/cfg/cis-1.6/

配置项示例:

  • id: 1.2.21
    text: “Ensure that the --profiling argument is set to false (Automated)”
    audit: “/bin/ps -ef | grep $apiserverpbin | grep -v grep”
    tests:
    test_items:
    • flag: “–profiling”
      compare:
      op: eq
      value: false
      remediation: |
      Edit the API server pod specification file $apiservercconf
      on the master node and set the below parameter.
      –profiling=fals

2.检查项字段
每个检查项都包含以下几个主要字段:

  • id: 唯一标识符

  • text: 对该检查项的文字描述

  • audit: 执行审计的命令,用于检查当前系统状态

  • tests: 具体的测试条件  #tests下的test_items字段定义了具体的测试条件。可以根据实际需求修改该部分的测试逻辑

    • test_items: 实际测试项
    • compare: 测试结果与期望值的比较方式(eq、neq等)
  • remediation: 如果审计失败,给出的修复建议

  • scored: 该项对总分数的影响(true、false、WARN)

  • type: 该项的处理方式(manual、skip、info)   #对于某些无法自动检查的项目,可以设置type=manual,kube-bench就会跳过该项并给出WARN警告。如果想跳过某项检查,可以将对应项的type设为skip,这样kube-bench就不会执行该项检查。

  1. 处理
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值