Skip to content
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

Add support for JKS files to x509_cert plugin #7013

Closed
elizabetht opened this issue Feb 12, 2020 · 8 comments
Closed

Add support for JKS files to x509_cert plugin #7013

elizabetht opened this issue Feb 12, 2020 · 8 comments
Labels
feature request Requests for new plugin and for new features to existing plugins

Comments

@elizabetht
Copy link

Relevant telegraf.conf:

[[inputs.x509_cert]]
  sources = ["/etc/path-to-jks/server.jks"]

System info:

telegraf-1.13.2-1.x86_64 is included in the package

Steps to reproduce:

  1. Update the above telegraf config and reload telegraf-client
  2. Errors appear in the telegraf-client logs
    E! [inputs.x509_cert] Error in plugin: cannot get SSL cert '/etc/path-to-jks/server.jks': failed to parse certificate PEM

Expected behavior:

x509_cert plugin to parse JKS certificate files

Actual behavior:

Getting errors in the telegraf-client logs

 E! [inputs.x509_cert] Error in plugin: cannot get SSL cert '/etc/corona/server.jks': failed to parse certificate PEM

Additional info:

@elizabetht
Copy link
Author

elizabetht commented Feb 12, 2020

Is JKS file supposed to be supported by this plugin? If not, can it be supported?

@danielnelson
Copy link
Contributor

Unfortunately the plugin does not support JKS format, we only have support for PEM encoded certs. We are interested in adding support for additional formats though, I'll mark this as a feature request.

@danielnelson danielnelson added the feature request Requests for new plugin and for new features to existing plugins label Feb 12, 2020
@danielnelson danielnelson changed the title x509_cert plugin fails to parse JKS file Add support for JKS files to x509_cert plugin Feb 12, 2020
@elizabetht
Copy link
Author

Thanks @danielnelson. Looking forward to this feature getting implemented.

@Nurlan199206
Copy link

@elizabetht you can use input.exec plugin with bash scripts.

Снимок экрана 2020-07-03 в 22 55 05

@gilgameshfreedom
Copy link

+1 for this feature. Currently we have to deploy java jetty server which reads and used jks certs and envoy monitors jks certs through jetty (as common pem). But this approach is lightly awkward.

@sspaink
Copy link
Contributor

sspaink commented Aug 2, 2022

Looking for a Go solution to parse the JKS format I found this: https://github.com/pavlo-v-chernykh/keystore-go which seems like the most mature solution. Although the problem I am seeing is it doesn't provide an exact match to the existing fields and tags the plugin outputs. I am not too familiar with the JKS format if this is a limitation of the package or the format, curious if anyone interested in this feature could share what fields and tags they would be interested in getting if the plugin could parse JKS?

@sspaink sspaink added the waiting for response waiting for response from contributor label Aug 2, 2022
@telegraf-tiger
Copy link
Contributor

Hello! I am closing this issue due to inactivity. I hope you were able to resolve your problem, if not please try posting this question in our Community Slack or Community Page. Thank you!

@Illutax
Copy link

Illutax commented Apr 3, 2023

It's odd that you have to work with the jks and doesn't have the certificates laying around. But you might create your own Telegraf plugin consisting of a bash script, which extracts the p12 from the keystore using openssl and then writing the metric.

For reference here is a full tutorial: https://songrgg.github.io/operation/how-to-check-and-monitor-tls-jks-certificates-with-telegraf/

@telegraf-tiger telegraf-tiger bot removed the waiting for response waiting for response from contributor label Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

No branches or pull requests

6 participants