Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

record_cert_info 是否匹配目前兼容了CN,也应该兼容SAN #25

Closed
1583669804 opened this issue Nov 13, 2024 · 6 comments · Fixed by #26
Closed

record_cert_info 是否匹配目前兼容了CN,也应该兼容SAN #25

1583669804 opened this issue Nov 13, 2024 · 6 comments · Fixed by #26
Labels
bug Something isn't working

Comments

@1583669804
Copy link

您使用的版本? | Your usage version?

registry.cn-hangzhou.aliyuncs.com/eryajf/cloud_dns_exporter@sha256:5e975901c28b89bd5ac2637fcb07a2c0894eac1ff252b66e026b691f22741a10

您遇到了什么问题? | What are your problems?

record_cert_info 中证书只匹配了CN,没有匹配SAN,导致会提示证书不匹配

您期望的结果是怎样的? | What is your expected outcome?

record_cert_info 满足CN+SAN即可

@1583669804 1583669804 added the bug Something isn't working label Nov 13, 2024
@eryajf
Copy link
Member

eryajf commented Nov 15, 2024

目前使用的逻辑如下:

https://github.com/eryajf/cloud_dns_exporter/blob/b0d7db5d0208207613ad3da0a908e5e8557f0c20/pkg/export/record_cert.go#L95

你的意思是CN,SAN这两个满足其一就判定为匹配吗,还是说两个都需要满足才行。

@1583669804
Copy link
Author

1583669804 commented Nov 15, 2024

目前使用的逻辑如下:

https://github.com/eryajf/cloud_dns_exporter/blob/b0d7db5d0208207613ad3da0a908e5e8557f0c20/pkg/export/record_cert.go#L95

你的意思是CN,SAN这两个满足其一就判定为匹配吗,还是说两个都需要满足才行。

应该是只要匹配到CN、SAN中任意一个就可以(泛域名也可以)
https://www.digicert.com/cn/faq/public-trust-and-certificates/what-is-a-multi-domain-san-certificate
https://www.cnblogs.com/zhangmingcheng/p/18412749

@eryajf
Copy link
Member

eryajf commented Nov 15, 2024

好的,我学习一下,随后如果有调整,这里给你答复

@1583669804
Copy link
Author

貌似没修复?

镜像:sha256:b976b47a09fbf3fb614501aa8e35d227a24d2ca0904662c69467f1de73a6dfb1
域名:https://ak-tw.hg-cdn.com/
metric:
record_cert_info{cert_matched="false",cloud_name="tencent-china-common",cloud_provider="tencent",created_date="2024-11-07",domain_name="hg-cdn.com",error_msg="...............",expiry_date="2025-11-07",full_record="ak-tw.hg-cdn.com",issuer_common_name="TrustAsia RSA DV TLS CA G3",issuer_organization="TrustAsia Technologies, Inc.",issuer_organizational_unit="",record_id="1837109117",subject_common_name="*.gryphline.com",subject_organization="",subject_organizational_unit=""} 351

image

@eryajf
Copy link
Member

eryajf commented Nov 22, 2024

@1583669804 又更新了一版,可以更新下镜像,试试是否能解决这个问题

@1583669804
Copy link
Author

@1583669804 又更新了一版,可以更新下镜像,试试是否能解决这个问题

已经验证成功,感谢

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants