joe-elliott / cert-exporter

A Prometheus exporter that publishes cert expirations on disk and in Kubernetes secrets
Apache License 2.0
316 stars 87 forks source link

Not able to get details of JKS keystore as a secret #105

Open infa-kparida opened 2 years ago

infa-kparida commented 2 years ago

We are using cert exporter to monitor all out kubernetes tls secrets and it works perfectly fine.We have requirement to monitor secret created from jks file which is throwing error like

Error exporting secret Failed to parse as a pem

I feel only := pem.Decode(certBytes) is not able to handle secrets created from JKS. The secret content will be like

kafka.client.keystore.jks: MIIeCQIBAzCCH................... kafka.client.truststore.jks: /u3+7QAAAAIAAAC..................

joe-elliott commented 2 years ago

I don't know what jks is, but you are welcome to PR a change that would add this functionality. Hopefully there's a go parser somewhere?