Cluster Setup - CIS Benchmarks(集群设置-CIS基线)

前言

这一节主要掌握使用 kube-bench cis 安全基线检查集群的安全配置,并提高集群的安全性。所有操作都是抛砖引玉。

1 . 什么是 CIS

CIS----Center fo internet Security 互联网安全中心

2. 关于csi

  1. 安全配置目标系统的最佳实践
  2. 涵盖超过14个技术组织
  3. 通过独特的基于共识的流程开发而成,该流程由世界各地的网络安全专业人员和主题专家组成

image.png

3. 关于 CIS Benchmarks

CIS Benchmarks -Default k8s security rules 默认的kubernets的安全准则
无论是原生还是通过谷歌或者亚马逊云的定制化

image.png

3.1 CSI Benchmarks

详见https://learn.cisecurity.org/benchmarks
image.png

image.png

最新版本CIS_Kuberntets_Benchmark_v1.6.0.pdf
关于 1.6.0pdf版本对应kubernetes版本为1.16-1.18,版本还是有滞后性的

image.png
关于控制平面的文档位于pdf 16页的 规则1.1.1
关于work节点的文档位于208页的规则4.2.10
image.png

3.2 kube-bench

3.2.1 master节点运行kube-bench

image.png
https://github.com/aquasecurity/kube-bench
image.png

 docker run --pid=host -v /etc:/etc:ro -v /var:/var:ro -t aquasec/kube-bench:latest master --version 1.19

image.png

image.png
image.png
对象文档修改etcd权限

stat -c %a /var/lib/etcd
chmod 700 /var/lib/etcd
useradd etcd
chown etcd:etcd /var/lib/etcd

image.png

3.2.2 node(work)节点运行kube-bench
docker run --pid=host -v /etc:/etc:ro -v /var:/var:ro -t aquasec/kube-bench:latest node --version 1.19

image.png
举个例子选择了4.2.6,pdf中找到4.2.6对应位置。
image.png

 vi /etc/systemd/system/kubelet.service.d/10-kubeadm.conf

image.png

image.png
OK 测试完成,其实上面master节点运行kube-bench还有很多FAIL.操作方法都与上面类似。找到对应role。pdf中查找解决方案。执行解决方案.都是这样的流程

文件清单: 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
Docker 1.13 安全配置 ............................................................................................................................................. 11 1 Host Configuration .................................................................................................................................... 11 1.1 Create a separate partition for containers (Scored) ....................................................... 11 1.2 Harden the container host (Not Scored) ............................................................................. 13 1.3 Keep Docker up to date (Not Scored) ................................................................................... 15 1.4 Only allow trusted users to control Docker daemon (Scored) ................................... 16 1.5 Audit docker daemon (Scored) ............................................................................................... 18 1.6 Audit Docker files and directories - /var/lib/docker (Scored) .................................. 20 1.7 Audit Docker files and directories - /etc/docker (Scored) .......................................... 22 1.8 Audit Docker files and directories - docker.service (Scored) ..................................... 24 1.9 Audit Docker files and directories - docker.socket (Scored) ....................................... 26 1.10 Audit Docker files and directories - /etc/default/docker (Scored) ....................... 28 1.11 Audit Docker files and directories - /etc/docker/daemon.json (Scored) ........... 30 1.12 Audit Docker files and directories - /usr/bin/docker-containerd (Scored) ...... 32 1.13 Audit Docker files and directories - /usr/bin/docker-runc (Scored) ................... 34 2 Docker daemon configuration .............................................................................................................. 36 2.1 Restrict network traffic between containers (Scored) .................................................. 36 2.2 Set the logging level (Scored) .................................................................................................. 38 2.3 Allow Docker to make changes to iptables (Scored) ...................................................... 39 2.4 Do not use insecure registries (Scored) .............................................................................. 41
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

对你无可奈何2008

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值