# Configuration-less Advanced SSL Certificate Check Plugin

**URL:** <https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199>\
**Category:** Dynatrace Tips\
**Tags:** data-privacy-and-product-security, knowledge-sharing, extensions, synthetic-monitoring\
**Created:** [January 12, 2021, 2:00pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199 "2021-01-12T14:00:48Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [April 20, 2021, 10:35am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/21 "2021-04-20T10:35:01Z")

</div>

Hi&nbsp;[@andre\_vdveen](https://community.dynatrace.com/user/11931)&nbsp;,

sorry I checked my code, you are right. It used to work with disabled monitors as well bu I restricted that to enabled ones only to the large amount of monitors I was working with.

Give me a bit, I will add an option to make this configurable.  
Reinhard

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [April 20, 2021, 11:20am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/22 "2021-04-20T11:20:44Z")

</div>

Hi&nbsp;[@andre\_vdveen](https://community.dynatrace.com/user/11931),

Please see updated version (1.8) ([deployment package](https://github.com/reinhard-brandstaedter/dynatrace-plugin-certcheck/blob/main/plugin_deployment/custom.remote.python.certcheck.zip)), this introduces an option in the configuration UI to also consider disabled monitors.

 ![r_weber_0-1618917622626.png](https://global.discourse-cdn.com/dynatrace/original/2X/a/a56358eeec4f8e30d19f3547eb83ab68736b7bdd.png)

Reinhard

---

<div class="post-metadata">

**Author:** ![avdveen](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@avdveen](https://community.dynatrace.com/u/avdveen)\
**Post date:** [April 21, 2021, 5:52am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/23 "2021-04-21T05:52:31Z")

</div>

Hi&nbsp;[@r\_weber](https://community.dynatrace.com/user/35901),&nbsp;  
Fantastic! It now works as explained 😄  
Thank you for your work and effort and for the support with the plugin and for answering all my questions 😉

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [April 21, 2021, 8:46pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/24 "2021-04-21T20:46:03Z")

</div>

Hi&nbsp;[@andre\_vdveen](https://community.dynatrace.com/user/11931)&nbsp;,

you are very welcome! Thanks for your feedback and glad it’s useful and being used!

---

<div class="post-metadata">

**Author:** ![Sankar](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@Sankar](https://community.dynatrace.com/u/Sankar)\
**Post date:** [September 16, 2021, 9:22am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/25 "2021-09-16T09:22:24Z")

</div>

Hi @[r\_weber](https://community.dynatrace.com/user/35901)

I would like to configure the SSL cert expiry via dynatrace tool, i am not familiar with this tool

Currently client is not using any&nbsp;Synthetic&nbsp; monitor .

I have installed a Linux AWS instance and configure the ActiveGate way . It is visible on the Dynatrace tool. Further i have tried to upload your cert check plugin and try to configure the task getting

Configuration Error (Extension Doesnt Exist on given host)

I am not sure what is the Endpoint name . Kindly guide me..

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [September 17, 2021, 10:09am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/26 "2021-09-17T10:09:18Z")

</div>

Hi&nbsp;[@Sankar](https://community.dynatrace.com/user/44856)&nbsp;,

you probably forgot to also upload the plugin to the ActiveGate itself? It needs to be added via the UI (so that you can configure it in the UI), but also to the ActiveGate plugin directory (which is likely /opt/dynatrace/remotepluginmodule/plugin\_deployment).

Please copy the .zip archive to that directory and unzip it. Then this error should go away.

```markup
/opt/dynatrace/remotepluginmodule/plugin_deployment$ ls -1
custom.remote.python.certcheck
custom.remote.python.certcheck.zip

```

---

<div class="post-metadata">

**Author:** ![AlanZ](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/alanz/32/29676_2.png) [@AlanZ](https://community.dynatrace.com/u/AlanZ)\
**Post date:** [December 24, 2021, 9:17pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/27 "2021-12-24T21:17:51Z")

</div>

Very nice!

As a constructive comment and posting this on decembre 24th here is my wishlist 🙂

Option to configure per test configs with the tags (proxy, cert validity days, problem generation-yes/no).

Option to run on a synthetic activegate as our network rules are already set on those.

I wish you all a great holiday season!

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [December 31, 2021, 2:00pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/28 "2021-12-31T14:00:06Z")

</div>

Hi&nbsp;[@AlanZ](https://community.dynatrace.com/user/19668)&nbsp;,

If I get you correct: you want to add tags to a synthetic monitor config that are then used by the plugin for it’s execution? E.g. tag them with cert\_days: 30, proxy: my.proxy.com:3128, create problem: yes and upon execution these values are used during the check?

If you want to run the plugin on an synthetic AG this AG must support plugin execution. That is not a limit of the plugin itself, only a configuration setting on the AG to support synthetic AND plugin execution.

---

<div class="post-metadata">

**Author:** ![AlanZ](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/alanz/32/29676_2.png) [@AlanZ](https://community.dynatrace.com/u/AlanZ)\
**Post date:** [December 31, 2021, 11:09pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/29 "2021-12-31T23:09:08Z")

</div>

Yes exactly as you described, tags on synthetic tests themselves so that monitoring can be configured independently for each test as needed.

Thanks for the tips on the AG, not so sure a synthetic activegate can be enabled for plugins but I’ll continue my research. Any hints appreciated.

---

<div class="post-metadata">

**Author:** ![Bert\_VanderHeyd](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/bert_vanderheyd/32/162_2.png) [@Bert\_VanderHeyd](https://community.dynatrace.com/u/Bert_VanderHeyd)\
**Post date:** [January 21, 2022, 4:03pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/30 "2022-01-21T16:03:42Z")

</div>

Just want to share that I have created a new build of the plugin (same version) with Python 3.8. It was not working on a recent activegate since the update from 3.6 to 3.8.  
I have uploaded my build here:&nbsp;[Error(No module named '\_cffi\_backend') · Issue #4 · 360Performance/dynatrace-plugin-certcheck · GitHub](https://github.com/360Performance/dynatrace-plugin-certcheck/issues/4)

---

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [January 31, 2022, 7:43pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/31 "2022-01-31T19:43:14Z")

</div>

We have implemented this today as a POC for now. I noticed at the synthetic level there is also an option to do a ssl cert expiry check and fail if it expires within the next X days. Just so I can understand things more completely here, what would be some key benefits to using this AG extension rather than using this option at the synthetic level.

A few things that come to mind include not having to toggle this setting on for each synthetic, this extension will dynamically pick up new synthetics. In our env we could put in 1 tag and monitor all of them and any new ones created although undoubtedly some teams will want a different value for their days check then others so we may end up creating multiple endpoints. The other benefit I see is the AG extension simply creates an event and does not fail the synthetic like what using this setting at the synthetic level will do. Some of our teams have the availability % of their synthetic tied into a report and sent out to mgmt each month. We don’t actually care to fail the synthetic in this case because the site is actually up, the notification (no synthetic failure) of an upcoming expiry is better.

Appreciate any feedback here and great job with this extension! I am though just tying to weigh both options here.

---

<div class="post-metadata">

**Author:** ![ct\_27](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ct_27/32/10499_2.png) [@ct\_27](https://community.dynatrace.com/u/ct_27)\
**Post date:** [January 31, 2022, 10:02pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/32 "2022-01-31T22:02:29Z")

</div>

[@sivart\_89](https://community.dynatrace.com/user/17361)&nbsp;I have to say, this extension is AMAZING.&nbsp; We try to stay as close to native functionality as we can but in this case, the extension provides so many more benefits over native.

1) Cost, we have nearly 2,000 cert checks (yes, we have that many purchased certs).&nbsp; This extension lets us manage them in DT but run far more robust cert checks at no charge (unless you turn on the extensions optional metric recorder, which we do).

2) We check certs every 24 hours. DT’s solution only allows a max of 60 minutes between checks, which again, you’d have to now pay for because you’re using DTs native solution.

3) Problems won’t flutter…this extension not only opens a far more informative problem but it then self-checks every minute on the problems it opened to see if the cert issue has been resolved or not.&nbsp;If not, it keeps the same problem open for days, like it should. DT allows only for a max of 2 hours for a problem to exist before it closes it automatically (or marks as frequent issue [i think this is design flaw they hid behind frequent issue]).

4) This one updates how many days until the cert expires, Dynatrace just tells you it will expire in whatever the threshold value is (30 days or whatever)

5) The Event details and the Problem details tell you far more information like # of days from current date, CommonName, Issuer, NotAfter, NotBefore. It goes negative in days if the cert expired XXX days ago.

We actually have a few “SSLxx” profiles pre-setup.&nbsp; the XX is how many days till expiration to alert.&nbsp; This lines up with the TAG on the Synthetic. So if someone says instead of 30 days i want to be alerts in 15 days we just change the tag from SSL30 to SSL15. And now it auto adjusts to the new threshold.

WishList: I wish there were a way to do a Warning and a Critical alert.&nbsp; I have multiple ideas on ways to do this but the most user friendly would be a checkbox to activate “Warning Level” then allow the user to set another value for when to trigger a Warning alert if it goes below said value.&nbsp; It’s up to the user to not be stupid and enter 15 for warning and 30 for critical.

Wishlist#2:&nbsp; ability to handle wildcard certificates.&nbsp; No idea how to suggest this but know it’s something we need.

---

<div class="post-metadata">

**Author:** ![ct\_27](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ct_27/32/10499_2.png) [@ct\_27](https://community.dynatrace.com/u/ct_27)\
**Post date:** [January 31, 2022, 10:15pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/33 "2022-01-31T22:15:47Z")

</div>

[@AlanZ](https://community.dynatrace.com/user/19668)&nbsp;that’s an interesting request.&nbsp; I get where you are going and it would be kind of cool but i feel like once you start to do that you might regret it.&nbsp; Dynatrace doens’t do a great job of tag organization or display and because of the&nbsp; 5+ tags you’d need to add to each entity, it might become difficult to manage.&nbsp; Plus DT doesn’t yet allow for Editing of tags, you have to destroy then re-create.

I’m also thinking, kind of on the spot, that we all like configurations to stay somewhat centralized and applied broadly vs individually.&nbsp; Thinking this would get really hard to control, again because DT doesn’t have a great interface to manage tagging.

I’m the last person to step in the way of innovation. But I do request if&nbsp;[@r\_weber](https://community.dynatrace.com/user/35901)&nbsp;builds this in to please make it optional.

I do like your idea of “problem generation-yes/no” though. Wondering though if there is a different way to obtain that same result.&nbsp; I could see some benefits to this one.

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [February 1, 2022, 8:02am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/34 "2022-02-01T08:02:19Z")

</div>

Hi&nbsp;[@sivart\_89](https://community.dynatrace.com/user/17361)&nbsp;,

thanks for giving it a try and for the kudos! I have created the plugin out of need before Dynatrace was able to do any certificate duration validation. Shortly after I released this Dynatrace added the basic functionality of checking expiry dates as well.  
But as you have found, typically you do not want to fail a synthetic monitor when the certificate is about to expire as it usually doesn’t impact any availability or users until it really expires. Hence my approach.

Another reason for my approach was the frequency of the check. While it might make sense to check a site every minute it certainly isn’t required for things like certificates.

The third reason (not yet implemented) was to perform extended checks on certificates like cipher strength and so on (i might never do it but it is possible).

kr,

Reinhard

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [February 1, 2022, 9:01am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/35 "2022-02-01T09:01:37Z")

</div>

[@AlanZ](https://community.dynatrace.com/user/19668)&nbsp;,&nbsp;[@ct\_27](https://community.dynatrace.com/user/38037)&nbsp;,

thanks for the ideas and the feedback!

I agree that some customization of the checks via tags makes sense and it should be an optional fallback or override. E.g. a tag “proxy: host.domain:port” on a synthetic monitor could be used - if present - to connect via proxy. the tag “expiry: 30” coule be used to override the default setting in the endpoint configuration.  
I can see the benefit of that especially in terms of user permission control in larger environments, where an admin might want to define the standard check configuration and a individual synthetic monitor owner might want to override this standard with his own thresholds.  
Of course you can freely combine this with the approach you mentioned earlier&nbsp;[@ct\_27](https://community.dynatrace.com/user/38037)&nbsp;where you have different configurations based on different tags.

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [February 1, 2022, 11:29am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/36 "2022-02-01T11:29:37Z")

</div>

Hi&nbsp;[@ct\_27](https://community.dynatrace.com/user/38037)&nbsp;,

regarding the wildcard certificates…what wold be your expectation here. It shouldn’t bee too difficult to read the SAN extension and report (separately) if the hostname of the monitor matches the alternative hostname list.  
Currently the plugin only checks the expiry date of the certificate but doesn’t verify a hostname match (This is explicitly disabled on the SSL connection test to allow the use of the plugin on self-signed certificates as well without the need of importing a CA for the plugin).

I could think of doing a manual (optional) hostname validation against the CN and SAN (wildcard) of the certificate and report this as a separate error (“Certificate doesn’t match hostname”) additionally to the expiry alert.

Would that help?

kr,  
Reinhard

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [February 3, 2022, 8:41am UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/37 "2022-02-03T08:41:55Z")

</div>

Hi&nbsp;[@ct\_27](https://community.dynatrace.com/user/38037)&nbsp;,

I looked into the wildcard certificate topic and added a few extra info on the problem description. Actually, as the plugin doesn’t do any certificate common name and alternative name verification against the hostname used in the synthetic monitor you can already use it to check the expiry date of any certificate, wildcard or not.

It will not report any hostname mismatch as problem.

However this could be added. For now I just added a custom info field (HostnameVerified) that tells you if the hostname matches either the CN or the SAN list:

e.g. google uses a wildcard certificate:

 ![r_weber_0-1643877667374.png](https://global.discourse-cdn.com/dynatrace/original/3X/2/c/2cbfdc667725c14aea6a7a5e4bc6aa772d7355ae.png)

kr,

Reinhard

---

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [February 3, 2022, 3:23pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/38 "2022-02-03T15:23:17Z")

</div>

[@ct\_27](https://community.dynatrace.com/user/38037)&nbsp;[@sivart\_89](https://community.dynatrace.com/user/17361)&nbsp;[@Bert\_VanderHeyd](https://community.dynatrace.com/user/11940)&nbsp;[@AlanZ](https://community.dynatrace.com/user/19668)

Good news! I’ve added most of your suggestions to the latest version of my plugin&nbsp;. This includes:

- overriding global endpoint [configuration for expiry and proxy connections with tags](https://github.com/360Performance/dynatrace-plugin-certcheck#configuration-via-tags) on synthetic monitors
- validating the hostname used for the SSL connection against common name and alternative names found on the certificate. Note that this only posts a custom info on a problem but wouldn’t open a problem if the certificate is not about to expire.

Enjoy and as always feedback is welcome!

---

<div class="post-metadata">

**Author:** ![ct\_27](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ct_27/32/10499_2.png) [@ct\_27](https://community.dynatrace.com/u/ct_27)\
**Post date:** [February 3, 2022, 4:35pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/39 "2022-02-03T16:35:27Z")

</div>

Thank you.&nbsp; I’m scheduled to meet with co-worker later today. We’ll deploy the new code and I’ll get his input regarding wildcard stuff.

I never thought of “this enables non-admin Dynatrace users with no access to global plugin configuration to somewhat customize their checks”.&nbsp; So [@AlanZ](https://community.dynatrace.com/user/19668)&nbsp;idea is a really good one. Thanks for implementing it and thanks [@AlanZ](https://community.dynatrace.com/user/19668)&nbsp;for the great suggestions.

---

<div class="post-metadata">

**Author:** ![sivart\_89](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@sivart\_89](https://community.dynatrace.com/u/sivart_89)\
**Post date:** [February 4, 2022, 9:56pm UTC](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199/40 "2022-02-04T21:56:56Z")

</div>

[@r\_weber](https://community.dynatrace.com/user/35901)&nbsp;i love it! regarding limiting the endpoint to a single synthetic via a tag. does this field except a key value pair for the tag? or just a key?

[Previous page](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199.md?page=1)

[Next page](https://community.dynatrace.com/t/configuration-less-advanced-ssl-certificate-check-plugin/21199.md?page=3)
