K8s Security Best Practices-K8S安全最佳实践

  1. 关于安全-写在前面的:
    Security is complex and a process 安全是复杂的,而且是一个过程
    1. Security combines many diffenrent things 安全结合了许多不同的东西
    2. Environments change,security cannot stay in a certain state 环境变化,安全性不能保持一定状态
    3. Attackers have advantage 攻击者有优势
      3.1 . They decide time 他们决定的时间(任意时间)
      3.2. They pick what to attack ,like weakest link 他们选择要攻击的内容,例如最薄弱的环节

1. Security Principles 安全原则

在这里插入图片描述

  1. Defense in depth 深度防御
  2. Least Privilege 最小权限原则
  3. Limiting the Attack Surface 限制攻击面
  4. Layered defence and Redundancy 分层防御和冗余
    在这里插入图片描述

2. K8s Security Categories k8S安全分类

在这里插入图片描述

2.1 Host OS Security 宿主机操作系统安全

在这里插入图片描述


 1. kubernets Node should only do one thing :  Kubernetes 
    kubernets节点应该只运行kubernets
    1.1. Reduce Attack Surface   减少攻击面             
    1.2. Remove unnecessary applications   移除不必要的应用                          
 2. Keep up to date     保持升级
 3. Rutime security tools     运行时安全工具
 4. Find and identify malicious processes  查找和识别恶意进程
 5. Restrict IAM  ssh access      限制IAM(Identity and Access Management  身份识别与访问管理服务) 与SSH访问

2.2 Kubernetes Cluster Security k8s集群安全

在这里插入图片描述
kubernetes components are runing secure and up-to-data kubernetes集群组件保持安全和最新的运行

1. apiserver
2. kubelet
3. etcd

Restrict(external)access 限制(外部)访问
use authentication ->authorization 使用身份认证 授权
Admission Controllers 控制器准入?
noderestriction 节点限制
custom policies(opa) 自定义规则
Enable Audit Logging 启用审计日志记录
Security Benchmarking 安全基线测试

由此可见最新的还是很重要的,老的版本会有漏洞,有必要保证组件版本的更新升级
在这里插入图片描述
一个通过 pod 攻击etcd的例子展现与etcd的安全策略:
加密etcd
限制访问etcd
加密与etcd的通信

2.3 Application Security 应用安全

在这里插入图片描述

 1. Use Secrets /no hardcoded credentials  使用secrets秘钥 而不是硬编码的凭据

 2. RBAC                       基于角色的访问控制
 
 3. Container Sandboxing                          容器沙盒

 4. Container Hardening                            容器加固

   4.1 Attack Surface                             攻击表面
   
   4.2 Run as user                                 作为用户运行 no root
   
   4.3 Readonly filesystem                    只读的文件系统
   
5. Vulnerability Scanning                         漏洞扫描

6. MTLS/ServiceMeshes                          双向认证/服务网格在这里插入代码片
  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

对你无可奈何2008

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

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

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

打赏作者

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

抵扣说明:

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

余额充值