x509-certificate-exporter icon indicating copy to clipboard operation
x509-certificate-exporter copied to clipboard

Have a regex search for certificate files

Open AnuragEkkati opened this issue 3 years ago • 4 comments

While using the x509-cert-exporter, we realized that if the exporter is not able to read files it will report read_errors which is expected.

I see that there are 2 arg options right now available, either point to the exact file or directory. It will be great if we have an option to provide regex to search certificate files in a directory and read only them rather than reading other files ( say for example we have .key files in the same directory ) and reporting read errors

AnuragEkkati avatar Aug 25 '22 18:08 AnuragEkkati

If you can assign this ticket to me, i can implement this feature

AnuragEkkati avatar Aug 25 '22 23:08 AnuragEkkati

Hi @AnuragEkkati You are right this feature is lacking!

How would you see filters be added to arguments? A single regexp pattern applied to all target directories may not be flexible enough. Perhaps it could be appended to each path this way?

--watch-dir=/etc/ssl/certs
--watch-dir=/etc/app=\.crt$

Assigning ticket now, thanks a lot for offering help. Going with per path regexp may require some refactoring though.

Cheers

npdgm avatar Aug 26 '22 16:08 npdgm

Hello,

It seems that the feature was introduced in 3.0.7, it works well for me. The doc/readme was not updated though.

Byh0ki avatar Jul 22 '23 19:07 Byh0ki

(cc. @arcln as its the one who implemented the feature)

Byh0ki avatar Jul 22 '23 19:07 Byh0ki