Icinga / icingaweb2-module-x509

Keeps track of certificates as they are deployed in a network environment.
https://icinga.com/docs/x509/latest/
GNU General Public License v2.0
107 stars 24 forks source link

Unable to filter for Expired Certificates within a given threshold from the Web Interface #233

Closed gettoknowmii closed 9 months ago

gettoknowmii commented 10 months ago

Describe the bug

Previously i was able to list expired certificates from the web interface. However, after upgrading to the last x509 module. It no longer works. I am unable to list expired certificates from the web interface. The field does not even exists. Please see screenshots.

To Reproduce

Assuming you have icinga,icingaweb and x509 module installed and configure. Navigate to https://$URL/icingaweb2/x509/usage Try filtering for certificates that will expired in 30 days from the search filter bar. The field 'Expire' or 'Expiration' does not even exist

image
yhabteab commented 9 months ago

Hii @gettoknowmii, thanks for reporting!

The expires column was just an alias for valid_to - valid_from and we have dropped this in 1.2.0 as you can just use valid_to instead.

gettoknowmii commented 9 months ago

How can i used those two fields to get all certificates that will expired within 30 days. the query filter parameters would be really helpful.

gettoknowmii commented 9 months ago

I need a query using the valid_to - valid_from field to list all expired certs within 30 days

slalomsk8er commented 9 months ago

How can i used those two fields to get all certificates that will expired within 30 days. the query filter parameters would be really helpful.

I don't think valid_from is relevant if you need to get certs that expire in the next 30 days. For me this URI worked: /icingaweb2/x509/usage?certificate.valid_to<1710425865&certificate.valid_to>1707920265

yhabteab commented 9 months ago

There is also another expression column called duration (this is not a database column, but just an alias for valid_to -valid_from like the former column expires, but it is created when generating the query like (valid_to - valid_from) as duration).

Bildschirmfoto 2024-02-15 um 09 43 28
nilmerg commented 9 months ago

/icingaweb2/x509/certificates?certificate.valid_to>now&certificate.valid_to<30days should also work.

gettoknowmii commented 9 months ago

Awesome thank you