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

CertificateExpiration fires twice for a certificate that expires #785

Closed
zikato opened this issue Jul 30, 2020 · 2 comments
Closed

CertificateExpiration fires twice for a certificate that expires #785

zikato opened this issue Jul 30, 2020 · 2 comments

Comments

@zikato
Copy link
Contributor

zikato commented Jul 30, 2020

Steps to Reproduce

Run Invoke-DbcCheck -SqlInstance [instance] -Check CertificateExpiration on a server that has expired certificate.

Description of Bug

When a certificate is expired it fires off two failed tests:
"Database $($psitem.Database) certificate $($psitem.Name) has not expired on $($psitem.SqlInstance)"
"Database $($psitem.Database) certificate $($psitem.Name) does not expire for more than $CertificateWarning months on $($psitem.SqlInstance)"

The second check is redundant and pollutes the results.

@shaneis
Copy link
Collaborator

shaneis commented Aug 14, 2020

After reading the descriptions, I take back what I said; I don't think they're redundant.

  • The first check is searching for certificates that are currently expired.
  • The second check is searching for certificates that are not currently expired but will expire within a certain number of months.

There are a few certificates e.g. certificates to encrypt backups, that I'd like to be notified of if they are going to expire in <insert number here> of months in case they expire and my backup jobs suddenly break 😟

@zikato
Copy link
Contributor Author

zikato commented Aug 14, 2020

I didn't mean it that the check itself is redundant. But if you already have expired certificate, it should show up only in the Expired check, not in the expires in x months.

so add extra condition to second check that the certificate expiration > currentDatetime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants