Code Monkey home page Code Monkey logo

check-ssl's Introduction

check-ssl

GitHub version Build Status Go Report

Monitor SSL certificate validity for records with multiple IPs.

Compatible with Icinga, Nagios, Sensu, ... It uses the common exit codes.

Motivation

We have several domains which are using DNS RR for loadbalancing/availability.

Such domains are especially sensitive, when SSL certificates are renewed. Some of them can easily be missed or deployment fails. It's often hard to discover, which particular service is misconfigured.

So we've created this little tool to fill this gap. It will resolve all IPs belonging to a certain domain, check every one of them, validates that the certificate chains are correct and that they are still valid for some time.

It will handle both IPv4 and IPv6. Missing IPv6 connectivity will be reported in the result.

Example

$ check-ssl -host analytics.wywy.com
INFO 52.222.157.227  - *.wywy.com valid until 2018-11-16 23:59:59 +0000 UTC (654d 23h 56m 59s) 
INFO 52.222.157.169  - *.wywy.com valid until 2018-11-16 23:59:59 +0000 UTC (654d 23h 56m 59s) 
INFO 52.222.157.182  - *.wywy.com valid until 2018-11-16 23:59:59 +0000 UTC (654d 23h 56m 59s) 
INFO 52.222.157.140  - *.wywy.com valid until 2018-11-16 23:59:59 +0000 UTC (654d 23h 56m 59s) 
INFO 52.222.157.73   - *.wywy.com valid until 2018-11-16 23:59:59 +0000 UTC (654d 23h 56m 59s) 
INFO 52.222.157.18   - *.wywy.com valid until 2018-11-16 23:59:59 +0000 UTC (654d 23h 56m 59s) 
INFO 52.222.157.90   - *.wywy.com valid until 2018-11-16 23:59:59 +0000 UTC (654d 23h 56m 58s) 
INFO 52.222.157.121  - *.wywy.com valid until 2018-11-16 23:59:59 +0000 UTC (654d 23h 56m 58s)

Usage

Usage of ./check-ssl:
  -V	print version and exit
  -c uint
        critical validity in days (default 14)
  -connection-timeout duration
        timeout connection - see: https://golang.org/pkg/time/#ParseDuration (default 30s)
  -host string
        the domain name of the host to check
  -lookup-timeout duration
        timeout for DNS lookups - see: https://golang.org/pkg/time/#ParseDuration (default 10s)
  -w uint
        warning validity in days (default 30)

License

Copyright 2017 wywy GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

simple_text_formatter.go is based on the logrus project and licensed under the MIT License. See LICENSE-MIT for details.

This code is being actively maintained by some fellow engineers at wywy GmbH.

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.