赞
踩
1.1 漏洞说明
1.2 漏洞修复
1.2.1 升级HTTPD到最新版本(2.4.53)
1.2.1.1 服务器有网的情况下执行以下操作:
安装CodeIT库
cd /etc/yum.repos.d
wget https://repo.codeit.guru/codeit.el7.repo
更新httpd
yum update httpd
检查是否更新版本
httpd -version
重启服务
systemctl restart httpd
1.2.1.2 服务器没有网执行以下操作
下载rpm包:
下载地址:https://repo.codeit.guru/packages/centos/7/x86_64/
下载以下rpm包
注意:版本号要与下图一致
执行以下命令:
rpm -ivh apr-1.7.0-2.el7.x86_64.rpm --force --nodeps
rpm -ivh apr-util-1.6.1-6.el7.x86_64.rpm --force --nodeps
rpm -ivh httpd-filesystem-2.4.53-2.codeit.el7.noarch.rpm --force --nodeps
rpm -ivh httpd-tools-2.4.53-2.codeit.el7.x86_64.rpm --force --nodeps
rpm -ivh openssl-quic-libs-1.1.1n-2.codeit.el7.x86_64.rpm --force --nodeps
rpm -Uvh httpd-2.4.53-2.codeit.el7.x86_64.rpm --force --nodeps
rpm -ivh mod_http2-2.0.2-2.codeit.el7.x86_64.rpm --force --nodeps
4. 查看是否升级成功
httpd -version
5.重启httpd服务
systemctl restart httpd
2.1 漏洞说明
2.2 漏洞修复
添加防火墙端口规则,禁止端口被外部机器访问:
查看防火墙状态
systemctl status firewalld
启动防火墙
systemctl start firewalld
添加规则,只允许集群内ip访问某个端口,示例
Zookeeper 2181
firewall-cmd --permanent --zone=public --add-port=1-2180/tcp
firewall-cmd --permanent --zone=public --add-port=2182-65535/tcp
firewall-cmd --permanent --zone=public --add-port=1-65535/udp
添加2181 端口向指定ip开放
firewall-cmd --permanent --add-rich-rule=“rule family=“ipv4” source address=“192.168.12.36” port protocol=“tcp” port=“2181” accept”
firewall-cmd --permanent --add-rich-rule=“rule family=“ipv4” source address=“192.168.12.63” port protocol=“tcp” port=“2181” accept”
firewall-cmd --permanent --add-rich-rule=“rule family=“ipv4” source address=“192.168.11.118” port protocol=“tcp” port=“2181” accept”
(放行keepalived组播地址)
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 --destination 224.0.0.18 --protocol vrrp -j ACCEPT
firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 0 --destination 224.0.0.18 --protocol vrrp -j ACCEPT
重新加载规则
firewall-cmd --reload
查看规则
firewall-cmd --list-all
3.1 漏洞说明
3.2 漏洞修复
3.2.1 设置x-pack证书
查看elasticsearch部署了几个节点,如果是多个节点,需要将生成的elastic-certificates.p12 文件拷贝到其他节点的conf目录下(如果是单节点可忽略此项);
./bin/elasticsearch-certutil ca
./bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12
注:生成证书文件后检查文件用户权限,可手动修改
3.2.2 开启x-pack认证
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
将以上边配置添加到配置文件中config/elasticsearch.yaml
3.2.3. 生成用户及密码
./bin/elasticsearch-setup-passwords auto(会生成随机密码,要做好备份)
可手动生成:./bin/elasticsearch-setup-passwords interactive
3.2.4. 修改密码
curl -H "Content-Type:application/json" -XPOST -u elastic 'http://127.0.0.1:9200/_xpack/security/user/elastic/_password' -d '{ "password" : "123456" }'
四、MySQL安全漏洞
4.1 漏洞说明
4.2 漏洞修复
注:根据漏洞扫描说明,升级mysql版本为大版本下的最新版本。如5.6版本只能升级5.6版本,不能升级为5.7版本
示例:mysql 5.6.26升级到mysql 5.6.46
4.2.1 检查mysql版本
mysql --version
4.2.2 下载安装包
https://downloads.mysql.com/archives/community/
4.2.3 备份mysql数据
mysqldump -u root -p iotplatform --all-databases --skip-lock-tables > all-data.sql
4.2.4 停止mysql
mysql -u root -p iotplatform --execute=“SET GLOBAL innodb_fast_shutdown=0”
service mysql stop (集群版,ambari界面停止)
4.2.5 升级安装包
rpm -Uvh MySQL*.rpm
4.2.6 启动mysql
service mysql start (集群版,ambari界面启动)
4.2.7 使用upgrade检查新旧版本兼容性
mysql_upgrade -uroot -p iotplatform
4.2.8 检查mysql版本
rpm -qa |grep -i mysql
mysql –version
5.1 漏洞说明
5.2 漏洞修复
编辑启动脚本,删除此配置项 -Dcom.sun.management.jmxremote.port=8118 ,并重启服务
vim /opt/xxx/xxx/xx/xxx/bin/startup.sh
6.1 漏洞说明
6.2 漏洞修复
修改docker配置文件/etc/docker/daemon.json
{
"bip": "172.25.0.1/16",
"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock" ]
}
将IP 修改成127.0.0.1
{
"bip": "172.25.0.1/16",
"hosts": ["tcp://127.0.0.1:2375", "unix:///var/run/docker.sock" ]
}
七、慢Dos攻击
7.1 漏洞说明
7.2 漏洞修复
描述:
将修改connectionTimeout=“20000”,将20000修改成2000即可
修改前:
<Connector port="8182" protocol="HTTP/1.1" connectionTimeout="20000" URIEncoding="UTF-8" redirectPort="8463" /> <Connector port="9029" protocol="AJP/1.3" redirectPort="8463" /> 修改后: <Connector port="8182" protocol="HTTP/1.1" connectionTimeout="2000" URIEncoding="UTF-8" maxThreads="100" minSpareThreads="50" maxSpareThreads="100" minProcessors="50" maxProcessors="100" enableLookups="false" acceptCount="100" redirectPort="8463" /> <Connector port="9029" protocol="AJP/1.3" redirectPort="8463" />
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。