专业的编程技术博客社区

网站首页 > 博客文章 正文

容器安全-Vesta(容器安全阀的整定压力)

baijin 2024-08-29 12:33:03 博客文章 3 ℃ 0 评论

Vesta是一款集容器扫描、Docker和K8s配置基线检查于一身的工具,检查内容包括镜像或容器中包含漏洞版本的组件,同时根据云上实战渗透经验检查Docker以及Kubernetes的危险配置。

Vesta同时也是一个灵活,方便的工具,能够在各种系统上运行,包括但不限于Windows,Linux以及MacOS。

Github开源项目地址:https://github.com/kvesta/vesta/tree/main


Vesta包含两大模块:

  1. scan: 扫描容器和镜像的组件信息,检测是否包含CVE漏洞版本。
  2. analyze: 检查Docker和Kubernetes配置,是否包含危险配置。(后续考虑附加攻击方法)


编译安装: ##基于go 1.18构建

[root@k8s-master-02 ~]# yum install -y make && yum install -y golang

[root@k8s-master-02 ~]# go version ##查看Go语言版本

[root@k8s-master-02 ~]# mkdir /root/vesta && cd /root/vesta

[root@k8s-master-02 ~]# git clone https://github.com/kvesta/vesta.git

[root@k8s-master-02 ~]# make build

[root@k8s-master-02 ~]# cp vesta /usr/local/bin && chmod +x /usr/local/bin/vesta


使用:

vesta scan image cve-2019-14234_web:latest

vesta scan image -f example.tar

vesta scan container <CONTAINER ID>

vesta scan container -f example.tar


vesta analyze docker

make run.docker


vesta analyze k8s


检查项:

  • Scan:

扫描通过主流安装方法安装程序的漏洞:

  1. apt/apt-get
  2. rpm
  3. yum
  4. dpkg


扫描软件依赖的漏洞以及恶意投毒的依赖包:

  1. Java(Jar, War, 以及主流依赖log4j)
  2. NodeJs(NPM, YARN)
  3. Python(Wheel, Poetry)
  4. Golang(Go binary)
  5. PHP(Composer, 以及主流的PHP框架: laravel, thinkphp, wordpress, wordpress插件等)
  6. Rust(Rust binary)


  • Docker检查:

Check Item

Description

Severity

PrivilegeAllowed

危险的特权模式

critical

Capabilities

危险capabilities被设置

critical

Volume Mount

敏感或危险目录被挂载

critical

Docker Unauthorized

2375端口打开并且未授权

critical

Kernel version

当前内核版本存在逃逸漏洞

critical

Network Module

Net模式为host模式或同时在特定containerd版本下

critical/medium

Pid Module

Pid模式被设置为host

high

Docker Server version

Docker Server版本存在漏洞

critical/high/ medium/low

Docker env password check

Docker env是否存在弱密码

high/medium

Docker history

Docker layers 存在不安全的命令

high/medium

Docker Backdoor

Docker env command 存在恶意命令

critical/high

Docker Swarm

Docker Swarm存在危险配置信息以及危险的容器检测

medium/low


  • Kubernetes检查:

Check Item

Description

Severity

PrivilegeAllowed

危险的特权模式

critical

Capabilities

危险capabilities被设置

critical

PV and PVC

PV 被挂载到敏感目录并且状态为active

critical/medium

RBAC

K8s 权限存在危险配置

high/medium/ low/warning

Kubernetes-dashborad

检查 -enable-skip-login以及 dashborad的账户权限

critical/high/ low

Kernel version

当前内核版本存在逃逸漏洞

critical

Docker Server version (k8s versions is less than v1.24)

Docker Server版本存在漏洞

critical/high/ medium/low

Kubernetes certification expiration

证书到期时间小于30天

medium

ConfigMap and Secret check

ConfigMap 或者 Secret是否存在弱密码

high/medium

PodSecurityPolicy check (k8s version under the v1.25)

PodSecurityPolicy过度容忍Pod不安全配置

high/medium/low

Auto Mount ServiceAccount Token

Pod默认挂载了service token

critical/high/ medium/low

NoResourceLimits

没有限制资源的使用,例如CPU,Memory, 存储

low

Job and Cronjob

Job或CronJob没有设置seccomp或seLinux安全策略

low

Envoy admin

Envoy admin被配置以及监听0.0.0.0.

high/medium

Cilium version

Cilium 存在漏洞版本

critical/high/ medium/low

Istio configurations

Istio 存在漏洞版本以及安全配置检查

critical/high/ medium/low

Kubelet 10255/10250 and Kubectl proxy

存在node打开了10250或者10255并且未授权或 Kubectl proxy开启

high/medium/ low

Etcd configuration

Etcd 安全配置检查

high/medium

Sidecar configurations

Sidecar 安全配置检查以及Env环境检查

critical/high/ medium/low

Pod annotation

Pod annotation 存在不安全配置

high/medium/ low/warning

DaemonSet

DaemonSet存在不安全配置

critical/high/ medium/low

Backdoor

检查k8s中是否有后门

critical/high

Lateral admin movement

Pod被特意配置到Master节点中

medium/low

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表