组件:runc
漏洞名称:runc 路径遍历漏洞
CVE 编号:CVE-2021-30465
修复策略:将 runc 升级到 1.0.0-rc95 及以上版本。
说明:升级 runc 组件不会重启业务 Pod。
#!/bin/bash
util::is_docker() {
if command -v docker 1>/dev/null 2>&1; then
RUNTIME="docker"
return 0
else
return 1
fi
}
wget http://static.ccs.tencentyun.com/docker-19.03.9-install-1.2.tgz
tar -zxf docker-19.03.9-install-1.2.tgz
if ! docker-19.03/bin/runc --version; then
echo "unmatch libseccomp version"
# Get OS distribution
OS_RELEASE="$(. /etc/os-release && echo "$ID")"
OS_VERSION="$(. /etc/os-release && echo "$VERSION_ID")"
if [ "ubuntu" = "${OS_RELEASE}" ]; then
apt-get install libseccomp2
else
yum install -y libseccomp
fi
fi
if ! docker-19.03/bin/runc --version; then
echo "bad libseccomp version"
exit 1;
fi
if util::is_docker; then
cp docker-19.03/bin/runc /usr/bin/docker-runc
cp docker-19.03/bin/runc /usr/bin/runc
else
cp docker-19.03/bin/runc /usr/local/sbin/runc
fi
rm -r docker-19.03
rm docker-19.03.9-install-1.2.tgz
本页内容是否解决了您的问题?