2018阿里云云盾安骑士CentOS漏洞修复命令

发布:2018-05-08 来源:一推响 作者:admin 分类:网站建设教程

2018阿里云云盾安骑士CentOS漏洞修复命令

漏洞修复在测试中无法覆盖所有系统环境,进行漏洞补丁修复行为仍存在一定风险。为了防止出现不可预料的后果,建议您先通过控制台手动创建快照并自行搭建环境充分测试修复方案,登录到服务器上运行以下修复命令即可。

漏洞修复

RHSA-2017:1365: nss security and bug fix update (Important)

软件:nss 3.21.0-17.el7

命中:nss version less than 0:3.28.4-1.2.el7_3

yum update nss

yum update nss-sysinit

yum update nss-tools

RHSA-2017:1100: nss and nss-util security update (Critical)

软件:nss-util 3.21.0-2.2.el7_2

命中:nss-util version less than 0:3.28.4-1.0.el7_3

yum update nss-util

yum update nss

yum update nss-sysinit

yum update nss-tools

RHSA-2017:2292: gnutls security, bug fix, and enhancement update (Moderate)

软件:gnutls 3.3.24-1.el7

命中:gnutls version less than 0:3.3.26-9.el7

yum update gnutls

RHSA-2017:0086: kernel security, bug fix, and enhancement update (Important)

软件:kernel-tools 3.10.0-514.el7

命中:kernel-tools version less than 0:3.10.0-514.6.1.el7

yum update kernel-tools

yum update kernel-tools-libs

yum update python-perf

RHSA-2016:2615: bind security update (Important)

软件:bind-libs-lite 9.9.4-37.el7

命中:bind-libs-lite version less than 32:9.9.4-38.el7_3

yum update bind-libs-lite

yum update bind-license

RHSA-2017:1680: bind security and bug fix update (Important)

软件:bind-libs-lite 9.9.4-37.el7

命中:bind-libs-lite version less than 32:9.9.4-50.el7_3.1

yum update bind-libs-lite

yum update bind-license

RHSA-2017:1308: kernel security, bug fix, and enhancement update (Important)

软件:kernel-tools 3.10.0-514.el7

命中:kernel-tools version less than 0:3.10.0-514.21.1.el7

yum update kernel-tools

yum update kernel-tools-libs

yum update python-perf

RHSA-2017:0062: bind security update (Important)

软件:bind-libs-lite 9.9.4-37.el7

命中:bind-libs-lite version less than 32:9.9.4-38.el7_3.1

yum update bind-libs-lite

yum update bind-license

RHSA-2017:0386: kernel security, bug fix, and enhancement update (Important)

软件:kernel-tools 3.10.0-514.el7

命中:kernel-tools version less than 0:3.10.0-514.10.2.el7

yum update kernel-tools

yum update kernel-tools-libs

yum update python-perf

RHSA-2017:1095: bind security update (Important)

软件:bind-libs-lite 9.9.4-37.el7

命中:bind-libs-lite version less than 32:9.9.4-38.el7_3.3

yum update bind-libs-lite

yum update bind-license

RHSA-2017:2299: NetworkManager and libnl3 security, bug fix and enhancement update (Moderate)

软件:libnl3 3.2.28-2.el7

命中:libnl3 version less than 0:3.2.28-4.el7

yum update libnl3

yum update libnl3-cli

yum update NetworkManager

yum update NetworkManager-libnm

yum update NetworkManager-team

yum update NetworkManager-tui

yum update NetworkManager-wifi

RHSA-2017:1615: kernel security and bug fix update (Important)

软件:kernel-tools 3.10.0-514.el7

命中:kernel-tools version less than 0:3.10.0-514.26.1.el7

yum update kernel-tools

yum update kernel-tools-libs

yum update python-perf

RHSA-2017:1842: kernel security, bug fix, and enhancement update (Important)

软件:kernel-tools 3.10.0-514.el7

命中:kernel-tools version less than 0:3.10.0-693.el7

yum update kernel-tools

yum update kernel-tools-libs

yum update python-perf

RHSA-2017:0933: kernel security, bug fix, and enhancement update (Important)

软件:kernel-tools 3.10.0-514.el7

命中:kernel-tools version less than 0:3.10.0-514.16.1.el7

yum update kernel-tools

yum update kernel-tools-libs

yum update python-perf

2018年3月25日更新

RHSA-2017:3075: wget security update

CVE-2017-13090 高危CVE-2017-13089 高危 GNU Wget缓冲区溢出漏洞

软件:wget 1.14-15.el7

命中:wget version less than 0:1.14-15.el7_4.1

yum update wget

基线检查

Centos7系统基线合规检测

检查项:系统crontab权限设置

加固建议:依次执行如下命令

rm -f /etc/cron.deny

rm -f /etc/at.deny

touch /etc/cron.allow

touch /etc/at.allow

chmod 0600 /etc/cron.allow

chmod 0600 /etc/at.allow

检查项:禁止转发ICMP重定向报文

加固建议:执行sysctl -w net.ipv4.conf.all.send_redirects=0,再查看/etc/sysctl.conf中是否存在net.ipv4.conf.all.send_redirects=0,不存在则添加

检查项:禁止转发ICMP重定向报文

加固建议:执行sysctl -w net.ipv4.conf.default.send_redirects=0,再查看/etc/sysctl.conf中是否存在net.ipv4.conf.default.send_redirects=0,不存在则添加

检查项:禁止包含源路由的ip包

加固建议:执行sysctl -w net.ipv4.conf.all.accept_redirects=0,再查看/etc/sysctl.conf中是否存在net.ipv4.conf.all.accept_redirects=0,不存在则添加

检查项:禁止包含源路由的ip包

加固建议:执行sysctl -w net.ipv4.conf.default.accept_redirects=0,再查看/etc/sysctl.conf中是否存在net.ipv4.conf.default.accept_redirects=0,不存在则添加

检查项:禁止转发安全ICMP重定向报文

加固建议:执行sysctl -w net.ipv4.conf.all.secure_redirects=0,再查看/etc/sysctl.conf中是否存在net.ipv4.conf.all.secure_redirects=0,不存在则添加

检查项:禁止转发安全ICMP重定向报文

加固建议:执行sysctl -w net.ipv4.conf.default.secure_redirects=0,再查看/etc/sysctl.conf中是否存在net.ipv4.conf.default.secure_redirects=0,不存在则添加

检查项:启用反转地址路径过滤

加固建议:执行sysctl -w net.ipv4.conf.all.rp_filter=1,再查看/etc/sysctl.conf中是否存在net.ipv4.conf.all.rp_filter=1,不存在则添加

检查项:启用反转地址路径过滤

加固建议:执行sysctl -w net.ipv4.conf.default.rp_filter=1,再查看/etc/sysctl.conf中是否存在net.ipv4.conf.default.rp_filter=1,不存在则添加

检查项:禁止ipv6路由广播

加固建议:执行sysctl -w net.ipv6.conf.all.accept_ra=0,再查看/etc/sysctl.conf中是否存在net.ipv6.conf.all.accept_ra=0,不存在则添加

检查项:禁止ipv6路由广播

加固建议:执行sysctl -w net.ipv6.conf.default.accept_ra=0,再查看/etc/sysctl.conf中是否存在net.ipv6.conf.default.accept_ra=0,不存在则添加

检查项:禁止ipv6路由重定向

加固建议:执行sysctl -w net.ipv6.conf.all.accept_redirects=0,再查看/etc/sysctl.conf中是否存在net.ipv6.conf.all.accept_redirects=0,不存在则添加

检查项:禁止ipv6路由重定向

加固建议:执行sysctl -w net.ipv6.conf.default.accept_redirects=0,再查看/etc/sysctl.conf中是否存在net.ipv6.conf.default.accept_redirects=0,不存在则添加

检查项:密码授权新密码与老密码不能重复

加固建议:在/etc/pam.d/password-auth中添加:password sufficient pam_unix.so remember=3 ,remember的值表示此次设置密码与过去3次不同

检查项:系统授权新密码与老密码不能重复

加固建议:在/etc/pam.d/system-auth中添加:password sufficient pam_unix.so remember=3 ,remember的值表示此次设置密码与过去3次不同

检查项:rsyslog日志文件权限配置

加固建议:在/etc/rsyslog.conf中添加:$FileCreateMode 0640

检查项:禁止root直接登录

加固建议:注意:在修改此项之前,请务必创建一个可登陆账号;在/etc/ssh/sshd_config中PermitRootLogin的值:yes设置为no

检查项:默认登录端口检测

加固建议:在/etc/ssh/sshd_config中取消Port 22注释符号#,并修改22为其它值

检查项:SSHD强制使用V2安全协议

加固建议:在/etc/ssh/sshd_config中取消Protocol注释符号#

检查项:SSHD仅记录ssh用户登录活动

加固建议:在/etc/ssh/sshd_config中取消LogLevel INFO注释符号#

检查项:SSHD仅记录ssh用户登录活动

加固建议:在/etc/ssh/sshd_config中取消MaxAuthTries注释符号#,设置自定义最大密码尝试失败次数

检查项:清理主机远程登录历史主机记录

加固建议:在/etc/ssh/sshd_config中取消IgnoreRhosts yes注释符号#

检查项:禁止主机认证登录

加固建议:在/etc/ssh/sshd_config中取消HostbasedAuthentication no注释符号#

检查项:禁止空密码用户登录

加固建议:在/etc/ssh/sshd_config中取消PermitEmptyPasswords no注释符号#

检查项:禁止用户修改环境变量

加固建议:在/etc/ssh/sshd_config中取消PermitUserEnvironment no注释符号#

检查项:设置输入密码间隔时间

加固建议:在/etc/ssh/sshd_config中取消LoginGraceTime前注释符,同时设置输入密码时间间隔秒数

检查项:设置用户密码最小长度

加固建议:在/etc/security/pwquality.conf中取消minlen注释符号#,同时设置最小密码长度建议10位以上

检查项:设置用户密码数字位数

加固建议:在/etc/security/pwquality.conf中取消dcredit注释符号#,同时设置为负数建议-1最少包含1位数字

检查项:设置用户密码大写字母位数

加固建议:在/etc/security/pwquality.conf中取消ucredit注释符号#,同时设置为负数建议-1最少包含1位大写字母

检查项:设置用户密码小写字母位数

加固建议:在/etc/security/pwquality.conf中取消lcredit注释符号#,同时设置为负数建议-1最少包含1位小写字母

检查项:设置用户密码特殊字符位数

加固建议:在/etc/security/pwquality.conf中取消ocredit注释符号#,同时设置为负数建议-1最少包含1位特殊字符

检查项:强制密码失效时间

加固建议:在/etc/login.defs 设置强制密码失效时间,建议值365

检查项:密码修改最小间隔时间

加固建议:在/etc/login.defs 设置密码修改最小间隔时间,建议值7

检查项:设置有密码账户不活动最大时间

加固建议:使用如下命令设置有密码账户不活动最大时间值:useradd -D -f 1095,建议值1095天

检查项:检查/boot/grub2/grub.cfg文件ACL属性

加固建议:执行:chmod 0600 /boot/grub2/grub.cfg

检查项:检查/etc/crontab文件ACL属性

加固建议:执行:chmod 0600 /etc/crontab

检查项:检查/etc/cron.hourly文件ACL属性

加固建议:执行:chmod 0600 /etc/cron.hourly

检查项:检查/etc/cron.daily文件ACL属性

加固建议:执行:chmod 0600 /etc/cron.daily

检查项:检查/etc/cron.weekly 文件ACL属性

加固建议:执行:chmod 0600 /etc/cron.weekly

检查项:检查/etc/cron.monthly 文件ACL属性

加固建议:执行:chmod 0600 /etc/cron.monthly

检查项:检查/etc/cron.d 文件ACL属性

加固建议:执行:chmod 0600 /etc/cron.d

SSH登录基线检测

检测项目:port

当前值:该项不存在

建议值:设置为非22

建议:修改登录端口为非默认22端口

检测项目:permitrootlogin

当前值:yes

建议值:设置为no

建议:没有必要使用root用户通过SSH远程登录,普通用户可以通过su或sudo(推荐)获得root级别的访问权

密码策略合规检测

检测项目:密码最长使用时间

建议:在/etc/login.defs 设置密码最长使用时间,建议值1095

检测项目:密码修改最小间隔时间

建议:在/etc/login.defs 设置密码修改最小间隔时间,建议值7

检测项目:设置有密码账户不活动最大时间

建议:使用如下命令设置有密码账户不活动最大时间值:useradd -D -f 1095,建议值1095天