# MonitorAliSSL **Repository Path**: Davin168/adncm ## Basic Information - **Project Name**: MonitorAliSSL - **Description**: 阿里云批量账户监测,域名有效期,证书有效期,云解析记录中https有效期。 - **Primary Language**: Python - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2022-08-30 - **Last Updated**: 2024-09-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ADNCM Aliyun Domain name Certificate Monitoring ### 简介 阿里云批量账户监测,域名有效期,证书有效期,云解析记录中https有效期。 会扫描账户上所有域名的有效期,所有云盾证书的有效期(包括上传的证书),自动扫描域名解析记录中所有的域名是否开启https,https是否在有效期内。 ### 报警效果 - 域名有效期报警 ![1](image/1.png) - 证书有效期报警 ![2](image/2.png) ### 配置 修改config.py文件中的内容 阿里云子账户需要赋予权限:云解析,域名,证书 钉钉创建群机器人将加签的值和webhook填入 ```python #阿里云api账户 ali_auth = [ {'key':'<阿里云子账户key>','secret':'<阿里云子账户secret>','note':'<阿里云账户名>'}, {'key':'<阿里云子账户key>','secret':'<阿里云子账户secret>','note':'<阿里云账户名>'}, ] dingding_token = { 'webhook':'https://oapi.dingtalk.com/robot/send?access_token=xxxxxxxxxxx', 'signature':'SExxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' } ``` ### 运行 安装依赖模块 ```shell pip install -r requirements.txt ``` 运行阿里云证书监控 ```shell usr/bin/python3 /root/bin/ali_domain_monitor/get_ssl.py ``` 运行阿里云域名监控 ```shell usr/bin/python3 /root/bin/ali_domain_monitor/get_domain_aliyun.py ``` 运行腾讯云域名监控 ```shell usr/bin/python3 /root/bin/ali_domain_monitor/get_domain_tencent.py ``` 计划任务(每天10点执行) ```shell #阿里云域名,ssl证书监测 0 10 * * * /usr/bin/python3 /root/bin/ali_domain_monitor/get_ssl.py 0 10 * * * /usr/bin/python3 /root/bin/ali_domain_monitor/get_domain_aliyun.py #腾讯云域名监控 0 10 * * * /usr/bin/python3 /root/bin/ali_domain_monitor/get_domain_tencent.py ```