Code Monkey home page Code Monkey logo

zabbix-ssl's Introduction

zabbix-ssl

Zabbix check SSL certificates

We have to different ways to check for ssl certificates

  1. If you have only one certificate per IP address, use the standard templates along with the ssltls.check script
  2. If you use multiple SSL certificates per IP address, then you need to use the ssltls-sni.check and Template_App_HTTPS_Autodiscovery.xml

This script and the templates allow your zabbix server to validate SSL certificates.

It supports direct SSL/HTTPS checks as well as STARTTLS connections Supported check types

  • simple Checks if SSL is active
  • startdate Startdate of certificate
  • enddate Enddate of certificate
  • lifetime How long the certificate is valid
  • ssl3 SSLv3 active ? (Poodle vulnerable) DISABLED per default This only works when your openssl binaries still have built in ssl3 support
  • digestmode Hash algorithm (For example detect SHA1 certificates)

How to install

  • Download the ssltls.check file to your Zabbix Server external script directory (Or your proxy if the servers are behind a Zabbix proxy)

    For example ExternalScripts=/usr/lib/zabbix/externalscripts

  • If your distribution uses the busybox timeout command, then you have to specify the -t parameter in both script files (Change it to timeout_bin="/usr/bin/timeout -t ")

  • Make it executable

  • Import the templates for the different check types in your zabbix server

  • Assign the templates to the hosts you wish to monitor

Additional setup required for SNI

Only needed if you have multiple certificates on the same IP+Port

  • Put the /etc/zabbix/zabbix_agentd.d/ssl-sites.conf in the config directory of your client agent (The server where your sites reside)
  • Put the /etc/zabbix/ssl_sites.json in the config directory of your client agent (The server where your sites reside) and modify the list of sites which should be checked. This is the list of certificates to check on this server Make sure it has a valid json syntax
  • Restart the zabbix agent

(C) 2018 André Schild <a.schild aarboard.ch>

zabbix-ssl's People

Contributors

a-schild avatar cbricart avatar kominoshja avatar marcin-gryszkalis avatar memberit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zabbix-ssl's Issues

POODLE check is not working correctly on newer openssl

ssltls.check does not work as expected with newer OpenSSL versions as the option "-ssl3" does not exist anymore.
Example output of manually calling the built command line when checking for POODLE vulnerability:

root@www:/root# /usr/bin/openssl s_client -connect mail:465 -ssl3
s_client: Option unknown option -ssl3
s_client: Use -help for summary.

I'm running Debian 9 with openssl 1.1.0f-3+deb9u2

scripts not working in Alpine Linux

All results are empty, only the "simple" check works. Which renders this plugin useless in the official Alpine Linux based docker container.

I will try to fix this myself and maybe make a pull request if it doesn't break on other distros.

Zabbix Template import all (HTTPS_Service AND HTTPS_Autodiscovery)

Shouldn't it be possible, to import both templates? I have a server with many SNI-Pages but also an other server with just one page. So it would be great to use both templates... If I import all templates, i receive an exception with the last one for the multiple-SNI-Pages: Template_App_HTTPS_Autodiscovery.xml

Zabbix-Server 3.4

Import Fails: Details
Created: Item "HTTPS service is running" on "Template App HTTPS Service Autodiscovery".
Updated: Discovery rule "HTTPS sites" on "Template App HTTPS Service Autodiscovery".
Created: Item prototype "HTTPS certificate end date {#SSLNAME}" on "Template App HTTPS Service Autodiscovery".
Created: Item prototype "HTTPS certificate time until expire {#SSLNAME}" on "Template App HTTPS Service Autodiscovery".
Created: Item prototype "HTTPS service running {#SSLNAME}" on "Template App HTTPS Service Autodiscovery".
Created: Item prototype "HTTPS sslv3 poodle vulnerable {#SSLNAME}" on "Template App HTTPS Service Autodiscovery".
Created: Item prototype "HTTPS certificate start date {#SSLNAME}" on "Template App HTTPS Service Autodiscovery".
Incorrect item value type "Numeric (float)" provided for trigger function "str(sha1)".

Any tipp? Thanks for the good work!

Work with Windows Server?

I see that the config file uses cat and a unix path to the json file. Does the Windows Zabbix Agent understand that, or do we need another config file for Windows web servers?

CRL check

Would you accept a PR for adding a sslcrl.check that works against CRL's.

This is primarily useful for those who use a private CA, and sometimes forget to update the CRL when using an offline CA.

Zabbix template import failed

When trying to import Template_App_HTTPS_Autodiscovery.xml on Zabbix 3.4, the import failed, mentioning that the value type 'Numeric (float)' for the function 'str(sha1)' is incorrect.

After removing the offending part of the expression, getting the template imported, and changing the value type of the item prototype "HTTPS certificate digest mode {#SSLNAME}" from 'Numeric (float)' to 'Text', the expression could be restored to the original one without problem.

<value_type>0</value_type>

ipv6 not working

Hi,

when HOST is an IPv6 address openssl s_client -connect 2001::2:33:4:25 does not work and it returns "argument malformed or ambiguous".

I got it fixed with the following patch

ipv6.txt

Error about locale

I'm getting this error for the

/usr/lib/zabbix/externalscripts/ssltls.check: line 124: warning: setlocale: LC_ALL: cannot change locale (en_GB.UTF8): No such file or directory
Signature Algorithm: sha256WithRSAEncryption Signature Algorithm: sha256WithRSAEncryption

so I changed to en_US.UTF8, but that just gave me the same error (except en_US.UTF8).

I changed to this:

LOC="C.UTF-8"

And set my default local in my Zabbix Docker image by adding to .env_srv

LANG=C.UTF-8 
LANGUAGE=C:en 
LC_ALL=C.UTF-8

So it seems to be working now.

Time until expired is unsigned

The values for the lifetime items are stored as unsigned numbers, causing data collection to fail once a certificate is expired because the negative numbers are not valid for the value type.

The trigger ... certificate on {HOSTNAME} expired is never triggered because the the condition ssltls.check[...,lifetime].last()}<0will never be satisfied.

This can be fixed by setting <value_type> to 0 (numeric float) for the lifetime items.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.