-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x509 Certificate Input Plugin v1.19.0 does not work with URL #9384
Comments
Breaking change seems to be #6952 which has broken x509_cert https:// and other prefixes |
Same problem under Linux, too. |
@aslgithub and @pradig can you please test PR #9289? This should fix the problem... Would be good to get some confirmation that the issue is gone. The Windows artifact can be found here, trying to get the linux one built... |
Ok all artifacts built by CI can be found here including Linux. Just click on that small black rectangle to unfold the list. Would appreciate your feedback... |
Works for me now, Ubuntu 20.04.2 |
@srebhan [[inputs.x509_cert]] v1.18.1 output snip This artifact build notice the https is now assumed to be tcp If I remove the port in my config So it looks as if its now assuming everything is tcp ? |
These are my entries, and they work perfectly well:
|
@pradig In which case this is a Windows versus Ubuntu issue.. |
This is the output: x509_cert,common_name=www.xxx.com,host=orfeo,issuer_common_name=R3,public_key_algorithm=RSA,san=www.xxx.com,serial_number=3a220f4f2b064ad3a4c0d84436cbbe0a1ae,signature_algorithm=SHA256-RSA,source=tcp://www.xxx.com:443,verification=valid age=3551030i,enddate=1628236328i,expiry=4224969i,startdate=1620460328i,verification_code=0i 1624011359000000000 |
okay, so you have the same issue If you compare this to v1.18.0 for instance Thanks, |
I got your point now... |
I just had a look at the x509_cert documentation. It is a little bit inconsistent, the example config uses "tcp://example.org:443" but the sample output has "source=https://example.org:443". |
#6952 seems to be 'bad' that made these changes. If you look at It updated the readme to remove https from the example ## List certificate sources sources = ["/etc/ssl/certs/ssl-cert-snakeoil.pem", "https://example.org:443"]And changed it to ## List certificate sources, support wildcard expands for files ## Prefix your entry with 'file://' if you intend to use relative paths sources = ["/etc/ssl/certs/ssl-cert-snakeoil.pem", "tcp://example.org:443", "/etc/mycerts/*.mydomain.org.pem", "file:///path/to/*.pem"]But didn't update the example output which still shows as https correctly. I'd expect doing certificate checks against https is fairly fundamental, at least in our use, and how this is being requested as https through firewalls and proxies, and the source is displayed/selected/filtered. |
Well, I reckon that "tcp:" would be technically ok (as certificates are part of TLS, and this is agnostic of any higher level protocol, like https) -- but it is not what you would expect if you checked the certificate of a classical web site (which I guess is the major use case of this plugin). |
Confirmed, fixes it for me. |
@srebhan also confirmed as fixing for me, thank you. The request now matches the source. |
@pradig thanks for testing! |
Relevant telegraf.conf:
System info:
Windows Server 2019
Telegraf v1.19.0
Steps to reproduce:
Expected behavior:
Certificate details returned
Actual behavior:
No certificate details are returned
2021-06-16T16:52:07Z E! [inputs.x509_cert] could not find file: &{https:\my.server.com:443 false false }
Additional info:
Telegraf v1.18.1 on the same system does not show this issue.
The text was updated successfully, but these errors were encountered: