使用 Ansible 修补 openssl #heartbleed(心脏出血漏洞)
pip install ansible
ansible-playbook -i your_inventory_file patch-openssl-CVE-2014-0160.yml
your_inventory_file 只需包含你的服务器列表:
192.168.0.10
webserver1.example.com
webserver2.example.com
db1.example.com
% openssl version -a
OpenSSL 1.0.1 14 Mar 2012
built on: Tue Aug 21 05:18:48 UTC 2012
-> 你需要修补(构建日期在 2014 年 4 月 7 日之前)
% openssl version -a
OpenSSL 1.0.1 14 Mar 2012
built on: Mon Apr 7 20:33:29 UTC 2014
-> 你的系统通常已修补(构建日期在 2014 年 4 月 7 日之后)
# openssl s_client -connect twitter.com:443 -tlsextdebug 2>&1| grep 'server extension "heartbeat" (id=15)'
TLS server extension "heartbeat" (id=15), len=1
-> 如果你使用 openssl,则心跳扩展已激活,可能需要修补
# openssl s_client -connect cloudflare.com:443 -tlsextdebug 2>&1| grep 'server extension "heartbeat" (id=15)'
-> cloudflare 已修补
Julien DAUPHANT