1、SSL Medium Strength Cipher Suites Supported (SWEET32)漏洞修复
近期对公司开发环境的机器进行了安全扫描,在扫描安全报告中出现了SSL Medium Strength Cipher Suites Supported (SWEET32)漏洞。
-
漏洞报告
- 漏洞产生的原因
漏洞的原因主要是由于SSL/TLS协议中使用的DES(Data Encryption Standard)及Triple DES(3DES)密码存在安全缺陷。这些密码算法使用64位的块大小,使得远程攻击者能够通过Sweet32攻击获取纯文本数据。
- 漏洞解决的方式
避免使用存在安全缺陷的DES/3DES密码算法
禁用弱密码套件
-
解决方案:SSL密码套件替换
运行窗口执行gpedit.msc命令
按如下图的层级目录,选择SSL Configuration Settings
选择编辑SSL Cipher Suite Order,进行SSL Cipher Suite数据修改
修改为以下内容:
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256,
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384,
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256,
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P384,
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256,
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384,
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P256,
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P384,
TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384_P384,
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256_P256,
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256_P384,
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384_P384,
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256_P256,
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256_P384,
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA_P256,
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA_P384,
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA_P256,
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA_P384,
TLS_DHE_DSS_WITH_AES_256_CBC_SHA256,
TLS_DHE_DSS_WITH_AES_128_CBC_SHA256,
TLS_DHE_DSS_WITH_AES_256_CBC_SHA,
TLS_DHE_DSS_WITH_AES_128_CBC_SHA,
TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA
最后重启服务器
Linux,升级nginx-1.26.2
wget http://nginx.org/download/nginx-1.26.2.tar.gz
tar -zxvf nginx-1.26.2.tar.gz
cd nginx-1.26.2
nginx -V
sudo yum install -y gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel
./configure --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_slice_module --with-http_auth_request_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-debug
nginx -V
nginx -t
- 修改nginx 配置,
vi /etc/nginx/nginx.conf
listen 443 ssl;
server_name www.test.cn;
#ssl on;
ssl_certificate /home/ssl/test.cn.pem;
ssl_certificate_key /home/ssl/test.cn.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
if ($ssl_protocol = "TLSv1") {
return 444;
}
if ($ssl_protocol = "TLSv1.1") {
return 444;
}
重启nginx
systemctl restart nginx