Git Product home page Git Product logo

ssl-cert-expiration-to-slack's Introduction

SSL Certificate Expiration to Slack

Verify the status of SSL certificate for one of more domains and post this to Slack. This is useful to monitor your own certificates but also certificates of external services you use.

Settings

  • DOMAINS: A list of domains you want to monitorg (eg: github.com;twitter.com;facebook.com)
  • DAYS_THRESHOLD: If the certificate is valid for more than DAYS_THRESHOLD, nothing will be posted to Slack.
  • SLACK_INCOMING_WEBHOOK_URL: URL of your incoming webhook

Deployment

Azure

Deploy to Azure

Clicking this button will let you create a new Azure Web App with a triggered web job that runs once per day (you can modify the CRON schedule in the settings.job file using the SCM site, changes are immediately applied).

This Resource Manager template will:

  1. Create the App Service Plan if it doesn't exist
  2. Change the App Service Plan to the SKU and WORKERSIZE you configure. So make sure you set values of your existing plan if you don't want any changes.
  3. Create a Web App with a Triggered Web Job

Web Job

Webtask

If you haven't configured Webtask on your machine run this first:

npm i -g wt-cli
wt init

Requires at least node 0.10.40 - if you're running multiple version of node make sure to load the right version, e.g. "nvm use 0.10.40"

If you just want to run it once:

wt create https://raw.githubusercontent.com/sandrinodimattia/ssl-cert-expiration-to-slack/master/task.js \
    --name ssl-cert-expiration-to-slack \
    --secret DOMAINS="google.com;facebook.com;twitter.com" \
    --secret DAYS_THRESHOLD=90 \
    --secret SLACK_INCOMING_WEBHOOK_URL="https://hooks.slack.com/services/xxx"

If you want to run it on a schedule (run every day at 10 AM for example):

wt cron schedule \
    --name ssl-cert-expiration-to-slack \
    --secret DOMAINS="google.com;facebook.com;twitter.com" \
    --secret DAYS_THRESHOLD=90 \
    --secret SLACK_INCOMING_WEBHOOK_URL="https://hooks.slack.com/services/xxx"
    --json \
    "30 10 * * *" \
    https://raw.githubusercontent.com/sandrinodimattia/ssl-cert-expiration-to-slack/master/task.js

If you decide you want to monitor more domains over time just rerun the command to replace your current job.

Windows/Linux

This is a simple Node.js application, so you can schedule it as a cron job, a scheduled task in Windows, ...

  • Run Node.js 5+
  • Update the config.json file or set the required environment variables

Usage:

npm install
node index

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.