CIS Kubernetes Benchmark

了解什么是CIS基准

Center for Internet Security
Internet 安全中心是一个非盈利性实体,其任务是“确定、开发、验证、升级和维持针对网
络防御的最佳做法解决方案”。 它借鉴了来自世界各地政府、企业和学术界网络安全及 IT
专业人员的专业知识。 为了制定标准和最佳做法(包括 CIS 基准、控制措施和强化映像),
他们遵循一致的决策制定模型。
CIS 基准提供两个级别的安全设置:
L1(即级别 1)建议可在任何系统上配置且应基本不会或不会导致服务中断或导致功能性降低的基
本必需安全要求。
L2(即级别 2)建议适用于需高安全性的环境,但可能会导致某些功能性降低的安全设置。
https://www.cisecurity.org/benchmark/kubernetes/
在这里插入图片描述

使用kube-bench检测系统安全

安装kube-bench
检测master
检测kubelet
https://github.com/aquasecurity/kube-bench/tags

./kube-bench --config-dir `pwd`/cfg --config `pwd`/cfg/config.yaml run --targets=etcd
master node controlplane etcd policies

旧版本

kube-bench master
kube-bench node

etcd是一个服务发现系统,具备以下的特点:
简单:安装配置简单,而且提供了HTTP API进行交互,使用也很简单
安全:支持SSL证书验证
快速:根据官方提供的benchmark数据,单实例支持每秒2k+读操作
可靠:采用raft算法,实现分布式系统数据的可用性和一致性
etcd应用场景
用于服务发现,服务发现(ServiceDiscovery)要解决的是分布式系统中最常见的问题之一,即在同一个分布式集群中的进程或服务如何才能找到对方并建立连接。
要解决服务发现的问题,需要具备下面三种必备属性。
1.AlwaysDeny
表示拒绝所有请求,通常不使用哈

2.AlwaysAllow
默认的策略,允许接收所有请求,就相当于没进行权限控制

3.ABAC
表示使用用户配置的授权规则对用户请求进行匹配和控制(基于用户属性)

4.Webhook
引用外部REST服务对用户进行授权管理

5.Node
用于对kubelet发出的请求进行访问控制,比较特殊的一种模式

6.RBAC
基于角色访问控制,一般是需要账号等

1-kubebench

开始检测
1-安装kube-bench

tar zxf kube-bench_0.6.3_linux_amd64.tar.gz

在这里插入图片描述
在这里插入图片描述

监测master

./kube-bench --config-dir cfg --config cfg/config.yaml run --targets=master

模拟问题1

vim /etc/kubernetes/manifests/kube-apiserver.yaml
注释- --authorization-mode=Node,RBAC
再次添加- --authorization-mode=AlwaysAllow

 vim /etc/kubernetes/manifests/etcd.yaml
 改参数把true改为false
 - --client-cert-auth=false
 
 重启kubelet
 systemctl restart kubelet

模拟问题2

vim /var/lib/kubelet/config.yaml
authentication:
  anonymous:
    enabled: false ---> true

authorization:
  mode: Webhook ---> AlwaysAllow
 重启kubelet
 systemctl restart kubelet

在这里插入图片描述

根据提示修改。

文件清单: CIS Google Kubernetes Engine (GKE) Benchmark v1.0.0.pdf CIS_Aliyun_Linux_2_Benchmark_v1.0.0.pdf CIS_Amazon_Linux_2_Benchmark_v1.0.0.pdf CIS_Amazon_Linux_2_STIG_Benchmark_v1.0.0.pdf CIS_Amazon_Web_Services_Foundations_Benchmark_v1.2.0.pdf CIS_Amazon_Web_Services_Three-tier_Web_Architecture_Benchmark_v1.0.0.pdf CIS_Apache_HTTP_Server_2.4_Benchmark_v1.5.0.pdf CIS_Apache_Tomcat_9_Benchmark_v1.0.0.pdf CIS_Apple_iOS_12_Benchmark_v1.0.0.pdf CIS_Apple_iOS_13_and_iPadOS_13_Benchmark_v1.0.0.pdf CIS_CentOS_Linux_6_Benchmark_v2.1.0.pdf CIS_CentOS_Linux_8_Benchmark_v1.0.0.pdf CIS_Debian_Linux_10_Benchmark_v1.0.0.pdf CIS_Debian_Linux_8_Benchmark_v2.0.1.pdf CIS_Debian_Linux_9_Benchmark_v1.0.1.pdf CIS_Distribution_Independent_Linux_Benchmark_v2.0.0.pdf CIS_Docker_1.13.0_Benchmark_v1.0.0.pdf CIS_Docker_Benchmark_v1.2.0.pdf CIS_Docker_Community_Edition_Benchmark_v1.1.0.pdf CIS_Fedora_28_Family_Linux_Benchmark_v1.0.0.pdf CIS_Google_Android_Benchmark_v1.3.0.pdf CIS_Google_Chrome_Benchmark_v2.0.0.pdf CIS_Google_Cloud_Platform_Foundation_Benchmark_v1.1.0.pdf CIS_Kubernetes_Benchmark_v1.5.1.pdf CIS_Microsoft_Exchange_Server_2016_Benchmark_v1.0.0.pdf CIS_Microsoft_IIS_10_Benchmark_v1.1.1.pdf CIS_Microsoft_SQL_Server_2019_Benchmark_v1.0.0.pdf CIS_Microsoft_Windows_10_Enterprise_Release_1909_Benchmark_v1.8.1.pdf CIS_Microsoft_Windows_7_Workstation_Benchmark_v3.1.0.pdf CIS_Microsoft_Windows_8.1_Workstation_Benchmark_v2.3.0.pdf CIS_Microsoft_Windows_Server_2012_R2_Benchmark_v2.3.0.pdf CIS_Microsoft_Windows_Server_2019_RTM_Release_1809_Benchmark_v1.0.1.pdf CIS_MongoDB_3.4_Benchmark_v1.0.0.pdf CIS_MongoDB_3.6_Benchmark_v1.0.0.pdf CIS_NGINX_Benchmark_v1.0.0.pdf CIS_Oracle_MySQL_Community_Server_5.7_Benchmark_v1.0.0.pdf CIS_Oracle_MySQL_Enterprise_Edition_5.6_Benchmark_v1.1.0.pdf CIS_Oracle_Solaris_11.4_Benchmark_v1.0.0.pdf CIS_PostgreSQL_12_Benchmark_v1.0.0.pdf CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v2.2.0.pdf CIS_Red_Hat_Enterprise_Linux_8_Benchmark_v1.0.0.pdf CIS_Security_Metrics-Quick_Start_Guide_v1.0.0.pdf CIS_Security_Metrics_v1.1.0.pdf CIS_SUSE_Linux_Enterprise_12_Benchmark_v2.1.0.pdf CIS_Ubuntu_Linux_16.04_LTS_Benchmark_v1.1.0.pdf CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1.pdf CIS_VMware_ESXi_6.5_Benchmark_v1.0.0.pdf CIS_VMware_ESXi_6.7_Benchmark_v1.0.0.pdf
Cisco IOS 15.xx 的安全加固。 Table of Contents Table of Contents .................................................................................................................................................. 2 Overview .................................................................................................................................................................. 7 Intended Audience ........................................................................................................................................... 7 Consensus Guidance ........................................................................................................................................ 7 Typographical Conventions ......................................................................................................................... 8 Scoring Information ........................................................................................................................................ 8 Profile Definitions ............................................................................................................................................ 9 Acknowledgements ...................................................................................................................................... 10 Recommendations ............................................................................................................................................. 11 1 Management Plane .................................................................................................................................... 11 1.1 Local Authentication, Authorization and Accounting (AAA) Rules ............................... 11 1.1.1 Enable 'aaa new-model' (Scored) ....................................................................................... 12 1.1.2 Enable 'aaa authentication login' (Scored) ..................................................................... 14 1.1.3 Enable 'aaa authentication enable default' (Scored) .................................................. 16 1.1.4 Set 'login authentication for 'line con 0' (Scored) ........................................................ 17 1.1.5 Set 'login authentication for 'line tty' (Scored) ............................................................. 19 1.1.6 Set 'login authentication for 'line vty' (Scored) ............................................................ 21 1.1.7 Set 'aaa accounting' to log all privileged use commands using 'commands 15' (Scored) ................................................................................................................................................... 23 1.1.8 Set 'aaa accounting connection' (Scored) ........................................................................ 24 1.1.9 Set 'aaa accounting exec' (Scored) ..................................................................................... 26 1.1.10 Set 'aaa accounting network' (Scored) .......................................................................... 28 1.1.11 Set 'aaa accounting system' (Scored) ............................................................................. 30 1.2 Access Rules ........................................................................................................................................ 31 1.2.1 Set 'privilege 1' for local users (Scored) .......................................................................... 32 1.2.2 Set 'transport input ssh' for 'line vty' connections (Scored) .................................... 33 1.2.3 Set 'no exec' for 'line aux 0' (Scored) ................................................................................ 34 1.2.4 Create 'access-list' for use with 'line vty' (Not Scored) .............................................. 36 1.2.5 Set 'access-class' for 'line vty' (Scored) ............................................................................ 38
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值