检查 Linux 上 OpenSSL 的安全性,可以从 版本、配置、协议/算法、证书、漏洞、运行时配置 等多个层面进行。下面按实用顺序给你一套完整检查清单。
openssl version -a
重点看:
| 版本 | 风险 |
|---|---|
| OpenSSL 1.0.1 系列 | 易受 Heartbleed |
| OpenSSL 1.0.2 | 已停止支持 |
| OpenSSL 3.0 之前 | 无 FIPS 等企业特性 |
✅ 建议:
dpkg -l | grep openssl
apt changelog openssl
rpm -qa | grep openssl
rpm -q --changelog openssl | head
常见漏洞:
可参考:
https://www.openssl.org/news/vulnerabilities.html
openssl s_client -connect example.com:443 -tls1
openssl s_client -connect example.com:443 -tls1_1
openssl s_client -connect example.com:443 -tls1_2
openssl s_client -connect example.com:443 -tls1_3
✅ 安全建议:
openssl ciphers -v
❌ 不安全:
✅ 安全示例:
openssl x509 -in cert.pem -text -noout
重点检查:
ls -l /etc/ssl/private/
✅ 建议:
600root/etc/ssl/openssl.cnf
[system_default_sect]
MinProtocol = TLSv1.2
CipherString = DEFAULT@SECLEVEL=2
✅ 建议:
SECLEVEL=2 或更高ldd /usr/bin/sshd | grep ssl
nginx -V
httpd -V
确认:
./testssl.sh example.com
功能:
nmap --script ssl-enum-ciphers -p 443 example.com
| 发行版 | 建议 |
|---|---|
| Ubuntu LTS | 使用系统更新 OpenSSL |
| RHEL / Rocky | 启用 RHEL 安全补丁 |
| 自建 OpenSSL | 风险高,需自行维护 |
✅ 不要随意混用多个 OpenSSL 版本
✅ OpenSSL 版本 ≥ 3.0
✅ 无已知 CVE
✅ 禁用 TLS ≤ 1.1
✅ 禁用弱加密算法
✅ 证书 ≥ 2048 位 / SHA-256
✅ 私钥权限 600
✅ 使用发行版官方包
如果你愿意,可以告诉我:
我可以给你 针对性的安全加固方案。