Added option to skip smtp/imap server certificate validation#1
Added option to skip smtp/imap server certificate validation#1conFrituur wants to merge 1 commit intopentagridsec:mainfrom
Conversation
|
Many thanks for your interest in the plugin. As a security company I hesitate to accept the change. While it is sometimes useful to disable cert verification for debugging, the plugin is for monitoring and monitoring only makes sense for infrastructure that has a certain degree of reason for being and I wonder why there is no valid certificate. I assume it is an internal server with a self-signed cert? Is it an option to put an IP address into the subject alternative name? How do other mail clients verify the certificate? |
|
Thanks for your reply! My usecase is a little bit more complicated than i let on. In my attempt to keep it simple, i may have created more confusion 😅 Let me try again:
The testVM does have valid certificates. The problem is, if i use the hostname of the certificate ( This can be overcome in multiple ways:
I was on the fence and figured implementing 'skip TLS validation' would also help out most other people. In my usecase i wasn't worried about the security aspect, because the traffic would stay on the private docker bridge between containers (using the internal containernames as Giving it a second thought after reading your comment, i think having separate address / SNI fields would be a neater ways to solve this. If you agree, i will refactor my change and make a new PR. The only caveat is that it wont help people with a self-signed certificate. |
|
I understand. Would it be an option to have a trustchain configuration on the Icinga plugin side and put the self-signed cert as trust-anchor there? That would work to establish a trust-relationship with a self-signed server cert, when the plugin client expects this. It may not work with prod-cert, when the hostname verification fails, but maybe it is possible to test an image by injecting a self-signed cert. |

First of, thank you for sharing your check script 🙂
I would like to connect to an IP directly instead of using a hostname. This would cause the certificate validation to fail. Just setting the
context.check_hostname = Falsemight work in my case, but skipping all validation covers more usecases. I would say that accepting any valid certificate is just as insecure as not checking at all anyhow.