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 clientcert expiration date as core fact. #9361

Open
reverson opened this issue May 22, 2024 · 2 comments
Open

Add clientcert expiration date as core fact. #9361

reverson opened this issue May 22, 2024 · 2 comments
Labels
enhancement New feature or request help wanted Issue has been reviewed & PRs are welcome

Comments

@reverson
Copy link

Use Case

Would be nice to see when clientcerts expire so we know when they need to be rotated, especially when using an external cert provider.

Describe the Solution You Would Like

Add expiration_date to the trusted fact hash

Describe Alternatives You've Considered

Build custom facts, however, the cert name is not available during the custom fact generation in order to get the cert file.

Additional Context

Add any other context or screenshots about the feature request here.

@reverson reverson added the enhancement New feature or request label May 22, 2024
@kruegerkyle95
Copy link

This would be convenient to have as a core fact. @reverson in my environment, we did write a custom fact to collect this information in part by using the puppet_ssldir fact from the puppet_agent module.

require 'openssl'
    begin
      hostname = Facter.value(:networking)['fqdn'].downcase
      cert_path = "#{Facter.value(:puppet_sslpaths)['certdir']['path']}/#{hostname}.pem"
      cert = OpenSSL::X509::Certificate.new File.read(cert_path)
      expiration = cert.not_after
    rescue
      expiration = nil
    end
    expiration

@tvpartytonight tvpartytonight added the help wanted Issue has been reviewed & PRs are welcome label May 28, 2024
@tvpartytonight
Copy link
Contributor

Thank you for reporting this issue. While we agree this is likely an improvement, we do not anticipate addressing this any time soon. We have add the help wanted label in case there are other contributors available to submit a patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Issue has been reviewed & PRs are welcome
Projects
None yet
Development

No branches or pull requests

3 participants