| 监控对象 | 公网域名证书、内部 mTLS 证书、私有 CA 签发证书 |
|---|---|
| 阈值设计 | 30 天预警、14 天提醒、7 天升级 |
| 采集方式 | openssl s_client 探测 + 本地文件扫描 + 资产清单核对 |
批量探测域名证书
批量探测域名证书
for h in example.com api.example.com; do
echo -n "$h: "
echo | openssl s_client -connect $h:443 -servername $h 2>/dev/null | openssl x509 -noout -enddate
done扫描本机证书文件
扫描本机证书文件
find /etc/ssl /etc/nginx -type f \( -name '*.pem' -o -name '*.crt' \) 2>/dev/null | while read f; do
e=$(openssl x509 -in "$f" -noout -enddate 2>/dev/null) && echo "$f $e"
done监控输出中保留 subject、issuer、SAN 与部署路径,便于告警时直接定位负责人与机器。