CentOSでSSLサーバ証明書の有効期限が近づいたら通知を受ける

2011-05-05 23:00 | tag: , ,

CentOSにcrypto-utilsをインストールすると、SSLサーバ証明書の有効期限切れが1ヶ月以内に迫ると毎日メールで通知を受けることができます。これにより、うっかり更新作業を忘れて有効期限が切れてしまうという事故を防ぐことができます。

設定方法

crypto-utilをインストールするだけで設定完了です。

/etc/cron.daily/certwatchというスクリプトが作成され、Apacheで使用しているすべてのSSLサーバ証明書の有効期限のチェックが一日一回行われるようになります。

yum install crypto-utils

通知の例

SSLサーバ証明書の有効期限まで1ヶ月を切ると、以下のようなメールが毎日root宛に送られてきます。

################# SSL Certificate Warning ################

 Certificate for hostname 'www.example.com', in file:
    /etc/pki/tls/certs/BXXXXXXX.cer

 The certificate needs to be renewed; this can be done
 using the 'genkey' program.

 Browsers will not be able to correctly connect to this
 web site using SSL until the certificate is renewed.

 ##########################################################
                                 Generated by certwatch(1)